From 2c1933b7befc0a6f1654659520ecc97b006d520e Mon Sep 17 00:00:00 2001 From: lzhizhao <790086754@qq.com> Date: Sun, 10 Aug 2025 00:09:18 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B5=8B=E8=AF=95=E4=BC=9A=E5=91=98?= =?UTF-8?q?=E4=BC=98=E6=83=A0=E5=88=B8=E5=88=97=E8=A1=A8=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/httpRequest.js | 12 +++++----- src/views/modules/marketing/level/index.vue | 14 +++++++++-- .../marketing/user/popup/view-details.vue | 23 +++++++++++++++++-- 3 files changed, 39 insertions(+), 10 deletions(-) diff --git a/src/utils/httpRequest.js b/src/utils/httpRequest.js index a3243fc..f63ade0 100644 --- a/src/utils/httpRequest.js +++ b/src/utils/httpRequest.js @@ -182,12 +182,12 @@ http.interceptors.response.use( Object.prototype.toString.call(response.data) === "[object Object]" ) { // Message.closeAll(); - if (!response.config.hidemsg) { - Message({ - message: response.data.msg || response.data.message, - type: "success" - }); - } + // if (!response.config.hidemsg) { + // Message({ + // message: response.data.msg || response.data.message, + // type: "success" + // }); + // } } } return Promise.resolve(response); diff --git a/src/views/modules/marketing/level/index.vue b/src/views/modules/marketing/level/index.vue index 8e43dbc..5ecc683 100644 --- a/src/views/modules/marketing/level/index.vue +++ b/src/views/modules/marketing/level/index.vue @@ -98,8 +98,18 @@ export default { }, methods: { initData() { - // 默认选择所有摊铺 - this.formInline.shopIds = this.storeList.map(store => store.shopId); + // 如果storeList有数据,默认选择所有摊铺 + if (this.storeList && this.storeList.length > 0) { + this.formInline.shopIds = this.storeList.map(store => store.shopId); + } + // 如果storeList没有数据但shopId有数据,则设置为shopId(支持只有一家店铺的情况) + else if (this.shopId) { + this.formInline.shopIds = [this.shopId]; + } + // 否则设置为空数组 + else { + this.formInline.shopIds = []; + } this.getList(); }, diff --git a/src/views/modules/marketing/user/popup/view-details.vue b/src/views/modules/marketing/user/popup/view-details.vue index c940456..28db094 100644 --- a/src/views/modules/marketing/user/popup/view-details.vue +++ b/src/views/modules/marketing/user/popup/view-details.vue @@ -228,13 +228,21 @@ width="100" align="center" > + - + @@ -580,6 +588,17 @@ export default { default: return "未知"; } + }, + // 获取优惠券类型中文文本 + getCouponTypeText(couponType) { + switch (couponType) { + case "MONEY": + return "满减券"; + case "DISCOUNT": + return "折扣券"; + default: + return couponType || "未知"; + } } }, computed: {