实名,帐号绑定,实名必填校验,实名与帐号绑定只在接单的时候进行校验

Please enter the commit message for your changes. Lines starting
This commit is contained in:
donqi 2022-07-26 00:17:20 +08:00
parent 3c3a7cba82
commit 338fcd9de6
5 changed files with 181 additions and 70 deletions

View File

@ -37,7 +37,7 @@ export default {
// return false; // return false;
}, },
success(res) { success(res) {
if (res.data.code !== 0) { if (!res || !res.data || res.data.code !== 0) {
uni.showToast({ uni.showToast({
title: '系统开小差啦T_T请稍后重试', title: '系统开小差啦T_T请稍后重试',
icon: 'error' icon: 'error'

View File

@ -36,7 +36,7 @@
}, },
goToBindBank() { goToBindBank() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/my/b-account-bind' url: '/pages/my/withdraw'
}) })
} }
} }

View File

@ -11,20 +11,28 @@
</view> </view>
<view v-if="curAccountType === '1'" class="bg-white padding text-lg"> <view v-if="curAccountType === '1'" class="bg-white padding text-lg">
<view> <view>
<view class="margin-bottom-sm">姓名</view> <view class="margin-bottom-sm">
姓名<text class="margin-left-xs text-red">*</text>
</view>
<input type="text" placeholder="请输入开户人姓名" placeholder-style="color:#989898" v-model="formData.name"> <input type="text" placeholder="请输入开户人姓名" placeholder-style="color:#989898" v-model="formData.name">
</view> </view>
<view class="margin-top"> <view class="margin-top">
<view class="margin-bottom-sm">证件号码</view> <view class="margin-bottom-sm">
<input type="text" placeholder="请输入证件号码" placeholder-style="color:#989898" v-model="formData.certId"> 身份证号码<text class="margin-left-xs text-red">*</text>
</view>
<input type="number" placeholder="请输入身份证号码" placeholder-style="color:#989898" v-model="formData.certId">
</view> </view>
<view class="margin-top"> <view class="margin-top">
<view class="margin-bottom-sm">手机号</view> <view class="margin-bottom-sm">
<input type="text" placeholder="请输入手机号" placeholder-style="color:#989898" v-model="formData.phone"> 手机号<text class="margin-left-xs text-red">*</text>
</view>
<input type="number" placeholder="请输入手机号" placeholder-style="color:#989898" v-model="formData.phone">
</view> </view>
<view class="margin-top"> <view class="margin-top">
<view class="margin-bottom-sm">号码</view> <view class="margin-bottom-sm">
<input type="text" placeholder="请输入号码" placeholder-style="color:#989898" v-model="formData.bankNum"> 银行卡号<text class="margin-left-xs text-red">*</text>
</view>
<input type="number" placeholder="请输入银行卡号" placeholder-style="color:#989898" v-model="formData.bankNum">
</view> </view>
</view> </view>
</view> </view>
@ -76,17 +84,35 @@
changAccountType(e) { changAccountType(e) {
this.curAccountType = e.currentTarget.dataset.type; this.curAccountType = e.currentTarget.dataset.type;
}, },
validData() {
if (!this.formData.name || !this.formData.certId || !this.formData.phone || !this.formData.bankNum) {
return false;
}
return true;
},
async submit() { async submit() {
if (this.curAccountType === '1') { if (this.curAccountType === '1') {
if (!this.validData()) {
uni.showToast({
icon: 'none',
title: '请完成必填项的填写'
})
return;
}
let params = { let params = {
...this.formData, ...this.formData,
workerId: this.curUserInfo.workerId workerId: this.curUserInfo.workerId
} }
let res = await this.$request.bindBankCard(params); let res = await this.$request.bindBankCard(params);
if (res.code === 0) { if (res && res.code === 0) {
uni.navigateBack({ uni.navigateBack({
delta: -1 delta: -1
}) })
} else if (res && res.msg) {
uni.showToast({
icon: 'none',
title: res.msg
})
} }
} }
} }

View File

@ -29,7 +29,7 @@
</view> </view>
<view class="cu-bar bg-white solid-top"> <view class="cu-bar bg-white solid-top">
<view class="action"> <view class="action">
身份证上传正反面 身份证上传正反面<text class="margin-left-xs text-red">*</text>
</view> </view>
</view> </view>
<view class="cu-form-group"> <view class="cu-form-group">
@ -47,11 +47,11 @@
</view> </view>
</view> </view>
<view class="cu-form-group"> <view class="cu-form-group">
<view class="title">姓名</view> <view class="title">姓名<text class="margin-left-xs text-red">*</text></view>
<input name="name" v-model="realNameInfo.name" placeholder="请输入真实姓名"></input> <input name="name" v-model="realNameInfo.name" placeholder="请输入真实姓名"></input>
</view> </view>
<view class="cu-form-group"> <view class="cu-form-group">
<view class="title">身份证号</view> <view class="title">身份证号<text class="margin-left-xs text-red">*</text></view>
<input name="idCardNum" type="idcard" v-model="realNameInfo.idCardNum" placeholder="请输入你的身份证号"></input> <input name="idCardNum" type="idcard" v-model="realNameInfo.idCardNum" placeholder="请输入你的身份证号"></input>
</view> </view>
</view> </view>

