Commit 12ba2c1a authored by your yuchenglong's avatar your yuchenglong

update:解决回显问题

parent 20a30e0e
......@@ -62,6 +62,8 @@ export default {
picUrlList: [], // 图片回显列表
},
propData: {},
isShowPopver: false, // 是否展示图片框
uploadUrl: `${GOODS_URI}/ksy/ks3apiunencrypt/ks3api_upload`, // 金山云上传地址
};
......@@ -87,28 +89,32 @@ export default {
}
},
// 获取本地存储数据
// getStorData() {
// let arrStor = JSON.parse(localStorage.getItem("infoEditArrStor"));
// if (arrStor) {
// this.infoEditForm = arrStor;
// }
// },
// 获取营销活动详情
marketingInfoMet() {
console.log();
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) {
this.infoEditForm.title = newVal.marketing_name;
this.infoEditForm.desc = newVal.pindan_desc;
for (var i in newVal.pindan_pic_url) {
this.infoEditForm.picUrlList.push({
url: newVal.pindan_pic_url[i],
});
let marketingId = this.$route.query.marketing_id;
if (marketingId == undefined) {
return;
}
localStorage.setItem('propData',JSON.stringify(newVal));
},
},
created() {
// this.getStorData();
this.marketingInfoMet();
},
};
</script>
......
......@@ -13,14 +13,22 @@
<el-step title="拼单设置"></el-step>
</el-steps>
<div class="content">
<infoEditing ref="infoEdit" v-if="active === 1" :editInfo="infoEditArr" />
<infoEditing
ref="infoEdit"
v-show="active === 1"
:editInfo="infoEditArr"
/>
<addProduc
ref="addProduc"
v-else-if="active === 2"
v-show="active === 2"
:editInfo="infoEditArr"
:addProduc="addProducArr"
/>
<spellOrderSet :spellOrderSet="spellOrderSetArr" v-else />
<spellOrderSet
ref="spellOrderSet"
v-show="active === 3"
:spellOrderSet="spellOrderSetArr"
/>
</div>
<div class="stepsBtn">
<el-button @click="prev" v-show="active >= 2" style="margin-right: 20px"
......@@ -74,40 +82,29 @@ export default {
// 下一步
next() {
// localStorage.clear();
if (this.active === 1) {
if (this.$refs.infoEdit.infoEditForm.title == "") {
ElMessage.error("请填写商品标题");
return;
}
this.active = 2;
this.infoEditArr = {
title: this.$refs.infoEdit.infoEditForm.title,
desc: this.$refs.infoEdit.infoEditForm.desc,
picUploadList:
this.$refs.infoEdit.infoEditForm.picUploadList.join(","),
};
// localStorage.setItem(
// "infoEditArrStor",
// JSON.stringify(this.infoEditArr)
// );
this.active = 2;
} else if (this.active === 2) {
if (this.$refs.addProduc.comTableData.length == 0) {
ElMessage.error("请至少选择一个商品");
return;
}
this.addProducArr = this.$refs.addProduc.comTableData;
this.active = 3;
this.addProducArr = this.$refs.addProduc;
// localStorage.setItem(
// "addProducArrStor",
// JSON.stringify(this.addProducArr)
// );
} else {
this.startDate = this.$refs.spellOrderSet.startDate;
this.endDate = this.$refs.spellOrderSet.endDate;
console.log();
}
// this.active++;
console.log(this.active);
},
// 获取营销活动详情
......@@ -132,9 +129,11 @@ export default {
},
// 确认发布
async confirmRelease() {
for (var i in this.addProducArr.comTableData) {
this.goodsSkuIDArr.push(this.addProducArr.comTableData[i].goods_sku_id);
for (var i in this.addProducArr) {
this.goodsSkuIDArr.push(this.addProducArr[i].goods_sku_id);
}
this.startDate = this.$refs.spellOrderSet.startDate;
this.endDate = this.$refs.spellOrderSet.endDate;
let params = {
marketing_id:
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