Commit 3f670438 authored by lihui's avatar lihui

feat: pic

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