View File

@ -8,7 +8,7 @@
<!-- 表单内容 --> <!-- 表单内容 -->
<form @submit="submit"> <form @submit="submit">
<view class="cu-form-group"> <view class="cu-form-group">
<view class="title">服务名称</view> <view class="title">服务名称<text class="text-red margin-left-xs">*</text></view>
<input name="servName" v-model="formData.servName" placeholder="请编辑上架标题(供客户搜索)"></input> <input name="servName" v-model="formData.servName" placeholder="请编辑上架标题(供客户搜索)"></input>
</view> </view>
<view class="cu-form-group"> <view class="cu-form-group">
@ -17,7 +17,7 @@
</view> </view>
<view class="solid-top"> <view class="solid-top">
<view class="cu-form-group"> <view class="cu-form-group">
<view class="title">选择类目</view> <view class="title">选择类目<text class="text-red margin-left-xs">*</text></view>
<picker :mode="'multiSelector'" @change="categoryChange" @columnchange="categoryColChange" <picker :mode="'multiSelector'" @change="categoryChange" @columnchange="categoryColChange"
:value="categoryMultiIndex" :range-key="'goodsCategoryName'" :range="categoryList"> :value="categoryMultiIndex" :range-key="'goodsCategoryName'" :range="categoryList">
<input disabled class="line-input radius-input" <input disabled class="line-input radius-input"
@ -51,18 +51,19 @@
<input class="radius-input" @input="inputSpecs($event, index, 'deduct')" <input class="radius-input" @input="inputSpecs($event, index, 'deduct')"
:value="item.deduct" placeholder="追加提成额"></input> :value="item.deduct" placeholder="追加提成额"></input>
</view> </view>
<view class="flex-sub flex margin-left-xs"> <view class="flex-sub margin-left-xs">
<!-- <view class="flex-sub"> <input class="radius-input" @input="inputSpecs($event, index, 'groupPrice')"
<input class="radius-input" @input="inputSpecs($event, index, 'groupPrice')" :value="item.groupPrice" placeholder="团购价"></input>
:value="item.groupPrice" placeholder="团购价"></input> </view>
</view> --> </view>
<!-- <view class="flex-sub margin-left-xs"> --> <view class="flex margin-top-xs">
<view class="flex-sub"> <view class="flex-sub">
<input class="radius-input" @input="inputSpecs($event, index, 'goodsUnit')" <input class="radius-input" @input="inputSpecs($event, index, 'goodsUnit')"
:value="item.goodsUnit" placeholder="单位"></input> :value="item.goodsUnit" placeholder="规格单位"></input>
<!-- <my-uni-combox :candidates="productUnits" placeholder="请选择" v-model="formData.productUnit"> </view>
</my-uni-combox> --> <view class="flex-sub margin-left-xs">
</view> <input class="radius-input" @input="inputSpecs($event, index, 'goodsNum')"
:value="item.goodsNum" placeholder="库存"></input>
</view> </view>
</view> </view>
</view> </view>
@ -71,7 +72,7 @@
@click="showAllSpecs()"><text :class="'cuIcon-' + (isShowAllSpecs ? 'fold' : 'unfold')"></text> @click="showAllSpecs()"><text :class="'cuIcon-' + (isShowAllSpecs ? 'fold' : 'unfold')"></text>
</view> </view>
</view> </view>
<!-- <view class="bg-white"> --> <!-- <view class="solid-top"> -->
<!-- <view class="padding-lr flex align-center"> <!-- <view class="padding-lr flex align-center">
<view class="flex-twice flex justify-start align-center"> <view class="flex-twice flex justify-start align-center">
<view style="width: 20%;">单位</view> <view style="width: 20%;">单位</view>
@ -82,23 +83,32 @@
优惠券+ 优惠券+
</view> </view>
</view> --> </view> -->
<!-- <view class="padding-lr flex align-center padding-tb-xs"> <!-- <view class="padding-lr flex align-center padding-tb-xs"> -->
<view class="flex-sub"> <!-- <view class="cu-form-group"> -->
<checkbox style="transform:scale(1)" class="main-color margin-right-xs" :value="true" <!-- <checkbox style="transform:scale(1)" class="main-color margin-right-xs" :value="true"
:v-model="formData.isGoldenServ" :checked="formData.isGoldenServ"></checkbox> :v-model="formData.isGoldenServ" :checked="formData.isGoldenServ"></checkbox> -->
<text>金牌服务</text> <!-- <view class="title">金牌服务<text class="margin-left-xs text-red">*</text></view> -->
</view> <!-- <my-uni-combox :candidates="servHonorTitle" placeholder="请选择" v-model="formData.servHonorTitle"> -->
<view class="flex-twice flex justify-start align-center"> <!-- </my-uni-combox> -->
<!-- </view> -->
<!-- <view class="flex-twice flex justify-start align-center">
<view style="width: 25%;">质保期</view> <view style="width: 25%;">质保期</view>
<my-uni-combox :candidates="productProtectTimes" placeholder="请选择" <my-uni-combox :candidates="productProtectTimes" placeholder="请选择"
v-model="formData.productProtectTime"></my-uni-combox> v-model="formData.productProtectTime"></my-uni-combox>
</view> </view> -->
</view> --> <!-- </view> -->
<!-- </view> --> <!-- </view> -->
</view> </view>
<view class="cu-form-group solid-top justify-start">
<!-- <checkbox style="transform:scale(1)" class="main-color margin-right-xs" :value="true"
:v-model="formData.isGoldenServ" :checked="formData.isGoldenServ"></checkbox> -->
<view class="title">附加服务</view>
<my-uni-combox class="form-val-area" :candidates="servHonorTitle" placeholder="请选择" v-model="formData.servHonorTitle">
</my-uni-combox>
</view>
<view class="solid-top"> <view class="solid-top">
<view class="cu-form-group"> <view class="cu-form-group">
<view class="title">上架区域</view> <view class="title">上架区域<text class="margin-left-xs text-red">*</text></view>
<picker :mode="'multiSelector'" @change="regionChange" @columnchange="regionColChange" <picker :mode="'multiSelector'" @change="regionChange" @columnchange="regionColChange"
:value="regionMultiIndex" :range-key="'areaName'" :range="regionList"> :value="regionMultiIndex" :range-key="'areaName'" :range="regionList">
<input disabled class="line-input radius-input" <input disabled class="line-input radius-input"
@ -116,10 +126,12 @@
</checkbox-group> </checkbox-group>
</view> </view>
</view> </view>
<view class="cu-form-group"> <view class="cu-bar bg-white">
<view class="title">区域描述</view> <view class="action text-black">区域描述</view>
<input name="areaDesc" :value="formData.areaDesc" :v-model="formData.areaDesc" </view>
placeholder="请输入区域描述"></input> <view class="padding-lr-sm padding-bottom-sm bg-white">
<textarea name="areaDesc" style="width: 100%; height: 150rpx;" class="solid radius text-left padding-sm" v-model="formData.areaDesc"
maxlength="-1" placeholder="如XX区XX街道未覆盖或XX区仅服务XX街道"></textarea>
</view> </view>
<!-- <view class="cu-form-group"> <!-- <view class="cu-form-group">
<view class="title">上门费</view> <view class="title">上门费</view>
@ -128,7 +140,7 @@
</view> --> </view> -->
<view class="cu-bar bg-white solid-top"> <view class="cu-bar bg-white solid-top">
<view class="action text-black"> <view class="action text-black">
商品封面图上传 商品封面图上传<text class="margin-left-xs text-red">*</text>
</view> </view>
</view> </view>
<view class="cu-form-group"> <view class="cu-form-group">
@ -149,7 +161,7 @@
</view> </view>
<view class="cu-bar bg-white solid-top"> <view class="cu-bar bg-white solid-top">
<view class="action text-black"> <view class="action text-black">
详情图上传 详情图上传<text class="margin-left-xs text-red">*</text>
</view> </view>
</view> </view>
<view class="cu-form-group"> <view class="cu-form-group">
@ -170,7 +182,7 @@
</view> </view>
<view class="cu-bar bg-white solid-top"> <view class="cu-bar bg-white solid-top">
<view class="action text-black"> <view class="action text-black">
轮播图上传 轮播图上传<text class="margin-left-xs text-red">*</text>
</view> </view>
</view> </view>
<view class="cu-form-group"> <view class="cu-form-group">
@ -222,7 +234,7 @@
</view> </view>
</form> </form>
<!-- 账户及实名弹窗 --> <!-- 账户及实名弹窗 -->
<vertify-bank-bind ref="vertifyBankBind"></vertify-bank-bind> <!-- <vertify-bank-bind ref="vertifyBankBind"></vertify-bank-bind> -->
<vertify-certify ref="vertifyCertify"></vertify-certify> <vertify-certify ref="vertifyCertify"></vertify-certify>
</view> </view>
</template> </template>
@ -274,6 +286,13 @@
code: 5, code: 5,
name: '平方' name: '平方'
}], }],
servHonorTitle: [{
code: -1,
name: '无'
}, {
code: 1,
name: '金牌服务'
}],
productProtectTimes: [{ productProtectTimes: [{
code: 1, code: 1,
name: '15天' name: '15天'
@ -308,17 +327,17 @@
}, },
async checkBankAndCertify() { async checkBankAndCertify() {
// //
let bankCardRes = await this.$request.getBindBankCardByWorkerId({ // let bankCardRes = await this.$request.getBindBankCardByWorkerId({
workerId: this.curUserInfo.workerId // workerId: this.curUserInfo.workerId
}); // });
this.bankCard = bankCardRes.data; // this.bankCard = bankCardRes.data;
// //
let certifyInfoRes = await this.$request.getWorkerCertify(); let certifyInfoRes = await this.$request.getWorkerCertify();
this.certifyInfo = certifyInfoRes.data; this.certifyInfo = certifyInfoRes.data;
if (!this.bankCard || !this.bankCard.bankNum) { // if (!this.bankCard || !this.bankCard.bankNum) {
this.$refs.vertifyBankBind.showModal(); // this.$refs.vertifyBankBind.showModal();
return false; // return false;
} else if (!this.certifyInfo || !this.certifyInfo.workerCertificationId) { if (!this.certifyInfo || !this.certifyInfo.workerCertificationId) {
this.$refs.vertifyCertify.showModal(); this.$refs.vertifyCertify.showModal();
return false; return false;
} }
@ -513,17 +532,65 @@
// this.formData.video = await this.$request.uploadFile(e.tempFilePaths[0]); // this.formData.video = await this.$request.uploadFile(e.tempFilePaths[0]);
// uni.hideLoading(); // uni.hideLoading();
// }, // },
async submit() { validData(data) {
let checkRes = await this.checkBankAndCertify(); let errMsg = "";
if (!checkRes) { if (!data.servName) {
return; errMsg = '服务名称不能为空';
} else if (!data.goodsStandardList || !data.goodsStandardList.length) {
errMsg = '至少选择一个规格';
} else if (!this.validSpecData(data.goodsStandardList)) {
return false;
} else if (!data.goodsAreaList || !data.goodsAreaList.length) {
errMsg = '至少选择一个上架区域';
} else if (!data.coverImgList || !data.coverImgList.length) {
errMsg = '封面图不能为空'
} else if (!data.descImgList || !data.descImgList.length) {
errMsg = '详情图不能为空'
} else if (!data.imgList || !data.imgList.length) {
errMsg = '轮播图不能为空'
} }
if (errMsg) {
uni.showToast({
icon: 'none',
title: errMsg
})
return false;
}
return true;
},
validSpecData(goodsStandardList) {
let errMsg = "";
for (let i = 0; i < goodsStandardList.length; i++) {
let spec = goodsStandardList[i];
if (!spec.goodsStandardName) {
errMsg = '勾选规格的自编辑购买标题不能为空';
} else if (!spec.goodsPrice) {
errMsg = '勾选规格的价格不能为空';
} else if (!spec.groupPrice) {
errMsg = '勾选规格的团购价不能为空';
} else if (!spec.goodsUnit) {
errMsg = '勾选规格的规格单位不能为空';
} else if (!spec.goodsNum) {
errMsg = '勾选规格的库存不能为空';
}
if (errMsg) {
uni.showToast({
icon: 'none',
title: errMsg
})
break;
}
}
if (errMsg) {
return false;
}
return true;
},
async submit() {
let goodsStandardList = this.formData.specsList.filter((item) => { let goodsStandardList = this.formData.specsList.filter((item) => {
if (item.checked) { if (item.checked) {
return { return {
...item, ...item
goodsNum: 99999
} }
} }
}); });
@ -533,6 +600,20 @@
return item; return item;
} }
}); });
let data2Valid = {
...this.formData,
goodsStandardList: goodsStandardList,
goodsAreaList: goodsAreaList
}
if (!this.validData(data2Valid)) {
return;
}
let checkRes = await this.checkBankAndCertify();
if (!checkRes) {
return;
}
// 01 // 01
let goodsImgsList = []; let goodsImgsList = [];
this.formData.imgList.forEach((url) => { this.formData.imgList.forEach((url) => {
@ -588,4 +669,8 @@
.long-btn { .long-btn {
width: 95%; width: 95%;
} }
.form-val-area {
flex-basis: 75% !important;
}
</style> </style>