Commit 2e10f914 authored by your yuchenglong's avatar your yuchenglong

update:营销活动详情

parent 1d5bb5c5
......@@ -77,6 +77,30 @@ exports.editGoodsDetail = async ctx => {
ctx.body = await req(ctx, opts);
};
// 添加营销活动
exports.addMarketing = async ctx => {
const url = `${ACTIVITY_URI}/marketing/background/add_marketing`;
const opts = {
url,
method: "POST",
json: true,
body: ctx.request.body
};
ctx.body = await req(ctx, opts);
};
// 营销活动详情
exports.marketingInfo = async ctx => {
const url = `${ACTIVITY_URI}/marketing/background/marketing_info`;
const opts = {
url,
method: "POST",
json: true,
body: ctx.request.body
};
ctx.body = await req(ctx, opts);
};
// 关闭/开启 活动
exports.updateActivity = async ctx => {
const url = `${ACTIVITY_URI}/marketing/background/update_marketing`;
......
......@@ -78,6 +78,8 @@ router.post(`${API_VERSION}/goods/background/add_goods`, activity.addGoods);
router.get(`${API_VERSION}/goods/background/pindan_goods`, activity.pindanGoods);
router.get(`${API_VERSION}/goods/background/marketing_goods_info`, activity.markGoodsInfo);
router.post(`${API_VERSION}/goods/background/edit_goods`, activity.editGoods);
router.post(`${API_VERSION}/marketing/background/add_marketing`, activity.addMarketing);
module.exports = router;
......@@ -375,7 +375,6 @@ export default {
type: "success",
});
this.pindanGoodsMet();
console.log(this.multipleSelection);
this.addCommodityPopup = false;
} else {
ElMessage.error(res.reason);
......
......@@ -47,6 +47,7 @@
<script>
import { GOODS_URI } from "../../../../../server/config";
export default {
props: ["editInfo"],
data() {
return {
infoEditForm: {
......@@ -61,15 +62,6 @@ export default {
};
},
methods: {
// 初始化上传图片列表
// formatUploadPictureList(fileStr) {
// if (!fileStr) {
// return [];
// } else {
// return fileStr.split(",");
// }
// },
// 展示商品大图
previewImage(file) {
this.popoverImage = file.url;
......@@ -91,6 +83,9 @@ export default {
}
},
},
created(){
console.log(this.editInfo);
}
};
</script>
......
......@@ -13,7 +13,11 @@
<el-step title="拼单设置"></el-step>
</el-steps>
<div class="content">
<<<<<<< Updated upstream
<infoEditing ref="infoEdit" v-if="active === 1" />
=======
<infoEditing ref="infoEdit" v-if="active === 1" :editInfo="infoEditArr"/>
>>>>>>> Stashed changes
<addProduc
ref="addProduc"
v-else-if="active === 2"
......@@ -41,6 +45,7 @@ import { ElMessage } from "element-plus";
import infoEditing from "./components/infoEditing.vue";
import addProduc from "./components/addProduc.vue";
import spellOrderSet from "./components/spellOrderSet.vue";
import { addMarketing, marketingInfo } from "../../../service/Activity/index";
export default {
components: {
infoEditing,
......@@ -75,19 +80,51 @@ export default {
return;
}
}
// 信息编辑中的图片
this.active++;
},
// 获取营销活动详情
async marketingInfoMet() {
let marketingId = this.$route.query.marketing_id;
if (marketingId == undefined) {
return;
}
let params = {
marketing_id: marketingId,
marketing_type: "4",
};
const res = await marketingInfo(params);
this.infoEditArr = res.result.marketing_info;
},
// 取消
cancel() {
this.$router.go(-1);
},
// 确认发布
confirmRelease() {
async confirmRelease() {
// this.$refs.addProduc.comTableData
const res = await addMarketing({
goods_sku_id: "",
marketing_name: "",
marketing_type: "4",
op_cur_user: "",
start_time: "",
end_time: "",
pindan_pic: "",
pindan_desc: "",
});
console.log(res);
this.$router.push({ path: "/op/activity/manage" });
}
},
<<<<<<< Updated upstream
created() {}
=======
created() {
this.marketingInfoMet();
},
>>>>>>> Stashed changes
};
</script>
......
......@@ -36,6 +36,18 @@ export async function editGoods(params) {
return res;
}
// 添加营销活动
export async function addMarketing(params) {
const res = await axios.post("/api/v1/marketing/background/add_marketing",params);
return res;
}
// 营销活动详情
export async function marketingInfo(params) {
const res = await axios.post("/api/v1/marketing/background/marketing_info",params);
return res;
}
class ActivityService {
// 获取活动列表
static async getActivityList(params) {
......
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