Commit 607d440b authored by your yuchenglong's avatar your yuchenglong

update:解决添加商品列表回显问题

parent f2ff7e5b
......@@ -361,11 +361,13 @@ export default {
const res = await markGoodsInfo(params);
this.commodityForm = res.result.goods_info;
this.commodityForm.business1 = res.result.goods_info.ota_id;
this.commodityForm.picUrlList = [];
for (var i in res.result.goods_info.desc_pic_url_list) {
this.commodityForm.picUrlList.push({
url: res.result.goods_info.desc_pic_url_list[i],
});
}
console.log(this.commodityForm.picUrlList);
},
// 编辑商品详情
......@@ -407,6 +409,7 @@ export default {
this.addCommodityPopup = true;
this.commodityForm = {};
if (type == "add") {
console.log(this.editInfo);
this.commodityForm.total_amount_order = 0;
this.addCommodityTitle = "商品添加";
} else {
......@@ -494,19 +497,19 @@ export default {
}
}
},
// 获取营销活动详情
marketingInfoMet() {
},
watch: {
addProduc: function (newVal) {
let marketingId = this.$route.query.marketing_id;
if (marketingId == undefined) {
return;
}
this.comTableData = this.addProduc;
this.comTableData = newVal;
},
},
created() {
this.getBusinessListMet();
this.marketingInfoMet();
},
};
</script>
......
......@@ -50,8 +50,8 @@ export default {
props: {
editInfo: {
type: Object,
required: () => {}
}
required: () => {},
},
},
data() {
return {
......@@ -59,13 +59,13 @@ export default {
title: "", // 标题
desc: "", // 介绍
picUploadList: [], // 上传详情图片列表
picUrlList: [] // 图片回显列表
picUrlList: [], // 图片回显列表
},
propData: {},
isShowPopver: false, // 是否展示图片框
uploadUrl: `${GOODS_URI}/ksy/ks3apiunencrypt/ks3api_upload` // 金山云上传地址
uploadUrl: `${GOODS_URI}/ksy/ks3apiunencrypt/ks3api_upload`, // 金山云上传地址
};
},
methods: {
......@@ -95,30 +95,29 @@ export default {
if (marketingId == undefined) {
return;
}
this.propData = JSON.parse(localStorage.getItem("propData"));
this.infoEditForm.title = this.propData.marketing_name;
this.infoEditForm.desc = this.propData.pindan_desc;
for (var i in this.propData.pindan_pic_url) {
this.infoEditForm.picUrlList.push({
url: this.propData.pindan_pic_url[i]
});
}
}
this.propData = JSON.parse(localStorage.getItem("propData"));
this.infoEditForm.title = this.propData.marketing_name;
this.infoEditForm.desc = this.propData.pindan_desc;
for (var i in this.propData.pindan_pic_url) {
this.infoEditForm.picUrlList.push({
url: this.propData.pindan_pic_url[i],
});
}
},
},
watch: {
editInfo: function(newVal) {
editInfo: function (newVal) {
let marketingId = this.$route.query.marketing_id;
if (marketingId == undefined) {
return;
}
localStorage.setItem("propData", JSON.stringify(newVal));
}
},
},
created() {
this.marketingInfoMet();
}
},
};
</script>
......
......@@ -89,13 +89,7 @@ export default {
ElMessage.error("请填写商品标题");
return;
}
this.infoEditArr = {
title: this.$refs.infoEdit.infoEditForm.title,
desc: this.$refs.infoEdit.infoEditForm.desc,
picUploadList: this.$refs.infoEdit.infoEditForm.picUploadList.join(
","
)
};
this.infoEditArr.title = this.$refs.infoEdit.infoEditForm.title
this.active = 2;
} else if (this.active === 2) {
if (this.$refs.addProduc.comTableData.length == 0) {
......@@ -144,13 +138,13 @@ export default {
? ""
: this.$route.query.marketing_id,
goods_sku_id: this.goodsSkuIDArr.join(","),
marketing_name: this.infoEditArr.title,
marketing_name: this.$refs.infoEdit.infoEditForm.title,
marketing_type: "4",
op_cur_user: store.state.userInfo.email,
start_time: this.startDate,
end_time: this.endDate,
pindan_pic: this.infoEditArr.picUploadList,
pindan_desc: this.infoEditArr.desc,
pindan_pic: this.$refs.infoEdit.infoEditForm.picUploadList.join(','),
pindan_desc:this.$refs.infoEdit.infoEditForm.desc,
take_place_ids:this.takePlaceIDArr
};
if (this.$route.query.marketing_id == undefined) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment