From 02a8f31e1660081a34995ebcbd9342875cb25d63 Mon Sep 17 00:00:00 2001 From: donqi Date: Thu, 7 Jul 2022 15:38:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E5=90=8D=E8=AE=A4=E8=AF=81=E5=BC=80?= =?UTF-8?q?=E5=8F=91=EF=BC=8C=E5=85=A5=E9=A9=BB=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/js/request.js | 16 +++ pages/index/my-home.vue | 14 +-- pages/my/certification.vue | 195 ++++++++++++++++++++++++++----------- 3 files changed, 164 insertions(+), 61 deletions(-) diff --git a/common/js/request.js b/common/js/request.js index b38018c..e918ea0 100644 --- a/common/js/request.js +++ b/common/js/request.js @@ -508,5 +508,21 @@ export default { data: params }) return res[1].data; + }, + async addWorkerCertify(params = {}) { + let res = await uni.request({ + url: '/worker/certification/app/add', + method: 'POST', + data: params + }) + return res[1].data; + }, + async getWorkerCertify(params = {}) { + let res = await uni.request({ + url: '/worker/certification/app/getByWorkerId', + method: 'POST', + data: params + }) + return res[1].data; } } diff --git a/pages/index/my-home.vue b/pages/index/my-home.vue index 1165a0b..986b381 100644 --- a/pages/index/my-home.vue +++ b/pages/index/my-home.vue @@ -29,11 +29,10 @@ :class="myInfo.warranty72h ? 'text-main-color' : 'text-gray'"> 72小时质保 - + - 实名认证 + :class="curCertifyInfo && curCertifyInfo.status === 1 ? 'text-main-color' : 'text-gray'"> + 实名认证 返回 实名认证 - - - - - {{stepName}} + + + + + + + {{stepName}} + - - -
@@ -78,7 +78,7 @@ 品牌名称 - + @@ -121,17 +121,17 @@ 法人/负责人 - + 联系电话 - + 其他服务 @@ -233,8 +233,81 @@ - - + + + 姓名: + {{curCertifyInfo.name}} + + + 身份证号: + {{curCertifyInfo.idCardNum}} + + 身份证: + + + + + + + + + 公司规模: + + + 社区服务 + 个体或公司经营执照认证,服务团队1-3人 + + + + 区域服务 + 个体或公司经营执照认证,服务团队3-10人 + + + + 城市服务 + 个体或公司经营执照认证,服务团队10-50人 + + + + + 品牌名称: + {{curCertifyInfo.brandName}} + + + 公司名称: + {{curCertifyInfo.companyName}} + + 公司营业执照: + + + + + + + 公司营业执照号码: + {{curCertifyInfo.businessLicenseNum}} + + + 公司地址: + {{curCertifyInfo.mergerName}} + {{curCertifyInfo.companyAddress}} + + + 法人: + {{curCertifyInfo.legalPersionName}} + + + 法人联系电话: + {{curCertifyInfo.legalPersionPhoneNum}} + + 其他服务 + + + + 特殊技能: 类目:{{item.specialSkillName}} @@ -254,13 +327,13 @@ 保险生效时期:{{item.insuranceStart}} ~ {{item.insuranceEnd}} - + 审核状态: - 审核通过 - 审核中 - 审核未通过 - + 审核通过 + 审核中 + 审核未通过 + @@ -277,16 +350,18 @@ data() { return { curUserInfo: null, + curCertifyInfo: null, + servSpecialSkills: null, curStep: 0, stepList: ['经营主体', '特殊技能'], additionalServ: [{ - id: 1, + id: '0', name: '货拉拉/速运' }, { - id: 2, + id: '1', name: '提供搬货' }, { - id: 3, + id: '2', name: '本地跑腿' }], areaList: [], @@ -294,7 +369,8 @@ realNameInfo: { companySize: null, idCardImgList: [], - licenseImgList: [] + licenseImgList: [], + otherServ: [] }, specialTypeList: [], specialSkill: [{ @@ -319,23 +395,25 @@ }, methods: { async loadData() { - this.curUserInfo = this.$request.getCurUserInfo(); - if (this.curUserInfo.status === 1) { - this.loadAreaList(); - this.loadSpecialSkillType(); - } else { - this.loadSpecialSkills(); - } - }, - async reloadData() { - this.curUserInfo = this.$request.getCurUserInfo(); - if (this.curUserInfo.status === 1) { - this.loadAreaList(); - this.loadSpecialSkillType(); - } else { - this.loadSpecialSkills(); + this.curUserInfo = this.$request.getCurUserInfo(); + let res = await this.$request.getWorkerCertify(); + this.curCertifyInfo = res.data; + if (this.curCertifyInfo && this.curCertifyInfo.workerCertificationId) { + // 存在认证记录 + this.servSpecialSkills = this.curCertifyInfo.specialSkills; + this.curCertifyInfo.otherServArr = this.curCertifyInfo.otherServ.split(","); + } else { + this.loadAreaList(); + this.loadSpecialSkillType(); } }, + showForm() { + if (this.curCertifyInfo) { + this.curCertifyInfo = null; + } + this.loadAreaList(); + this.loadSpecialSkillType(); + }, preStep() { this.curStep = this.curStep === 0 ? 0 : --this.curStep; }, @@ -353,6 +431,7 @@ }, changeAdditionalServId(e) { this.realNameInfo.otherServ = e.detail.value; + console.log(this.realNameInfo.otherServ) }, async loadAreaList(idArr) { let areaList = await this.$request.areaListByStep(); @@ -400,14 +479,20 @@ this.multiIndex = [this.multiIndex[0], colObj.value, 0]; } }, + checkIfInArray(item, targetArr) { + if (targetArr.indexOf(item) !== -1) { + return true; + } + return false; + }, /* 经营主体 end */ /* 特殊技能 start */ - async loadSpecialSkills() { - let res = await this.$request.getWorkerSpecialSkill({ - workerId: this.curUserInfo.workerId - }); - this.servSpecialSkills = res.data; - }, + // async loadSpecialSkills() { + // let res = await this.$request.getWorkerSpecialSkill({ + // workerId: this.curUserInfo.workerId + // }); + // this.servSpecialSkills = res.data; + // }, async loadSpecialSkillType() { let res = await this.$request.listByStep(); this.specialTypeList = res.data; @@ -499,7 +584,7 @@ }) }, /* 特殊技能 end */ - submit() { + async submit() { if (!this.realNameInfo.name || !this.realNameInfo.idCardNum || !this.realNameInfo.idCardImgList || !this.realNameInfo.idCardImgList.length) { uni.showToast({ title: '请完成必填项的填写', @@ -526,6 +611,7 @@ // 加上经营主体参数 let params = { ...this.realNameInfo, + otherServ: this.realNameInfo.otherServ && this.realNameInfo.otherServ.length ? this.realNameInfo.otherServ.join(",") : null, idCardUrl1: this.realNameInfo.idCardImgList && this.realNameInfo.idCardImgList.length > 0 ? this.realNameInfo.idCardImgList[0]: null, idCardUrl2: this.realNameInfo.idCardImgList && this.realNameInfo.idCardImgList.length > 1 ? this.realNameInfo.idCardImgList[1]: null, businessLicenseUrl: this.realNameInfo.licenseImgList && this.realNameInfo.licenseImgList.length > 0 ? this.realNameInfo.licenseImgList[0] : null, @@ -536,15 +622,14 @@ specialSkills: specialSkills } - console.log(params) - // let res = await this.$request.workerSettled(params); - // if (res.code === 0) { - // this.reloadData(); - // uni.showToast({ - // icon: 'success', - // title: '提交成功' - // }) - // } + let res = await this.$request.addWorkerCertify(params); + if (res.code === 0) { + uni.showToast({ + icon: 'success', + title: '提交成功' + }) + await this.loadData(); + } } }, }