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;