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

复制活动

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