From 6496b3f36d38f3196c4e41d0b9c329de646a2415 Mon Sep 17 00:00:00 2001
From: peng <peng.com>
Date: 星期六, 27 九月 2025 17:38:04 +0800
Subject: [PATCH] 店铺优惠卷功能使用
---
manager/src/api/coupon-store.js | 6 ++++++
manager/src/api/promotion.js | 4 ++++
manager/src/views/promotions/coupon/coupon_store.vue | 27 +++++++++++++++++++++------
3 files changed, 31 insertions(+), 6 deletions(-)
diff --git a/manager/src/api/coupon-store.js b/manager/src/api/coupon-store.js
index 1e1a7de..9c9be5a 100644
--- a/manager/src/api/coupon-store.js
+++ b/manager/src/api/coupon-store.js
@@ -22,3 +22,9 @@
params: params
})
}
+export const changeStatus = (id) =>{
+ return service({
+ url: `/lmk/storeCoupon/changeStatus/${id}`,
+ method: "POST"
+ })
+}
diff --git a/manager/src/api/promotion.js b/manager/src/api/promotion.js
index 82d6e29..7581985 100644
--- a/manager/src/api/promotion.js
+++ b/manager/src/api/promotion.js
@@ -112,6 +112,10 @@
export const deletePlatformCoupon = ids => {
return deleteRequest(`/promotion/coupon/${ids}`);
};
+// 鐢熸垚浼樻儬鍗�
+export const generateStoreCoupon = id => {
+ return postRequest(`/lmk/storeCoupon/generateStoreCoupon/${id}`);
+};
// 鏇存柊浼樻儬鍒哥姸鎬�
export const updatePlatformCouponStatus = params => {
return putRequest(`/promotion/coupon/status`, params);
diff --git a/manager/src/views/promotions/coupon/coupon_store.vue b/manager/src/views/promotions/coupon/coupon_store.vue
index ba7c1ed..8350cb8 100644
--- a/manager/src/views/promotions/coupon/coupon_store.vue
+++ b/manager/src/views/promotions/coupon/coupon_store.vue
@@ -103,7 +103,14 @@
<template slot-scope="{ row }" slot="action">
<Button
+ @click="generalCoupon(row)"
+ type="primary"
+ class="add-btn"
+ v-if="row.generateStatus ==='NOT_GENERATE'"
+ >鐢熸垚浼樻儬鍗�</Button>
+ <Button
@click="detail(row)"
+ style="margin-left: 10px;"
type="primary"
class="add-btn"
:disabled="row.generateStatus === 'NOT_GENERATE'"
@@ -164,7 +171,8 @@
@click="generalQrCode(row)"
type="primary"
class="add-btn"
- >鏌ョ湅</Button>
+ v-if="row.claimStatus === 'NOT_CLAIM'"
+ >鏌ョ湅浜岀淮鐮�</Button>
</template>
</Table>
<Row type="flex" justify="center" class="mt_10">
@@ -263,10 +271,10 @@
<script>
import vueQr from "vue-qr";
-import {addStoreCoupon, getPage, getPageByStoreCoupon} from "../../../api/coupon-store";
+import {addStoreCoupon, getPage, getPageByStoreCoupon,changeStatus} from "../../../api/coupon-store";
import * as API_Order from "@/api/order";
import {promotionsScopeTypeRender, promotionsStatusRender} from "../../../utils/promotions";
-import {getPlatformCouponList} from "../../../api/promotion";
+import {getPlatformCouponList,generateStoreCoupon} from "../../../api/promotion";
export default {
components:{
"vue-qr": vueQr,
@@ -530,7 +538,7 @@
{
title: '鎿嶄綔',
slot: 'action',
- width: 120,
+ width: 200,
align: 'center'
},
]
@@ -556,6 +564,11 @@
this.storeCouponSingleQuery.pageSize = 10
this.storeCouponSingleQuery.pageNumber = 1
this.getCouponStoreDataList();
+ },
+ generalCoupon(row){
+ generateStoreCoupon(row.id).then(response => {
+ this.getList();
+ })
},
handleStoreChange(storeId) {
if (storeId) {
@@ -691,8 +704,10 @@
// 鐘舵�佹敼鍙�
handleStatusChange(row, status) {
const action = status === 'ENABLE' ? '鍚敤' : '绂佺敤';
- this.$Message.success(`宸�${action}浼樻儬鍒�"${row.couponName}"`);
-
+ changeStatus(row.id).then(response => {
+ this.getList();
+ this.$Message.success(`宸�${action}浼樻儬鍒�"${row.couponName}"`);
+ })
// 杩欓噷鍙互娣诲姞API璋冪敤
},
--
Gitblit v1.8.0