Commit 210b237c authored by 顾文旭's avatar 顾文旭

复制活动

parent 9e737bfe
......@@ -89,6 +89,18 @@ exports.addMarketing = async (ctx) => {
ctx.body = await req(ctx, opts);
};
// 添加营销活动
exports.copyMarketing = async (ctx) => {
const url = `http://blend.jwshq.yidian-inc.com/bp/copyMarketing`;
const opts = {
url,
method: "POST",
json: true,
body: ctx.request.body,
};
ctx.body = await req(ctx, opts);
};
// 编辑营销活动
exports.updateMarketing = async (ctx) => {
const url = `${ACTIVITY_URI}/marketing/background/update_marketing`;
......
......@@ -107,6 +107,7 @@ 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_activity_goods`, activity.editGoods);
router.post(`${API_VERSION}/marketing/background/add_marketing`, activity.addMarketing);
router.post(`${API_VERSION}/bp/copyMarketing`, activity.copyMarketing);
router.post(`${API_VERSION}/marketing/background/marketing_info`, activity.marketingInfo);
router.post(`${API_VERSION}/marketing/background/update_marketing`, activity.updateMarketing);
......
......@@ -76,6 +76,12 @@
</div>
<el-button class="checkButton" type="primary" size="mini" @click="handleLook(scope.row)">查看订单</el-button>
<el-popconfirm title="确定要复制活动?" @confirm="copyMarketing(scope.row)">
<template #reference>
<el-button class="checkButton" type="primary" size="mini">复制活动</el-button>
</template>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
......@@ -99,8 +105,10 @@
<script>
import layout from "../../Groupmeal/layout/index.vue";
import { ElMessage } from "element-plus";
import ActivityService from "@/service/Activity/index";
import ActivityService, { addMarketing, copyMarketing } from "@/service/Activity/index";
import dayJs from "dayjs";
import { getCookie } from "@/utils/util";
export default {
name: "Manage",
components: {
......@@ -264,6 +272,21 @@
},
});
},
async copyMarketing(row) {
let params = {
marketing_id: 0,
};
const res = await copyMarketing(params);
if (res.code === 0) {
ElMessage.success({
message: "复制成功",
type: "success",
});
} else {
ElMessage.error(res.reason);
}
},
},
created() {
this.getActivityList();
......@@ -276,26 +299,32 @@
height: 100%;
padding: 30px;
}
.header {
height: 100%;
}
.form-wrapper {
display: flex;
flex-direction: column;
justify-content: space-between;
height: 100%;
.el-card__body {
height: 100%;
}
.formitem-wrapper {
// height: 100px;
// display: flex;
// align-items: flex-end;
}
.table-wrapper {
flex: 1;
overflow-y: scroll;
}
.pagination-wrapper {
width: 100%;
height: 100px;
......@@ -305,12 +334,15 @@
align-items: center;
}
}
.checkButton {
margin-top: 5px;
}
.activityTitle {
cursor: pointer;
}
.activityPrice {
color: red;
}
......
......@@ -42,6 +42,12 @@ export async function addMarketing(params) {
return res;
}
// 复制营销活动
export async function copyMarketing(params) {
const res = await axios.post("/api/v1/bp/copyMarketing", params);
return res;
}
// 编辑营销活动
export async function updateMarketing(params) {
const res = await axios.post("/api/v1/marketing/background/update_marketing", 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