From faf02f794307d13f7e2c338fba460f4de0ada24a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=A3=B7=E5=8F=B6?=
<14103883+leaf-phos@user.noreply.gitee.com>
Date: Fri, 23 May 2025 18:03:26 +0800
Subject: [PATCH] =?UTF-8?q?=E5=8D=A1=E5=88=B8=E5=88=9D=E5=A7=8B=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/bst/vip.js | 44 +++
src/main.js | 3 +
src/utils/enums.js | 39 +++
.../bst/vip/components/VipEditDialog.vue | 260 ++++++++++++++
src/views/bst/vip/index.vue | 325 ++++++++++++++++++
src/views/bst/vip/util.js | 2 +
6 files changed, 673 insertions(+)
create mode 100644 src/api/bst/vip.js
create mode 100644 src/views/bst/vip/components/VipEditDialog.vue
create mode 100644 src/views/bst/vip/index.vue
create mode 100644 src/views/bst/vip/util.js
diff --git a/src/api/bst/vip.js b/src/api/bst/vip.js
new file mode 100644
index 0000000..ed0d7e4
--- /dev/null
+++ b/src/api/bst/vip.js
@@ -0,0 +1,44 @@
+import request from '@/utils/request'
+
+// 查询卡券列表
+export function listVip(query) {
+ return request({
+ url: '/bst/vip/list',
+ method: 'get',
+ params: query
+ })
+}
+
+// 查询卡券详细
+export function getVip(id) {
+ return request({
+ url: '/bst/vip/' + id,
+ method: 'get'
+ })
+}
+
+// 新增卡券
+export function addVip(data) {
+ return request({
+ url: '/bst/vip',
+ method: 'post',
+ data: data
+ })
+}
+
+// 修改卡券
+export function updateVip(data) {
+ return request({
+ url: '/bst/vip',
+ method: 'put',
+ data: data
+ })
+}
+
+// 删除卡券
+export function delVip(id) {
+ return request({
+ url: '/bst/vip/' + id,
+ method: 'delete'
+ })
+}
diff --git a/src/main.js b/src/main.js
index 0d661ac..6ec3a23 100644
--- a/src/main.js
+++ b/src/main.js
@@ -44,6 +44,8 @@ import DictData from '@/components/DictData';
import filter from '@/utils/filter';
// 行内表单组件
import FormCol from '@/components/FormCol';
+// 字典标签组件
+import { dictLabel } from '@/utils';
filter(Vue);
@@ -61,6 +63,7 @@ Vue.prototype.checkPermi = checkPermi
Vue.prototype.checkRole = checkRole
Vue.prototype.isSysAdmin = isSysAdmin
Vue.prototype.isAgent = isAgent
+Vue.prototype.dictLabel = dictLabel
// 全局组件挂载
Vue.component('DictTag', DictTag)
diff --git a/src/utils/enums.js b/src/utils/enums.js
index 12d66b0..e30d18f 100644
--- a/src/utils/enums.js
+++ b/src/utils/enums.js
@@ -403,3 +403,42 @@ export const OrderRefundType = {
RIDE: "2", // 骑行费
}
+// 卡券类型
+export const VipType = {
+ BALANCE: "1", // 储值卡
+ DEDUCT: "2", // 抵扣卡
+ DISCOUNT: "3", // 折扣卡
+
+ // 获取单位
+ getUnit(type) {
+ if (type === this.BALANCE) {
+ return '元';
+ } else if (type === this.DEDUCT) {
+ return '元';
+ } else if (type === this.DISCOUNT) {
+ return '折';
+ }
+ },
+ // 获取标签
+ getLabel(type) {
+ if (type === this.BALANCE) {
+ return '储值金额';
+ } else if (type === this.DEDUCT) {
+ return '抵扣金额';
+ } else if (type === this.DISCOUNT) {
+ return '折扣';
+ }
+ }
+}
+
+// 卡券状态
+export const VipStatus = {
+ ON_SALE: "1", // 上架
+ OFF_SALE: "2", // 下架
+}
+
+// 卡券限制频率单位
+export const VipLimitUnit = {
+ DAY: "1", // 天
+}
+
diff --git a/src/views/bst/vip/components/VipEditDialog.vue b/src/views/bst/vip/components/VipEditDialog.vue
new file mode 100644
index 0000000..c3970df
--- /dev/null
+++ b/src/views/bst/vip/components/VipEditDialog.vue
@@ -0,0 +1,260 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{dict.label}}
+
+
+
+
+
+ 元
+
+
+
+
+ {{ VipType.getUnit(form.type) }}
+
+
+
+
+ 天
+
+
+
+
+ 次
+
+
+
+
+ 元
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 每
+
+
+
+
+
+
+
+
+
+
+ 次
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/bst/vip/index.vue b/src/views/bst/vip/index.vue
new file mode 100644
index 0000000..bb6fc85
--- /dev/null
+++ b/src/views/bst/vip/index.vue
@@ -0,0 +1,325 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 全部
+ 有限制
+ 无限制
+
+
+
+ 搜索
+ 重置
+
+
+
+
+
+ 新增
+
+
+ 删除
+
+
+ 导出
+
+
+
+
+
+
+
+
+
+
+ {{d.row[column.key]}}
+
+
+ 总计可用 {{ d.row.limitTotal }} 次
+
+ ,使用门槛 {{ d.row.minAmount | fix2 | dv}} 元
+
+
+ ,每 {{ d.row.limitRound }} {{ dictLabel(dict.type.vip_limit_unit, d.row.limitUnit) }} {{ d.row.limitCount }} 次
+
+
+
+ {{ d.row.validDays }} 天
+
+
+ {{ d.row.price | fix2 | dv}} 元
+
+
+ {{ d.row.discountValue | dv}} {{ VipType.getUnit(d.row.type) }}
+
+
+
+
+
+ {{ d.row.name }}
+
+
+
+
+ {{d.row[column.key]}}
+
+
+
+
+
+
+ 修改
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/bst/vip/util.js b/src/views/bst/vip/util.js
new file mode 100644
index 0000000..139597f
--- /dev/null
+++ b/src/views/bst/vip/util.js
@@ -0,0 +1,2 @@
+
+