From adb638a6cba36cb95391c1854a519a10d73dc7a6 Mon Sep 17 00:00:00 2001 From: donqi Date: Thu, 25 Aug 2022 13:50:08 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=AE=9E=E5=90=8D=E8=AE=A4=E8=AF=81?= =?UTF-8?q?=E7=9A=84=E5=85=AC=E5=8F=B8=E6=89=A7=E7=85=A7=EF=BC=8C=E6=8A=80?= =?UTF-8?q?=E8=83=BD=E8=AF=81=E4=B9=A6=E9=83=BD=E8=B0=83=E6=95=B4=E6=88=90?= =?UTF-8?q?=E5=8F=AF=E4=B8=8A=E4=BC=A0=E5=A4=9A=E5=BC=A0=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E3=80=82=E5=AE=9E=E5=90=8D=E8=AE=A4=E8=AF=81=E7=89=B9=E6=AE=8A?= =?UTF-8?q?=E6=8A=80=E8=83=BD=E5=88=B03=E5=B1=82=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E5=B0=B1=E8=A1=8C=202=E3=80=81=E5=85=A5=E9=A9=BB=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E6=A0=87=E8=AF=86=E6=8C=81=E4=B9=85=E5=8C=96=E6=97=B6?= =?UTF-8?q?=E6=9C=BA=E8=B0=83=E6=95=B4=EF=BC=8C=E5=8D=B3=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E5=BC=95=E5=AF=BC=E5=BC=B9=E7=AA=97=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E3=80=82=203=E3=80=81=E5=85=A5=E9=A9=BB=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=8C=BA=E5=9F=9F=E5=92=8C=E6=9C=8D=E5=8A=A1=E6=8A=80=E8=83=BD?= =?UTF-8?q?=E4=B8=BA=E5=BF=85=E5=A1=AB=EF=BC=8C=E5=A2=9E=E5=8A=A0=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=A0=A1=E9=AA=8C=E5=8F=8A=E6=8F=90=E7=A4=BA=E3=80=82?= =?UTF-8?q?=204=E3=80=81=E5=85=A5=E9=A9=BB=E4=BF=A1=E6=81=AF=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E9=A1=B5=E9=9D=A2=EF=BC=8C=E6=9C=8D=E5=8A=A1=E6=8A=80?= =?UTF-8?q?=E8=83=BD=E5=B1=95=E7=A4=BA=E4=B8=BA3=E5=B1=82=E5=90=8D?= =?UTF-8?q?=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/js/request.js | 4 +- pages/index/index-home.vue | 16 +++--- pages/my/apply-shop.vue | 4 +- pages/my/certification.vue | 96 ++++++++++++++++---------------- pages/my/master-occupancy.vue | 58 ++++++++++++++++--- pages/my/master-settled-info.vue | 2 +- 6 files changed, 111 insertions(+), 69 deletions(-) diff --git a/common/js/request.js b/common/js/request.js index 663bcbf..42496ee 100644 --- a/common/js/request.js +++ b/common/js/request.js @@ -13,8 +13,8 @@ export default { }) let userInfo = _this.getCurUserInfo(); // request 触发前拼接 url - args.url = 'https://www.opsoul.com' + args.url; - // args.url = 'http://127.0.0.1:80' + args.url; + // args.url = 'https://www.opsoul.com' + args.url; + args.url = 'http://127.0.0.1:80' + args.url; // args.url = 'http://192.168.2.42:80' + args.url; if (!args.data) { diff --git a/pages/index/index-home.vue b/pages/index/index-home.vue index 7b88411..f61f7ed 100644 --- a/pages/index/index-home.vue +++ b/pages/index/index-home.vue @@ -246,14 +246,14 @@ this.orderStatistics = res.data; }, async chooseEntryType(typeCode) { - let status = 1; - if (typeCode === 1) { - status = 0; - } - await this.$request.updateWorker({ - type: typeCode, - status: status - }); + // let status = 1; + // if (typeCode === 1) { + // status = 0; + // } + // await this.$request.updateWorker({ + // type: typeCode, + // status: status + // }); if (typeCode === 1) { this.$emit('changeCurPageCode', 'supplyChainPage'); } else if (typeCode === 0) { diff --git a/pages/my/apply-shop.vue b/pages/my/apply-shop.vue index 5bc3516..1bf8e8b 100644 --- a/pages/my/apply-shop.vue +++ b/pages/my/apply-shop.vue @@ -231,7 +231,9 @@ }, async submit(e) { let res = await this.$request.updateWorker({ - storeStatus: 1 + storeStatus: 1, + type: 1, + status: 0 }); if (res && res.code === 0) { uni.navigateTo({ diff --git a/pages/my/certification.vue b/pages/my/certification.vue index 167d2f0..c7fcd74 100644 --- a/pages/my/certification.vue +++ b/pages/my/certification.vue @@ -67,21 +67,21 @@ - - - - - 姓氏 - - - - 名字 - - + + + + 姓氏 + + + + 名字 + + 身份证号 @@ -103,8 +103,8 @@ - + @@ -132,15 +132,15 @@ v-model="realNameInfo.companyAddress" placeholder="请输入营业执照地址/经营地址/服务网点" /> - - 法人/负责人 - - - - 法人/负责人联系电话 - + + 法人/负责人 + + + + 法人/负责人联系电话 + 其他服务 @@ -185,16 +185,16 @@ :showField="'goodsCategoryName'" placeholder="请选择" v-model="specialSkill[index].specialSubTypeObj" @input="chooseSpecialSkill($event, 1, index)"> - + @input="chooseSpecialSkill($event, 2, index)"> --> + - @@ -210,8 +210,8 @@ - + @@ -558,7 +558,7 @@ }, async chooseSpecialSkill(e, type, index) { let funName = "listByStep"; - if (type === 2) { + if (type === 1) { funName = "qrySpecialSkillList"; } let res = await this.$request[funName]({ @@ -567,25 +567,25 @@ }); if (res.code == 0) { switch (type) { + // case 0: { + // this.specialSkill[index].specialSubTypeList = res.data; + // this.specialSkill[index].specialSubSubTypeList = []; + // this.specialSkill[index].specialSubTypeObj = {}; + // this.specialSkill[index].specialSubSubTypeObj = {}; + // } + // break; case 0: { this.specialSkill[index].specialSubTypeList = res.data; - this.specialSkill[index].specialSubSubTypeList = []; this.specialSkill[index].specialSubTypeObj = {}; - this.specialSkill[index].specialSubSubTypeObj = {}; + } + case 1: { + this.specialSkill[index].specialSkillList = res.data; + this.specialSkill[index].specialSkillObj = {}; } break; - case 1: { - this.specialSkill[index].specialSubSubTypeList = res.data; - this.specialSkill[index].specialSubSubTypeObj = {}; - } - case 2: { - this.specialSkill[index].specialSkillList = res.data; - this.specialSkill[index].specialSkillObj = {}; - } - break; - default: - break; - } + default: + break; + } } }, addSpecialSkill() { @@ -608,9 +608,9 @@ this.specialSkill[index].insurStartDate = e[0]; this.specialSkill[index].insurEndDate = e[1]; }, - async chooseImage(e, imgList) { + async chooseImage(e, imgList, count) { uni.chooseImage({ - count: 1, //默认9 + count: count && count > 0 ? count : 1, //默认9 sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有 sourceType: ['album'], //从相册选择 success: (res) => { @@ -785,7 +785,7 @@ font-size: 30rpx; position: relative; height: 60rpx; - line-height: 60rpx; + line-height: 60rpx; flex-basis: 40%; } diff --git a/pages/my/master-occupancy.vue b/pages/my/master-occupancy.vue index afeef81..20087bd 100644 --- a/pages/my/master-occupancy.vue +++ b/pages/my/master-occupancy.vue @@ -470,12 +470,50 @@ }) }, /* 特殊技能 end */ - nextStep() { + nextStep() { + let workerAreas = []; + // 区域参数 + this.servArea.forEach((item) => { + item.streetIds.forEach((streetId) => { + workerAreas.push({ + provinceId: item.provinceObj.areaId, + cityId: item.cityObj.areaId, + districtId: item.districtObj.areaId, + streetId: streetId + }) + }); + }); + let params = { + workerAreas: workerAreas + } + if (this.curStep === 0 && !this.validData(params)) { + return; + } this.curStep = this.curStep === this.stepList.length - 1 ? this.curStep : ++this.curStep; }, preStep() { this.curStep = this.curStep === 0 ? 0 : --this.curStep; }, + validData(data) { + let errMsg = null; + if (!data.workerAreas || !data.workerAreas.length) { + errMsg = '请至少添加一个服务区域(需要勾选到服务街道)'; + } + if (this.curStep > 0) { + if (!data.goodsCategories || !data.goodsCategories.length) { + errMsg = '请至少添加一个服务技能(需要勾选到三级类目)'; + } + } + if (errMsg) { + uni.showToast({ + icon: 'none', + title: errMsg, + duration: 3000 + }) + return false; + } + return true; + }, async submit() { let workerId = this.curUserInfo.workerId; let workerAreas = []; @@ -520,19 +558,21 @@ goodsCategories: goodsCategories, // specialSkills: specialSkills } + + if (!this.validData(params)) { + return; + } + let res = await this.$request.workerSettled(params); - if (res.code === 0) { + if (res && res.code === 0) { uni.showToast({ icon: 'success', - title: '提交成功' + title: '提交成功', + duration: 2000 }) // 更新当前缓存的用户信息 - // let updateCurUserCacheRes = await this.$request.updateCurUserCache(); - // if (updateCurUserCacheRes) { - // uni.navigateBack({ - // delta: -1 - // }) - // } + let newUserInfo = await this.$request.getCurUserNoCache(); + this.$request.updateCache('userProfile', newUserInfo); uni.navigateBack({ delta: -1 }) diff --git a/pages/my/master-settled-info.vue b/pages/my/master-settled-info.vue index e4d160e..3281ac9 100644 --- a/pages/my/master-settled-info.vue +++ b/pages/my/master-settled-info.vue @@ -16,7 +16,7 @@ 服务技能: - {{item.goodsCategoryName}} + {{item.mergeName}}