Commit 3f670438 authored by lihui's avatar lihui

feat: pic

parent e1230bc7
This diff is collapsed.
......@@ -45,7 +45,12 @@ export default {
props: {
infoEditArr: {
type: Object,
defult: () => {}
default: () => {
return {
pindan_pic_url: []
};
},
require: true
}
},
data() {
......@@ -54,11 +59,10 @@ export default {
title: "", // 标题
desc: "", // 介绍
picUploadList: [], // 上传详情图片列表
picUrlList: [] // 图片回显列表
picUrlList: [], // 图片回显列表
picSubmitList: [] // 发布功能需要的图片列表
},
propData: {},
isShowPopver: false, // 是否展示图片框
uploadUrl: `${GOODS_URI}/ksy/ks3apiunencrypt/ks3api_upload` // 金山云上传地址
};
......@@ -66,15 +70,20 @@ export default {
watch: {
infoEditArr: {
// 监听props属性 展示自提点列表
handler: async function(newVal) {
handler: function(newVal) {
console.log(99);
if (this.$route.query.marketing_id) {
this.propData = newVal;
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]
});
// console.log(newVal.pindan_pic_url.length);
// console.log(oldVal);
if (newVal.pindan_pic_url) {
for (var i in this.propData.pindan_pic_url) {
this.infoEditForm.picUrlList.push({
url: this.propData.pindan_pic_url[i]
});
}
}
}
},
......@@ -91,16 +100,26 @@ export default {
// 图片上传成功时
handleDetailSuccess(res) {
this.infoEditForm.picUploadList.push(res.result.image_id);
this.infoEditForm.picUploadList.push(res.result.image_id); // 上传成功图片的id
// this.infoEditForm.picUrlList.push({
// // 回显图片列表
// url: res.result.url
// });
},
// 图片删除后
removeDetailFiles(file, fileList) {
for (let i = 0; i < fileList.length; i++) {
if (fileList[i].uid == file.uid) {
this.infoEditForm.picUploadList.splice(i, 1);
this.infoEditForm.picUrlList.splice(i, 1);
}
}
// for (let i = 0; i < fileList.length; i++) {
// if (fileList[i].uid == file.uid) {
// this.infoEditForm.picUploadList.splice(i, 1);
// }
// }
},
// 获取营销活动详情
......
......@@ -21,8 +21,8 @@
<addProduc
ref="addProduc"
v-show="active === 2"
:editInfo="infoEditArr"
:addProduc="addProducArr"
:editInfo="infoEditArr"
/>
<spellOrderSet
ref="spellOrderSet"
......@@ -93,7 +93,7 @@ export default {
ElMessage.error("请填写商品标题");
return;
}
this.infoEditArr.title = this.$refs.infoEdit.infoEditForm.title;
// this.infoEditArr.title = this.$refs.infoEdit.infoEditForm.title;
this.active = 2;
} else if (this.active === 2) {
if (this.$refs.addProduc.comTableData.length == 0) {
......@@ -131,6 +131,13 @@ export default {
// 确认发布
async confirmRelease() {
let list = this.$refs.infoEdit.infoEditForm.picUrlList.map(item => {
console.log(item);
return item.url;
});
console.log(list);
let picList = list.join(",");
console.log(this.$refs.infoEdit.infoEditForm.picUrlList);
for (var i in this.addProducArr) {
this.goodsSkuIDArr.push(this.addProducArr[i].goods_sku_id);
}
......@@ -147,9 +154,7 @@ export default {
op_cur_user: store.state.userInfo.email,
start_time: this.startDate,
end_time: this.endDate,
pindan_pic: this.infoEditArr.pindan_pic_url
? this.infoEditArr.pindan_pic_url
: [].concat(this.$refs.infoEdit.infoEditForm.picUploadList).join(","),
pindan_pic: picList,
pindan_desc: this.$refs.infoEdit.infoEditForm.desc,
take_place_ids: this.takePlaceIDArr
};
......
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