From f7217a5c833fbda3be3a19b81e550175953479db Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 15 Sep 2024 21:06:21 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E3=80=91=E5=95=86=E5=9F=8E=EF=BC=9A=E4=BF=AE=E5=A4=8D=E6=BB=A1?= =?UTF-8?q?=E5=87=8F=E9=80=81=E6=89=B9=E9=87=8F=E5=90=88=E5=B9=B6=E7=9A=84?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/mall/promotion/coupon/components/CouponSelect.vue | 3 ++- src/views/mall/promotion/coupon/formatter.ts | 5 ++--- src/views/mall/promotion/rewardActivity/RewardForm.vue | 2 -- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/views/mall/promotion/coupon/components/CouponSelect.vue b/src/views/mall/promotion/coupon/components/CouponSelect.vue index b568fa1c..6a6835ca 100644 --- a/src/views/mall/promotion/coupon/components/CouponSelect.vue +++ b/src/views/mall/promotion/coupon/components/CouponSelect.vue @@ -116,6 +116,7 @@ import { validityTypeFormat } from '@/views/mall/promotion/coupon/formatter' import * as CouponTemplateApi from '@/api/mall/promotion/coupon/couponTemplate' +import { CouponTemplateTakeTypeEnum } from '@/utils/constants' defineOptions({ name: 'CouponSelect' }) @@ -138,7 +139,7 @@ const queryParams = reactive({ pageSize: 10, name: null, discountType: null, - canTakeTypes:[1]//只获得直接领取的券 + canTakeTypes: [CouponTemplateTakeTypeEnum.USER.type] // 只获得直接领取的券 }) const queryFormRef = ref() // 搜索的表单 const selectedCouponList = ref([]) // 选择的数据 diff --git a/src/views/mall/promotion/coupon/formatter.ts b/src/views/mall/promotion/coupon/formatter.ts index d7382e69..8005d0c0 100644 --- a/src/views/mall/promotion/coupon/formatter.ts +++ b/src/views/mall/promotion/coupon/formatter.ts @@ -16,15 +16,14 @@ export const discountFormat = (row: CouponTemplateVO) => { // 格式化【领取上限】 export const takeLimitCountFormat = (row: CouponTemplateVO) => { - if(row.takeLimitCount){ + if (row.takeLimitCount) { if (row.takeLimitCount === -1) { return '无领取限制' } return `${row.takeLimitCount} 张/人` - }else{ + } else { return ' ' } - } // 格式化【有效期限】 diff --git a/src/views/mall/promotion/rewardActivity/RewardForm.vue b/src/views/mall/promotion/rewardActivity/RewardForm.vue index 889fce98..64a2dd4a 100644 --- a/src/views/mall/promotion/rewardActivity/RewardForm.vue +++ b/src/views/mall/promotion/rewardActivity/RewardForm.vue @@ -118,7 +118,6 @@ const open = async (type: string, id?: number) => { data.startAndEndTime = [data.startTime, data.endTime] // 规则分转元 data.rules?.forEach((item: any) => { - item.limit = fenToYuan(item.limit || 0) item.discountPrice = fenToYuan(item.discountPrice || 0) if (data.conditionType === PromotionConditionTypeEnum.PRICE.type) { item.limit = fenToYuan(item.limit || 0) @@ -154,7 +153,6 @@ const submitForm = async () => { delete data.startAndEndTime // 规则元转分 data.rules.forEach((item) => { - item.limit = yuanToFen(item.limit || 0) item.discountPrice = yuanToFen(item.discountPrice || 0) if (data.conditionType === PromotionConditionTypeEnum.PRICE.type) { item.limit = yuanToFen(item.limit || 0)