From 51e76ffd53aa1cc76f85cfb4389ac257f2804f8a Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 3 Jun 2023 23:15:11 +0800 Subject: [PATCH] =?UTF-8?q?code=20review=EF=BC=9A=E4=BC=98=E6=83=A0?= =?UTF-8?q?=E5=8A=B5=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mall/promotion/coupon.ts | 2 ++ src/utils/constants.ts | 22 ---------------------- src/views/mall/promotion/coupon/index.vue | 22 +++++++++++----------- 3 files changed, 13 insertions(+), 33 deletions(-) diff --git a/src/api/mall/promotion/coupon.ts b/src/api/mall/promotion/coupon.ts index ab50c3cc..565b86f7 100755 --- a/src/api/mall/promotion/coupon.ts +++ b/src/api/mall/promotion/coupon.ts @@ -1,5 +1,7 @@ import request from '@/config/axios' +// TODO @dhb52:vo 缺少 + // 删除优惠劵 export const deleteCoupon = async (id: number) => { return request.delete({ diff --git a/src/utils/constants.ts b/src/utils/constants.ts index 58b4a931..b2914f9e 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -281,28 +281,6 @@ export const PromotionConditionTypeEnum = { } } -/** - * 促销活动的状态枚举 - */ -export const PromotionActivityStatusEnum = { - WAIT: { - type: 10, - name: '未开始' - }, - RUN: { - type: 20, - name: '进行中' - }, - END: { - type: 30, - name: '已结束' - }, - CLOSE: { - type: 40, - name: '已关闭' - } -} - /** * 优惠类型枚举 */ diff --git a/src/views/mall/promotion/coupon/index.vue b/src/views/mall/promotion/coupon/index.vue index 9fe8f0d4..bf296e9a 100755 --- a/src/views/mall/promotion/coupon/index.vue +++ b/src/views/mall/promotion/coupon/index.vue @@ -142,17 +142,6 @@ const statusTabs = reactive([ const queryFormRef = ref(null) -onMounted(() => { - getList() - // 设置 statuses 过滤 - for (const dict of getIntDictOptions(DICT_TYPE.PROMOTION_COUPON_STATUS)) { - statusTabs.push({ - label: dict.label, - value: dict.value as string - }) - } -}) - /** 查询列表 */ const getList = async () => { loading.value = true @@ -197,4 +186,15 @@ const onTabChange = (tabName) => { queryParams.status = tabName === 'all' ? undefined : tabName getList() } + +onMounted(() => { + getList() + // 设置 statuses 过滤 + for (const dict of getIntDictOptions(DICT_TYPE.PROMOTION_COUPON_STATUS)) { + statusTabs.push({ + label: dict.label, + value: dict.value as string + }) + } +})