This commit is contained in:
yangtao 2024-03-29 17:39:38 +08:00
parent 9a994f9526
commit 11689abdab
2 changed files with 1296 additions and 422 deletions

View File

@ -1,5 +1,5 @@
<template>
<view v-if="!successful" :style="viewColor">
<view v-if="!successful" >
<form report-submit='true'>
<view class='merchantsSettled'>
<!-- <view class="merchantBgCount">
@ -15,60 +15,75 @@
<view class='iconfont'>3</view>
</view>
<view class='navCon acea-row row-between-wrapper'>
<view style="margin-left: 10px;" class="on">基本信息</view>
<view style="margin-left: 20px;" class="on">基本信息</view>
<view style="margin-left: 20px;">企业资料文件</view>
<view style="margin-left: 10px;">开票及结算信</view>
<view style="margin-left: 10px;">开票及结算信</view>
</view>
</view>
<view class="application-record" @click="jumpToList">
<!-- <view class="application-record" @click="jumpToList">
申请记录
<text class="iconfont icon-xiangyou"></text>
</view>
</view> -->
<view class='list'>
<view class="item">
<view class="acea-row row-middle">
<text class="item-name required" >商户名称</text>
<input type="text" maxlength="30" placeholder="请输入商户名称" v-model="merchantData.enterprise_name" @input="validateBtn"
placeholder-class='placeholder' />
<input type="text" style="text-align: right;" maxlength="30" placeholder="请输入" v-model="shopInfo.shopName" @input="validateBtn" placeholder-class='placeholder' />
</view>
</view>
<view class="item">
<view class="acea-row row-middle">
<text class="item-name required">商家对接编号</text>
<input type="text" placeholder="请输入商家对接编号" v-model="merchantData.user_name" @input="validateBtn" placeholder-class='placeholder' />
</view>
</view>
<view class="item">
<view class="acea-row row-middle">
<text class="item-name">联系电话</text>
<input type="text" placeholder="请输入手机号" v-model="merchantData.phone" @input="validateBtn" placeholder-class='placeholder' />
</view>
</view>
<view class="item rel">
<view class="acea-row row-middle">
<text class="item-name">验证码</text>
<input type="text" placeholder="填写验证码" v-model="merchantData.yanzhengma" @input="validateBtn" class="codeIput"
placeholder-class='placeholder' />
<button class="code" :disabled="disabled" :class="disabled === true ? 'on' : ''" @click="handleVerify">
{{ text }}
</button>
</view>
</view>
<view class="item" v-if="isShowCode">
<view class="acea-row row-middle">
<text class="item-name">验证码</text>
<input type="text" placeholder="请输入验证码" class="codeIput" v-model="codeVal" @input="validateBtn"
placeholder-class='placeholder' />
<view class="imageCode" @click="again"><image :src="codeUrl" /></view>
<input type="text" style="text-align: right;" placeholder="请输入" v-model="shopInfo.shopId" @input="validateBtn" placeholder-class='placeholder' />
</view>
</view>
<view class="item">
<view class="uni-list">
<view class="uni-list-cell">
<view class="uni-list-cell-db acea-row row-middle">
<text class="item-name">商户分类</text>
<picker @change="bindPickerChange" :value="index" :range="array" range-key="category_name">
<input style="pointer-events:none" placeholder="请选择商户分类" type="text" readonly disabled v-model="mer_classification">
<text class="item-name required">营业执照注册地址</text>
<view class="acea-row row-middle" @click="changeRegion">
<input style="pointer-events:none;text-align: right;" placeholder="请选择" type="text" readonly disabled v-model="shopInfo.registerAddress">
<view class='iconfont icon-jiantou'></view>
</view>
</view>
</view>
</view>
</view>
<view class="item">
<view class="acea-row row-middle">
<text class="item-name"></text>
<input type="text" style="text-align: right;" placeholder="请输入详细地址" v-model="shopInfo.registerAddressDetail" @input="validateBtn" placeholder-class='placeholder' />
</view>
</view>
<view class="item">
<view class="uni-list">
<view class="uni-list-cell">
<view class="uni-list-cell-db acea-row row-middle">
<text class="item-name required">实际经营地址</text>
<view class="acea-row row-middle" @click="changeRegion2">
<input style="pointer-events:none;text-align: right;" placeholder="请选择" type="text" readonly disabled v-model="shopInfo.businessAddress">
<view class='iconfont icon-jiantou'></view>
</view>
</view>
</view>
</view>
</view>
<view class="item">
<view class="acea-row row-middle">
<text class="item-name"></text>
<input type="text" style="text-align: right;" placeholder="请输入详细地址" v-model="shopInfo.businessAddressDetail" @input="validateBtn" placeholder-class='placeholder' />
</view>
</view>
<view class="item">
<view class="uni-list">
<view class="uni-list-cell">
<view class="uni-list-cell-db acea-row row-middle">
<text class="item-name required">企业行业</text>
<picker @change="changeBusiness" :value="shopInfo.EnterpriseIndustry" :range="businessArray" range-key="category_name">
<input style="pointer-events:none;text-align: right;" placeholder="请选择" type="text" readonly disabled v-model="shopInfo.EnterpriseIndustry">
<view class='iconfont icon-jiantou'></view>
</picker>
</view>
@ -79,10 +94,41 @@
<view class="uni-list">
<view class="uni-list-cell">
<view class="uni-list-cell-db acea-row row-middle">
<text class="item-name">店铺类型</text>
<text class="item-name required">企业类型</text>
<picker @change="changeEnterprise" :value="shopInfo.EnterpriseType" :range="enterpriseArray" range-key="category_name">
<input style="pointer-events:none;text-align: right;" placeholder="请选择" type="text" readonly disabled v-model="shopInfo.EnterpriseType">
<view class='iconfont icon-jiantou'></view>
</picker>
</view>
</view>
</view>
</view>
<view class="item">
<view class="acea-row row-middle">
<text class="item-name required">企业客服电话</text>
<input type="text" style="text-align: right;" placeholder="请输入" v-model="shopInfo.EnterpriseServicePhone" @input="validateBtn" placeholder-class='placeholder' />
</view>
</view>
<view class="item">
<view class="acea-row row-middle">
<text class="item-name required">企业邮箱</text>
<input type="text" style="text-align: right;" placeholder="请输入" v-model="shopInfo.EnterpriseEmail" @input="validateBtn" placeholder-class='placeholder' />
</view>
</view>
<view class="item">
<view class="acea-row row-middle">
<text class="item-name required">企业对接人姓名</text>
<input type="text" style="text-align: right;" placeholder="请输入" v-model="shopInfo.EnterpriseName" @input="validateBtn" placeholder-class='placeholder' />
</view>
</view>
<view class="item">
<view class="uni-list">
<view class="uni-list-cell">
<view class="uni-list-cell-db acea-row row-middle">
<text class="item-name required">店铺类型</text>
<text class="iconfont wenhao" @click="getAgreement">?</text>
<picker @change="bindPickerChange1" :value="index1" :range="storeTypeArr" range-key="type_name">
<input style="pointer-events:none" placeholder="请选择店铺类型" type="text" disabled readonly v-model="mer_storeType">
<picker @change="" :value="shopInfo.shopType" :range="storeTypeArr" range-key="type_name">
<input style="pointer-events:none;text-align: right;" placeholder="请选择店铺类型" type="text" disabled readonly v-model="shopInfo.shopType">
<view v-if="mer_storeType" @tap.stop="mer_storeType=''" class="iconfont icon-guanbi2"></view>
<view class='iconfont icon-jiantou'></view>
</picker>
@ -90,31 +136,39 @@
</view>
</view>
</view>
<view class="item no-border">
<view class='acea-row row-middle'>
<text class="item-title">请上传营业执照及行业相关资质证明图片</text>
<text class="item-desc">(图片最多可上传10张,图片格式支持JPGPNGJPEG)</text>
<view class="upload">
<view class='pictrue' v-for="(item,index) in pics" :key="index" :data-index="index" @click="getPhotoClickIdx">
<image :src='item'></image>
<text class='iconfont icon-guanbi1' @click.stop='DelPic(index)'></text>
</view>
<view class='pictrue acea-row row-center-wrapper row-column' @click='uploadpic' v-if="pics.length < 10">
<text class='iconfont icon-icon25201'></text>
<view>上传图片</view>
<view class="item">
<view class="uni-list">
<view class="uni-list-cell">
<view class="uni-list-cell-db acea-row row-middle">
<text class="item-name required">是否退伍军人</text>
<radio-group @change="" >
<label class="label" v-for="(itm,idx) in isFalse" :key="idx">
<radio style="margin:0 10px;" :value="idx.toString()" :checked="shopInfo.isVeteran==idx">{{itm}}</radio>
</label>
</radio-group>
</view>
</view>
</view>
</view>
<view class="item no-border">
<checkbox-group @change='ChangeIsAgree'>
<checkbox class="checkbox" :checked="isAgree ? true : false" />已阅读并同意</checkbox-group>
<button class="settleAgree" @click="getConfig">入驻协议</button>
<view class="item">
<view class="uni-list">
<view class="uni-list-cell">
<view class="uni-list-cell-db acea-row row-middle">
<text class="item-name required">是否惠美乡村店铺</text>
<radio-group @change="" >
<label class="label" v-for="(itm,idx) in isFalse" :key="idx">
<radio style="margin:0 10px;" :value="idx.toString()" :checked="shopInfo.isFlagshipStore==idx">{{itm}}</radio>
</label>
</radio-group>
</view>
<button class='submitBtn' :class="validate === true ? 'on':''" @click="formSubmit">提交申请</button>
</view>
</view>
</view>
<button class='submitBtn' :class="validate === true ? 'on':''" @click="formSubmit">下一步</button>
</view>
</view>
</form>
<view class="settlementAgreement" v-if="showProtocol">
<view class="setAgCount">
<i class="icon iconfont icon-cha" @click="showProtocol = false"></i>
@ -125,24 +179,15 @@
</view>
</view>
</view>
<view class='loadingicon acea-row row-center-wrapper' v-if="loading">
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>
</view>
<Verify @success="success" :captchaType="'blockPuzzle'" :imgSize="{ width: '330px', height: '155px' }" ref="verify"></Verify>
</view>
<view class="settledSuccessMain" v-else :style="viewColor">
<view class="settledSuccessful">
<image class="image" src="../static/images/settledSuccessful.svg" alt="">
<view class="title">恭喜您的资料提交成功</view>
<view class="info">预计15个工作日内审核完毕平台客服会及时与您联系</view>
<view class="goHome" hover-class="none" @click="goHome">
返回首页
</view>
</view>
<areaWindow ref="areaWindow" :display="display" :address="[]"
@submit="OnChangeAddress" @changeClose="changeClose" :cityShow="1"></areaWindow>
<areaWindow ref="areaWindow2" :display="display2" :address="[]"
@submit="OnChangeAddress2" @changeClose="changeClose2" :cityShow="1"></areaWindow>
</view>
</template>
<script>
import areaWindow from '@/components/areaWindow';
import {
create,
verify,
@ -164,12 +209,34 @@
const app = getApp();
export default {
components: {
"jyf-parser": parser,
Verify
areaWindow,
},
data() {
return {
domain: HTTP_REQUEST_URL,
isFalse:['是','否'],
validate: false,
display: false,
display2: false,
shopInfo:{
shopName:'',
shopId:'',
registerAddress:'',
registerAddressDetail:'',
businessAddress:'',
businessAddressDetail:'',
EnterpriseIndustry:'',
EnterpriseType:'',
EnterpriseServicePhone:'',
EnterpriseEmail:'',
EnterpriseName:'',
shopType:'',
isVeteran:0,
isFlagshipStore:0,
},
cityArray:[],
businessArray:['制造业','农业','金融业','计算机业','其他'],
enterpriseArray:['国企','民营企业','外企','其他'],
mer_storeType: '',
cartId: '', //id
pinkId: 0, //id
couponId: 0, //id
@ -186,7 +253,6 @@
phone: "",
classification: ''
},
validate: false,
successful: false,
keyCode: "",
codeVal: "",
@ -203,46 +269,19 @@
type_name: '',
mer_type_id: ''
}],
mer_storeType: '',
pics: [],
tagStyle: {
img: 'width:100%;display:block;'
},
mer_i_id: null, // id
isType: false,
};
},
beforeDestroy() {
clearTimeout(this.timer)
},
computed: configMap({sys_intention_agree:''},mapGetters(['isLogin','viewColor','keyColor'])),
onLoad(options) {
if (this.isLogin) {
this.getClassfication();
this.getStoreType();
} else {
toLogin()
}
if (options.mer_i_id) {
this.mer_i_id = options.mer_i_id
uni.showLoading({
title: '获取数据中',
});
this.$nextTick(function() {
this.getGoodsDetails(options.mer_i_id)
})
}
},
onShow() {},
onReady() {},
methods: {
getConfig() {
this.isType = false;
this.showProtocol = true;
//
this.protocol = this.sys_intention_agree
computed: {
addressText(){
return this.shopInfo.registerAddress.map(v=>v.name).join('/');
}
},
/*获取发票说明*/
methods: {
getAgreement() {
let that = this
that.showProtocol = true;
@ -251,321 +290,52 @@
that.protocol = res.data.sys_merchant_type
})
},
//
getGoodsDetails(id) {
getGoodsDetails(id).then(res => {
let arr = Object.keys(this.merchantData)
let resData = res.data
arr.map(item => {
this.merchantData.enterprise_name = resData.mer_name
this.merchantData.user_name = resData.name
this.merchantData.phone = resData.phone
this.merchantData.classification = resData.merchant_category_id
this.merchantData.mer_type = resData.mer_type_id
})
this.pics = resData.images
this.mer_classification = this.getCategoryName(resData.merchant_category_id, this.array)
this.mer_storeType = this.getStoreTypeName(resData.mer_type_id, this.storeTypeArr)
uni.hideLoading();
})
changeRegion(){
this.display = true;
},
//
getCategoryName(id, arr) {
for (let i = 0; i < arr.length; i++) {
if (arr[i].merchant_category_id === id) {
return arr[i]['category_name']
}
//
changeClose() {
this.display = false;
},
changeRegion2(){
this.display2 = true;
},
//
changeClose2() {
this.display2 = false;
},
OnChangeAddress(address){
this.shopInfo.registerAddress = address.map(v=>v.name).join('/');
},
OnChangeAddress2(address){
this.shopInfo.businessAddress = address.map(v=>v.name).join('/');
},
validateBtn(){
let {shopName,
shopId,
registerAddress,
registerAddressDetail,
businessAddress,
businessAddressDetail,
EnterpriseIndustry,
EnterpriseType,
EnterpriseServicePhone,
EnterpriseEmail,
EnterpriseName,
shopType}=this.shopInfo;
if(shopName&&shopId&&egisterAddress&&registerAddressDetail&&businessAddress&&businessAddressDetail&&EnterpriseIndustry&&EnterpriseType&&EnterpriseServicePhone&&EnterpriseEmail&&EnterpriseName&&shopType){
this.validate=true;
}
},
//
getStoreTypeName(id, arr) {
for (let i = 0; i < arr.length; i++) {
if (arr[i].mer_type_id === id) {
return arr[i]['type_name']
}
}
},
bindPickerChange: function(e) {
this.index = e.target.value
let idx = e.target.value
this.merchantData.classification = this.array[idx]['merchant_category_id']
this.mer_classification = this.array[idx]['category_name']
this.validateBtn()
},
bindPickerChange1: function(e) {
this.index1 = e.target.value
let idx = e.target.value
this.merchantData.mer_type = this.storeTypeArr[idx]['mer_type_id']
this.mer_storeType = this.storeTypeArr[idx]['type_name']
this.validateBtn()
},
//
getClassfication: function() {
merClassifly()
.then(res => {
this.array = res.data
})
.catch(res => {
this.$util.Tips({
title: res
});
});
},
//
getStoreType: function() {
getStoreTypeApi()
.then(res => {
this.storeTypeArr = res.data
})
.catch(res => {
this.$util.Tips({
title: res
});
});
},
//
// idx
getPhotoClickIdx(e) {
let _this = this;
let idx = e.currentTarget.dataset.index;
_this.imgPreview(_this.pics, idx);
},
//
imgPreview: function(list, idx) {
// list url
if (list && list.length > 0) {
uni.previewImage({
current: list[idx], // Number H5
urls: list
});
}
},
toggleTab(str) {
this.$refs[str].show();
},
//
goHome() {
uni.switchTab({
url: '/pages/index/index'
});
},
again() {
this.getcaptcha()
},
/**
* 上传文件
*
*/
uploadpic: function() {
let that = this;
that.$util.uploadImageOne('upload/image', function(res) {
that.pics.push(res.data.path);
that.$set(that, 'pics', that.pics);
});
},
/**
* 删除图片
*
*/
DelPic: function(index) {
let that = this,
pic = this.pics[index];
that.pics.splice(index, 1);
that.$set(that, 'pics', that.pics);
},
getCode() {
let that = this
getCodeApi()
.then(res => {
that.keyCode = res.data.key;
})
.catch(res => {
that.$util.Tips({
title: res
});
});
},
async code(data) {
let that = this;
if (!that.merchantData.phone) return that.$util.Tips({
title: '请填写手机号码'
});
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(that.merchantData.phone)) return that.$util.Tips({
title: '请输入正确的手机号码'
});
await verify({
phone: that.merchantData.phone,
// key: that.codeKey,
// code: that.codeVal,
type: 'intention',
captchaType: 'blockPuzzle',
captchaVerification: data.captchaVerification
})
.then(res => {
that.$util.Tips({
title: res.msg
});
that.sendCode();
})
.catch(res => {
that.$util.Tips({
title: res
});
if (res.status == 402) {
// that.getcaptcha();
}
});
},
getcaptcha() {
let that = this
getCaptcha().then(data => {
that.codeUrl = data.data.captcha; //
that.codeVal = data.data.code; //
that.codeKey = data.data.key //key
})
that.isShowCode = true;
},
sendCode() {
if (this.disabled) return;
this.disabled = true;
let n = 60;
this.text = "剩余 " + n + "s";
const run = setInterval(() => {
n = n - 1;
if (n < 0) {
clearInterval(run);
}
this.text = "剩余 " + n + "s";
if (this.text < "剩余 " + 0 + "s") {
this.disabled = false;
this.text = "重新获取";
}
}, 1000);
},
onConfirm(val) {
this.region = val.checkArr[0] + '-' + val.checkArr[1] + '-' + val.checkArr[2];
},
ChangeIsAgree: function(e) {
this.isAgree = !this.isAgree;
changeBusiness(e){
this.shopInfo.EnterpriseIndustry=this.businessArray[e.target.value];
this.validateBtn();
},
formSubmit: function(e) {
let that = this;
if (that.validateForm() && that.validate) {
let requestData = {
phone: that.merchantData.phone,
mer_name: that.merchantData.enterprise_name,
name: that.merchantData.user_name,
code: that.merchantData.yanzhengma,
merchant_category_id: that.merchantData.classification,
mer_type_id: that.merchantData.mer_type,
images: that.pics
}
that.validate = false;
if (that.mer_i_id) {
updateGoodsRecord(that.mer_i_id, requestData).then(res => {
if (res.status == 200) {
title: '提交成功',
that.loading = true;
that.timer = setTimeout(() => {
that.successful = true;
that.validate = true;
}, 1000)
}
}).catch(res => {
that.validate = true;
that.$util.Tips({
title: res
});
})
} else {
create(requestData).then(data => {
if (data.status == 200) {
title: '提交成功',
that.loading = true;
this.timer = setTimeout(() => {
that.successful = true;
that.validate = true;
}, 1000)
}
}).catch(res => {
that.validate = true;
that.$util.Tips({
title: res
});
})
}
}
},
validateBtn: function() {
let that = this,
value = that.merchantData;
if (value.enterprise_name && value.user_name && value.phone && /^1(3|4|5|7|8|9|6)\d{9}$/i.test(value.phone) &&
value.yanzhengma && that.isAgree && value.classification) {
if (!that.isShowCode) {
that.validate = true;
} else {
if (that.codeVal) {
that.validate = true;
} else {
that.validate = false;
}
}
}else{
that.validate = false;
}
},
validateForm: function() {
let that = this,
value = that.merchantData;
if (!value.enterprise_name) return that.$util.Tips({
title: '请输入企业名称'
});
if (!value.user_name) return that.$util.Tips({
title: '请输入姓名'
});
if (!value.phone) return that.$util.Tips({
title: '请输入手机号'
});
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(value.phone)) return that.$util.Tips({
title: '请输入正确的手机号码'
});
if (!value.yanzhengma) return that.$util.Tips({
title: '请填写验证码'
});
if (!value.classification) return that.$util.Tips({
title: '请选择商户分类'
});
if (!that.isAgree) return that.$util.Tips({
title: '请勾选并同意入驻协议'
});
if (that.isShowCode && !that.codeVal) return that.$util.Tips({
title: '请填写图片验证码'
});
that.validate = true;
return true;
},
jumpToList() {
uni.navigateTo({
url: "/pages/store/applicationRecord/index"
})
},
success(data) {
this.$refs.verify.hide();
this.code(data);
},
handleVerify() {
if (!this.merchantData.phone) return this.$util.Tips({
title: '请输入手机号'
});
if (!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(this.merchantData.phone)) return this.$util.Tips({
title: '请输入正确的手机号码'
});
if (!this.isAgree) return this.$util.Tips({
title: '请勾选并同意入驻协议'
});
this.$refs.verify.show();
changeEnterprise(e){
this.shopInfo.EnterpriseType=this.enterpriseArray[e.target.value];
this.validateBtn();
}
}
}
@ -594,7 +364,7 @@
color: #B2B2B2;
}
.item-name{
width: 190rpx;
width: 240rpx;
}
.uni-list-cell {
position: relative;
@ -602,7 +372,7 @@
font-size: 14px;
color: #7a7a7a;
position: absolute;
right: 15px;
right: -16px;
top: 7rpx;
}
.icon-guanbi2{
@ -623,7 +393,7 @@
padding: 25rpx 0;
}
.merchantsSettled .nav .navCon {
padding: 0 62rpx;
padding: 0 50rpx;
text-align: center;
view{
text-align: center;
@ -668,7 +438,7 @@
padding-bottom: 22px;
margin: 0 15px;
position: absolute;
top: 240rpx;
top: 160rpx;
width: calc(100% - 30px);
}
@ -731,6 +501,9 @@
-webkit-align-items: center;
align-items: center;
padding-left: 2px;
display: flex;
flex-direction: row;
justify-content: space-between;
}
.acea-row.row-column {
-webkit-box-orient: vertical;
@ -820,7 +593,7 @@
color: #b4b1b4;
}
.merchantsSettled .list .item input {
width: 400rpx;
// width: 400rpx;
font-size: 30rpx;
}
.merchantsSettled .list .item .placeholder {

File diff suppressed because it is too large Load Diff