From 6b229b8639e1340f0c2deff72b7f7416388fb536 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=AF=85?= <1335909236@qq.com> Date: Thu, 30 Oct 2025 15:01:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=95=86=E5=AE=B6=E5=85=A5?= =?UTF-8?q?=E9=A9=BB=E9=80=BB=E8=BE=91,=E4=BF=9D=E5=AD=98=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/shopEnter/auditStatus/index.vue | 6 +- packages/shopEnter/index/index.vue | 73 ++++++++++++++++++++---- packages/shopEnter/sucess/index.css | 2 +- packages/shopEnter/sucess/index.vue | 2 +- 4 files changed, 66 insertions(+), 17 deletions(-) diff --git a/packages/shopEnter/auditStatus/index.vue b/packages/shopEnter/auditStatus/index.vue index 39388d63..6308f3fb 100644 --- a/packages/shopEnter/auditStatus/index.vue +++ b/packages/shopEnter/auditStatus/index.vue @@ -3,7 +3,7 @@ - + 审核中 @@ -58,7 +58,7 @@ - + 审核失败 @@ -85,7 +85,7 @@ - + diff --git a/packages/shopEnter/index/index.vue b/packages/shopEnter/index/index.vue index 574e7418..3d2b283b 100644 --- a/packages/shopEnter/index/index.vue +++ b/packages/shopEnter/index/index.vue @@ -167,10 +167,44 @@ export default { show3: false, classify: [], show4: false, + + itemObj: {}, } }, methods: { - + // 根据ad_code解析省市区信息 + parseAdCode(adCode) { + if (!adCode) return; + + // 提取省级ad_code(前2位) + const provinceCode = adCode.toString().substring(0, 2) + '0000'; + // 提取市级ad_code(前4位) + const cityCode = adCode.toString().substring(0, 4) + '00'; + // 区县级ad_code(完整6位) + const districtCode = adCode.toString(); + + // 查找省份信息 + const province = this.pro.find(item => item.ad_code == provinceCode); + if (province) { + this.confirmProv = province; + + // 获取对应城市列表并查找城市信息 + this.getCity(provinceCode).then(() => { + const city = this.city.find(item => item.ad_code == cityCode); + if (city) { + this.confirmCity = city; + + // 获取对应区县列表并查找区县信息 + this.getBuss(cityCode).then(() => { + const district = this.buss.find(item => item.ad_code == districtCode); + if (district) { + this.confirmBusiness = district; + } + }); + } + }); + } + }, cancelBuss() { this.show3 = false; @@ -194,7 +228,6 @@ export default { this.show = false; }, clickPro(e) { - console.log(e); this.show = false; this.getCity(e.value[0].ad_code) this.confirmProv = e.value[0] @@ -221,7 +254,6 @@ export default { afterReadImg(e) { e.file.forEach(item => { upload(item.url, res => { - console.log(res.data.path); this.imgList.push({ url: this.picUrl + res.data.path }) this.imgList2.push(res.data.path) }) @@ -349,35 +381,52 @@ export default { // 省市区 getPro() { - request(MapApi.getArea, "POST", {}).then(res => { - console.log(res); + return request(MapApi.getArea, "POST", {}).then(res => { this.pro = res.rows }) }, getCity(e) { - request(MapApi.getArea, "POST", { + return request(MapApi.getArea, "POST", { parent_ad_code: e }).then(res => { this.city = res.rows }) }, getBuss(e) { - request(MapApi.getArea, "POST", { + return request(MapApi.getArea, "POST", { parent_ad_code: e }).then(res => { this.buss = res.rows }) }, - getClassify(e) { - request(apiArr.getMerChantCateList, "POST", {}).then(res => { + getClassify() { + return request(apiArr.getMerChantCateList, "POST", {}).then(res => { this.classify = res.rows }) }, }, - onLoad() { - this.getPro() - this.getClassify() + onLoad(options) { + // 先执行数据获取方法 + Promise.all([this.getPro(), this.getClassify()]).then(() => { + // 数据获取完成后再进行赋值操作 + if(options.itemObj){ + this.itemObj = JSON.parse(options.itemObj) + this.store_name = this.itemObj.merchant_name + this.address = this.itemObj.address + this.contact_name = this.itemObj.contact_name + this.contact_phone = this.itemObj.phone + this.confirmClassify = this.classify.find(item => item.id == this.itemObj.merchant_cate_id) + this.bank_card = this.itemObj.bank_card + // 解析ad_code回显省市区 + if (this.itemObj.ad_code) { + this.parseAdCode(this.itemObj.ad_code); + } + this.imgList = this.itemObj.facade_photo.split(",").map(item => ({ url: this.picUrl + item })) + this.imgList3 = this.itemObj.interior_photo.split(",").map(item => ({ url: this.picUrl + item })) + this.imgList5 = this.itemObj.license_photo.split(",").map(item => ({ url: this.picUrl + item })) + } + }) } } diff --git a/packages/shopEnter/sucess/index.css b/packages/shopEnter/sucess/index.css index 9a45a858..4843cb9a 100644 --- a/packages/shopEnter/sucess/index.css +++ b/packages/shopEnter/sucess/index.css @@ -1,5 +1,5 @@ page { - background-color: #f6f7fb; + background-color: #ffffff; min-height: 100vh; padding-bottom: 0; } diff --git a/packages/shopEnter/sucess/index.vue b/packages/shopEnter/sucess/index.vue index fc952ba2..77e8feb2 100644 --- a/packages/shopEnter/sucess/index.vue +++ b/packages/shopEnter/sucess/index.vue @@ -1,7 +1,7 @@