Commit e0d63de7 authored by gengshaojing's avatar gengshaojing

fix: 商品去重

parent 4f5f1b64
...@@ -2,30 +2,14 @@ ...@@ -2,30 +2,14 @@
<div class="releaseProducBox"> <div class="releaseProducBox">
<div class="releaseProduc"> <div class="releaseProduc">
<h4 class="headTitle">发布活动</h4> <h4 class="headTitle">发布活动</h4>
<el-steps <el-steps class="steps" :active="active" finish-status="success" space="30%" :align-center="true">
class="steps"
:active="active"
finish-status="success"
space="30%"
:align-center="true"
>
<el-step title="信息编辑" @click="step1"></el-step> <el-step title="信息编辑" @click="step1"></el-step>
<el-step title="添加商品" @click="step2"></el-step> <el-step title="添加商品" @click="step2"></el-step>
<el-step title="拼单设置" @click="step3"></el-step> <el-step title="拼单设置" @click="step3"></el-step>
</el-steps> </el-steps>
<div class="content"> <div class="content">
<infoEditing <infoEditing ref="infoEdit" v-show="active === 1" :infoEditArr="infoEditArr" />
ref="infoEdit" <addProduc ref="addProduc" v-show="active === 2" :addProduc="addProducArr" :editInfo="infoEditArr" :stepTwoTitle="stepTwoTitle" />
v-show="active === 1"
:infoEditArr="infoEditArr"
/>
<addProduc
ref="addProduc"
v-show="active === 2"
:addProduc="addProducArr"
:editInfo="infoEditArr"
:stepTwoTitle="stepTwoTitle"
/>
<spellOrderSet <spellOrderSet
ref="spellOrderSet" ref="spellOrderSet"
v-show="active === 3" v-show="active === 3"
...@@ -37,38 +21,28 @@ ...@@ -37,38 +21,28 @@
</div> </div>
</div> </div>
<div class="stepsBtn"> <div class="stepsBtn">
<el-button @click="prev" v-show="active >= 2" style="margin-right: 20px" <el-button @click="prev" v-show="active >= 2" style="margin-right: 20px">上一步</el-button>
>上一步</el-button <el-button @click="next" v-show="active < 3" style="margin-right: 20px">下一步</el-button>
>
<el-button @click="next" v-show="active < 3" style="margin-right: 20px"
>下一步</el-button
>
<el-button @click="cancel" v-show="active == 1">取消</el-button> <el-button @click="cancel" v-show="active == 1">取消</el-button>
<el-button @click="confirmRelease" v-show="active == 3" type="primary" <el-button @click="confirmRelease" v-show="active == 3" type="primary">确认发布</el-button>
>确认发布</el-button
>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import dayJs from "dayjs"; import dayJs from "dayjs";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import infoEditing from "./components/infoEditing.vue"; import infoEditing from "./components/infoEditing.vue";
import addProduc from "./components/addProduc.vue"; import addProduc from "./components/addProduc.vue";
import spellOrderSet from "./components/spellOrderSet.vue"; import spellOrderSet from "./components/spellOrderSet.vue";
import { getCookie } from "@/utils/util"; import { getCookie } from "@/utils/util";
import { import { addMarketing, marketingInfo, updateMarketing } from "../../../service/Activity/index";
addMarketing, export default {
marketingInfo,
updateMarketing
} from "../../../service/Activity/index";
export default {
components: { components: {
infoEditing, infoEditing,
addProduc, addProduc,
spellOrderSet spellOrderSet,
}, },
data() { data() {
return { return {
...@@ -82,7 +56,7 @@ export default { ...@@ -82,7 +56,7 @@ export default {
takePlaceIDArr: [], takePlaceIDArr: [],
startTime: "", startTime: "",
endTime: "", endTime: "",
stepTwoTitle: "" // 传给addProduct的title stepTwoTitle: "", // 传给addProduct的title
}; };
}, },
...@@ -148,7 +122,7 @@ export default { ...@@ -148,7 +122,7 @@ export default {
} }
let params = { let params = {
marketing_id: marketingId, marketing_id: marketingId,
marketing_type: "4" marketing_type: "4",
}; };
const res = await marketingInfo(params); const res = await marketingInfo(params);
this.infoEditArr = res.result.marketing_info; this.infoEditArr = res.result.marketing_info;
...@@ -171,7 +145,7 @@ export default { ...@@ -171,7 +145,7 @@ export default {
if (reg.test(path)) return unescape(RegExp.$2.replace(/\+/g, " ")); if (reg.test(path)) return unescape(RegExp.$2.replace(/\+/g, " "));
return ""; return "";
} }
let list = this.$refs.infoEdit.picSubmitList.map(item => { let list = this.$refs.infoEdit.picSubmitList.map((item) => {
let rs = getUrlParms(item.url, "url"); let rs = getUrlParms(item.url, "url");
return rs; return rs;
}); });
...@@ -179,29 +153,27 @@ export default { ...@@ -179,29 +153,27 @@ export default {
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);
} }
this.goodsSkuIDArr = [...new Set(this.goodsSkuIDArr)];
this.startDate = this.$refs.spellOrderSet.startDate; this.startDate = this.$refs.spellOrderSet.startDate;
this.endDate = this.$refs.spellOrderSet.endDate; this.endDate = this.$refs.spellOrderSet.endDate;
let params = { let params = {
marketing_id: marketing_id: this.$route.query.marketing_id == undefined ? "" : this.$route.query.marketing_id,
this.$route.query.marketing_id == undefined
? ""
: this.$route.query.marketing_id,
goods_sku_id: this.goodsSkuIDArr.join(","), goods_sku_id: this.goodsSkuIDArr.join(","),
marketing_name: this.$refs.infoEdit.infoEditForm.title, marketing_name: this.$refs.infoEdit.infoEditForm.title,
marketing_type: "4", marketing_type: "4",
op_cur_user: getCookie('username'), op_cur_user: getCookie("username"),
start_time: dayJs(this.startDate).format("YYYY-MM-DD HH:mm:ss"), start_time: dayJs(this.startDate).format("YYYY-MM-DD HH:mm:ss"),
end_time: dayJs(this.endDate).format("YYYY-MM-DD HH:mm:ss"), end_time: dayJs(this.endDate).format("YYYY-MM-DD HH:mm:ss"),
pindan_pic: picList, pindan_pic: picList,
pindan_desc: this.$refs.infoEdit.infoEditForm.desc, pindan_desc: this.$refs.infoEdit.infoEditForm.desc,
take_place_ids: this.takePlaceIDArr take_place_ids: this.takePlaceIDArr,
}; };
if (this.$route.query.marketing_id == undefined) { if (this.$route.query.marketing_id == undefined) {
const res = await addMarketing(params); const res = await addMarketing(params);
if (res.code === 0) { if (res.code === 0) {
ElMessage.success({ ElMessage.success({
message: "添加成功", message: "添加成功",
type: "success" type: "success",
}); });
this.$router.push({ path: "/op/activity/manage" }); this.$router.push({ path: "/op/activity/manage" });
} else { } else {
...@@ -212,7 +184,7 @@ export default { ...@@ -212,7 +184,7 @@ export default {
if (res.code === 0) { if (res.code === 0) {
ElMessage.success({ ElMessage.success({
message: "修改成功", message: "修改成功",
type: "success" type: "success",
}); });
this.$router.push({ path: "/op/activity/manage" }); this.$router.push({ path: "/op/activity/manage" });
} else { } else {
...@@ -222,54 +194,54 @@ export default { ...@@ -222,54 +194,54 @@ export default {
}, },
getTakeTakePlaceListFromChild(val) { getTakeTakePlaceListFromChild(val) {
this.takePlaceIDArr = val; this.takePlaceIDArr = val;
} },
}, },
created() { created() {
this.marketingInfoMet(); this.marketingInfoMet();
} },
}; };
</script> </script>
<style lang="less" scope> <style lang="less" scope>
.releaseProduc { .releaseProduc {
height: 100%; height: 100%;
padding: 30px; padding: 30px;
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
@media screen and (max-width: 800px) { @media screen and (max-width: 800px) {
// form表单 // form表单
.releaseProduc { .releaseProduc {
padding: 0; padding: 0;
} }
} }
.headTitle { .headTitle {
height: 30px; height: 30px;
width: 75%; width: 75%;
font-size: 18px; font-size: 18px;
margin: 0 auto 40px auto; margin: 0 auto 40px auto;
} }
.steps { .steps {
height: 60px; height: 60px;
} }
/* 内容cotent */ /* 内容cotent */
.content { .content {
flex-grow: 1; flex-grow: 1;
} }
.steps { .steps {
display: flex; display: flex;
justify-content: center; justify-content: center;
margin-bottom: 35px; margin-bottom: 35px;
} }
.steps /deep/ .el-step__icon { .steps /deep/ .el-step__icon {
width: 50px; width: 50px;
height: 50px; height: 50px;
} }
.steps /deep/ .el-step.is-horizontal .el-step__line { .steps /deep/ .el-step.is-horizontal .el-step__line {
top: 25px; top: 25px;
} }
.stepsBtn { .stepsBtn {
width: 100%; width: 100%;
height: 80px; height: 80px;
line-height: 80px; line-height: 80px;
...@@ -278,5 +250,5 @@ export default { ...@@ -278,5 +250,5 @@ export default {
bottom: 0px; */ bottom: 0px; */
text-align: center; text-align: center;
z-index: 999; z-index: 999;
} }
</style> </style>
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