From 1c8fccae66c22cf09474b2102501313b6fdb989c Mon Sep 17 00:00:00 2001 From: "pikachu1995@126.com" Date: Tue, 18 Aug 2026 07:36:38 +0800 Subject: [PATCH] =?UTF-8?q?fix(shopOperation):=20=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E6=B3=95=E4=BA=BA=E8=BA=AB=E4=BB=BD=E8=AF=81=E7=85=A7=E7=89=87?= =?UTF-8?q?=E7=9A=84=E5=8F=96=E5=80=BC=E4=B8=8E=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=20-=20=E5=AE=89=E5=85=A8=E8=AE=BF=E9=97=AE=E6=B3=95=E4=BA=BA?= =?UTF-8?q?=E8=BA=AB=E4=BB=BD=E8=AF=81=E7=85=A7=E7=89=87=EF=BC=8C=E5=B9=B6?= =?UTF-8?q?=E7=BB=9F=E4=B8=80=E5=88=9D=E5=A7=8B=E5=8C=96=E4=B8=BA=E6=95=B0?= =?UTF-8?q?=E7=BB=84=20-=20=E6=96=B0=E5=A2=9E=E8=A7=84=E8=8C=83=E5=8C=96?= =?UTF-8?q?=E6=96=B9=E6=B3=95=EF=BC=8C=E5=85=BC=E5=AE=B9=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E4=B8=B2=E6=A0=BC=E5=BC=8F=E7=9A=84=E6=B3=95=E4=BA=BA=E8=BA=AB?= =?UTF-8?q?=E4=BB=BD=E8=AF=81=E7=85=A7=E7=89=87=20-=20=E5=BA=97=E9=93=BA?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=E5=88=9D=E5=A7=8B=E5=8C=96=E6=97=B6=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE=E6=A0=BC=E5=BC=8F=E5=8C=96=E6=B3=95=E4=BA=BA=E8=BA=AB?= =?UTF-8?q?=E4=BB=BD=E8=AF=81=E7=85=A7=E7=89=87=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- .../src/views/seller/shop/shopOperation.vue | 26 +++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/manager/src/views/seller/shop/shopOperation.vue b/manager/src/views/seller/shop/shopOperation.vue index 3b3737a1..2ffa9b21 100644 --- a/manager/src/views/seller/shop/shopOperation.vue +++ b/manager/src/views/seller/shop/shopOperation.vue @@ -213,14 +213,14 @@ shape="square" :size="100" @click="handleCLickImg('legalPhoto', 0)" - :src="shopForm.legalPhoto[0]" + :src="(shopForm.legalPhoto && shopForm.legalPhoto[0]) || ''" />
点击图片上传身份证正反面,要求身份证清晰,四角无缺漏
@@ -626,12 +626,24 @@ export default { callbackSelected(val) { this.picModelFlag = false; if (this.picIndex === 0 || this.picIndex === 1) { + if (!Array.isArray(this.shopForm[this.selectedFormBtnName])) { + this.shopForm[this.selectedFormBtnName] = this.normalizeLegalPhoto( + this.shopForm[this.selectedFormBtnName] + ); + } this.shopForm[this.selectedFormBtnName][this.picIndex] = val.url; } else { this.shopForm[this.selectedFormBtnName] = val.url; } this.picIndex = ""; }, + normalizeLegalPhoto(value) { + const photos = String(value || "") + .split(",") + .map((item) => item.trim()) + .filter(Boolean); + return [photos[0] || "", photos[1] || ""]; + }, // 初始化数据 init() { this.getCategories(); @@ -654,16 +666,20 @@ export default { shopDetail(this.shopId).then((res) => { if (res.success) { this.infoResult = res.result; - this.shopForm = res.result; + this.shopForm = { + ...res.result, + legalPhoto: this.normalizeLegalPhoto(res.result.legalPhoto), + }; this.shopForm.selfOperated ? (this.shopForm.selfOperated = "true") : (this.shopForm.selfOperated = "false"); - this.checkAllGroup = this.shopForm.goodsManagementCategory.split(","); + this.checkAllGroup = this.shopForm.goodsManagementCategory + ? this.shopForm.goodsManagementCategory.split(",") + : []; if (this.shopForm.settlementCycle) { this.settlementCycle = this.shopForm.settlementCycle.split(","); } - this.shopForm.legalPhoto = this.shopForm.legalPhoto.split(","); this.address = this.shopForm.companyAddressIdPath; this.returnAddress = this.shopForm.salesConsigneeAddressId;