From 7e24072ff8d40eaf38b6beb972b8dc6257da7a05 Mon Sep 17 00:00:00 2001
From: dzc <2388224167@qq.com>
Date: Wed, 28 Jan 2026 20:07:54 +0800
Subject: [PATCH] =?UTF-8?q?feat:=E7=94=A8=E6=88=B7=E4=BC=98=E6=83=A0?=
=?UTF-8?q?=E5=88=B8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.env.dev-local | 2 +-
src/api/act/act-coupon-record.ts | 40 ++++
src/views/act/act-coupon-record/index.vue | 225 ++++++++++++++++++++++
src/views/act/act-coupon/form.vue | 7 +
src/views/act/act-coupon/index.vue | 150 ++++++---------
5 files changed, 337 insertions(+), 87 deletions(-)
create mode 100644 src/api/act/act-coupon-record.ts
create mode 100644 src/views/act/act-coupon-record/index.vue
diff --git a/.env.dev-local b/.env.dev-local
index 82069dd..a98aee8 100644
--- a/.env.dev-local
+++ b/.env.dev-local
@@ -9,7 +9,7 @@ ENV = 'local'
# ADMIN 服务地址
-VITE_ADMIN_PROXY_PATH = http://localhost:9999/
+VITE_ADMIN_PROXY_PATH = http://localhost:9999
# 图片访问基础地址
diff --git a/src/api/act/act-coupon-record.ts b/src/api/act/act-coupon-record.ts
new file mode 100644
index 0000000..6001194
--- /dev/null
+++ b/src/api/act/act-coupon-record.ts
@@ -0,0 +1,40 @@
+import request from "/@/utils/request"
+
+export function fetchList(query?: Object) {
+ return request({
+ url: "/wallet/act-coupon-record/page",
+ method: "get",
+ params: query,
+ })
+}
+
+export function addObj(obj?: Object) {
+ return request({
+ url: "/wallet/act-coupon-record",
+ method: "post",
+ data: obj,
+ })
+}
+
+export function getObj(id?: string) {
+ return request({
+ url: "/wallet/act-coupon-record/" + id,
+ method: "get",
+ })
+}
+
+export function delObjs(ids?: Object) {
+ return request({
+ url: "/wallet/act-coupon-record",
+ method: "delete",
+ data: ids,
+ })
+}
+
+export function putObj(obj?: Object) {
+ return request({
+ url: "/wallet/act-coupon-record",
+ method: "put",
+ data: obj,
+ })
+}
diff --git a/src/views/act/act-coupon-record/index.vue b/src/views/act/act-coupon-record/index.vue
new file mode 100644
index 0000000..9967b13
--- /dev/null
+++ b/src/views/act/act-coupon-record/index.vue
@@ -0,0 +1,225 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 查询
+ 重置
+
+
+
+
+
+
+ 新 增
+
+
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ Number(row.faceValue) }}%
+ ¥{{ formatFenToYuan(row.faceValue) }}
+
+
+
+
+ {{ row.minPoint === '0' || row.minPoint === 0 ? '无门槛' : '满¥' +
+ formatFenToYuan(row.minPoint) }}
+
+
+
+
+
+
+
+ ¥{{ formatFenToYuan(row.useAmount) }}
+
+
+
+ 删除
+ 延长有效期
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/act/act-coupon/form.vue b/src/views/act/act-coupon/form.vue
index 77362b2..af4390d 100644
--- a/src/views/act/act-coupon/form.vue
+++ b/src/views/act/act-coupon/form.vue
@@ -97,6 +97,12 @@
+ 营销相关
+
+
+
+
+
@@ -141,6 +147,7 @@ const defaultForm = {
scopeId: '',
status: '1',
description: '',
+ bindNotifyId: '',
};
const form = reactive({ ...defaultForm });
diff --git a/src/views/act/act-coupon/index.vue b/src/views/act/act-coupon/index.vue
index 2296c48..22bb82d 100644
--- a/src/views/act/act-coupon/index.vue
+++ b/src/views/act/act-coupon/index.vue
@@ -7,14 +7,10 @@
-
-
-
+
-
-
-
+
查询
@@ -28,6 +24,10 @@
v-auth="'wallet_actCoupon_add'">
新 增
+
+ 发放
+
删除
@@ -40,58 +40,67 @@
:header-cell-style="tableStyle.headerCellStyle" @selection-change="selectionChangHandle"
@sort-change="sortChangeHandle">
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+ {{ Number(row.faceValue) }}%
+ ¥{{ formatFenToYuan(row.faceValue) }}
+
+
+
+ {{ row.minPoint === '0' || row.minPoint === 0 ? '无门槛' : '满¥' +
+ formatFenToYuan(row.minPoint) }}
+
+
+ {{ Number(row.totalCount) === -1 ? '不限量' : row.totalCount }}
+
+
+
+
+
+
+
-
-
- {{ Number(row.faceValue) }}%
- ¥{{ formatFenToYuan(row.faceValue) }}
-
+
+
+
+
+
+
+
-
- {{ row.minPoint === '0' || row.minPoint === 0 ? '无门槛' : '满¥' +
- formatFenToYuan(row.minPoint) }}
+
+
+
+
+
+
+
+
+ 领取后{{ row.validDays }}天
+
+ {{ formatDate(row.validStartTime, "YYYY-mm-dd HH:MM:SS") }}
+ 至
+ {{ formatDate(row.validEndTime, "YYYY-mm-dd HH:MM:SS") }}
+
+
+
-
- {{ Number(row.totalCount) === -1 ? '不限量' : row.totalCount }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
-
-
- {{ id }}
-
-
-
-
-
-
-
-
-
+
编辑
@@ -113,11 +122,14 @@
import { BasicTableProps, useTable } from "/@/hooks/table";
import * as actCouponApi from '/@/api/act/act-coupon'
import { useMessage, useMessageBox } from "/@/hooks/message";
+import { formatDate } from '/@/utils/formatTime';
+import { useDict } from "/@/hooks/dict"
// 引入组件
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
// 定义查询字典
-
+const { act_coupon_type, act_coupon_limit_type, act_coupon_status, act_coupon_use_scope_type, act_coupon_valid_type }
+ = useDict("act_coupon_type", "act_coupon_limit_type", "act_coupon_status", "act_coupon_use_scope_type", "act_coupon_valid_type")
// 定义变量内容
const formDialogRef = ref()
// 搜索变量
@@ -179,40 +191,6 @@ const handleDelete = async (ids: string[]) => {
}
};
-const coupon_type = [
- { label: '满减券', value: '1', elTagType: 'primary' },
- { label: '折扣券', value: '2', elTagType: 'success' },
- { label: '立减券', value: '3', elTagType: 'warning' },
- { label: '兑换券', value: '4', elTagType: 'info' }
-]
-
-const limit_type = [
- { label: '活动期间一次', value: 'once', elTagType: 'info' },
- { label: '每天', value: 'day', elTagType: 'primary' },
- { label: '每周', value: 'week', elTagType: 'success' },
- { label: '每月', value: 'month', elTagType: 'warning' },
- { label: '每年', value: 'year', elTagType: 'danger' }
-]
-
-const valid_type = [
- { label: '固定日期', value: '1', elTagType: 'primary' },
- { label: '领取后生效', value: '2', elTagType: 'success' }
-]
-
-const scope_type = [
- { label: '全场通用', value: '0', elTagType: 'success' },
- { label: '指定商户', value: '1', elTagType: 'primary' },
- { label: '指定分类', value: '2', elTagType: 'warning' },
- { label: '指定商品', value: '3', elTagType: 'info' }
-]
-
-const coupon_status = [
- { label: '草稿', value: '0', elTagType: 'info' },
- { label: '进行中', value: '1', elTagType: 'success' },
- { label: '已结束', value: '2', elTagType: 'warning' },
- { label: '已作废', value: '3', elTagType: 'danger' }
-]
-
function formatFenToYuan(val: number | string) {
const n = Number(val)
if (isNaN(n)) return val as any