From 10cb91ad594607b5ac30be9ef63ca1ca66bd3a72 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Thu, 22 Aug 2024 18:19:54 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=96=B0=E5=A2=9E=E3=80=91MALL:=20?= =?UTF-8?q?=E6=BB=A1=E5=87=8F=E9=80=81=E6=B4=BB=E5=8A=A8=E8=B5=A0=E9=80=81?= =?UTF-8?q?=E4=BC=98=E6=83=A0=E5=88=B8=EF=BC=8850%=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mall/promotion/reward/rewardActivity.ts | 2 +- .../coupon/components/CouponSelect.vue | 13 ++-- .../promotion/rewardActivity/RewardForm.vue | 2 +- .../rewardActivity/components/RewardRule.vue | 4 ++ .../components/RewardRuleCouponShowcase.vue | 72 +++++++++++++++++++ 5 files changed, 87 insertions(+), 6 deletions(-) create mode 100644 src/views/mall/promotion/rewardActivity/components/RewardRuleCouponShowcase.vue diff --git a/src/api/mall/promotion/reward/rewardActivity.ts b/src/api/mall/promotion/reward/rewardActivity.ts index 0e7630ae..af7390dc 100644 --- a/src/api/mall/promotion/reward/rewardActivity.ts +++ b/src/api/mall/promotion/reward/rewardActivity.ts @@ -12,7 +12,7 @@ export interface RewardActivityVO { productScopeValues?: number[] // 商品范围:值为 品类编号列表 或 商品编号列表 ,用于提交 productCategoryIds?: number[] // 仅用于表单,不提交 productSpuIds?: number[] // 仅用于表单,不提交 - rules?: RewardRule[] + rules: RewardRule[] } // 优惠规则 diff --git a/src/views/mall/promotion/coupon/components/CouponSelect.vue b/src/views/mall/promotion/coupon/components/CouponSelect.vue index 715dcb7d..c232095e 100644 --- a/src/views/mall/promotion/coupon/components/CouponSelect.vue +++ b/src/views/mall/promotion/coupon/components/CouponSelect.vue @@ -153,11 +153,12 @@ import * as CouponTemplateApi from '@/api/mall/promotion/coupon/couponTemplate' defineOptions({ name: 'CouponSelect' }) -defineProps<{ - multipleSelection: CouponTemplateApi.CouponTemplateVO[] +const props = defineProps<{ + multipleSelection?: CouponTemplateApi.CouponTemplateVO[] }>() const emit = defineEmits<{ - (e: 'update:multipleSelection', v: CouponTemplateApi.CouponTemplateVO[]) + (e: 'update:multipleSelection', v: CouponTemplateApi.CouponTemplateVO[]): void + (e: 'change', v: CouponTemplateApi.CouponTemplateVO[]): void }>() const dialogVisible = ref(false) // 弹窗的是否展示 const dialogTitle = ref('选择优惠卷') // 弹窗的标题 @@ -209,7 +210,11 @@ const open = async () => { defineExpose({ open }) // 提供 open 方法,用于打开弹窗 const handleSelectionChange = (val: CouponTemplateApi.CouponTemplateVO[]) => { - emit('update:multipleSelection', val) + if (props.multipleSelection) { + emit('update:multipleSelection', val) + return + } + emit('change', val) } const submitForm = () => { diff --git a/src/views/mall/promotion/rewardActivity/RewardForm.vue b/src/views/mall/promotion/rewardActivity/RewardForm.vue index d1dfa9df..46ad2ff1 100644 --- a/src/views/mall/promotion/rewardActivity/RewardForm.vue +++ b/src/views/mall/promotion/rewardActivity/RewardForm.vue @@ -1,5 +1,5 @@ diff --git a/src/views/mall/promotion/rewardActivity/components/RewardRuleCouponShowcase.vue b/src/views/mall/promotion/rewardActivity/components/RewardRuleCouponShowcase.vue new file mode 100644 index 00000000..79e3a832 --- /dev/null +++ b/src/views/mall/promotion/rewardActivity/components/RewardRuleCouponShowcase.vue @@ -0,0 +1,72 @@ + + + + +