From 45fc9957af93faa99d137a27b106e9b8cdf88f16 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Thu, 22 Aug 2024 16:39:52 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E3=80=91MALL:=20=E6=BB=A1=E5=87=8F=E9=80=81=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mall/promotion/reward/rewardActivity.ts | 25 +- .../promotion/rewardActivity/RewardForm.vue | 215 +++--------------- .../rewardActivity/components/RewardRule.vue | 125 ++++++++++ .../mall/promotion/rewardActivity/index.vue | 75 +++--- 4 files changed, 211 insertions(+), 229 deletions(-) create mode 100644 src/views/mall/promotion/rewardActivity/components/RewardRule.vue diff --git a/src/api/mall/promotion/reward/rewardActivity.ts b/src/api/mall/promotion/reward/rewardActivity.ts index 691db476..b5c75570 100644 --- a/src/api/mall/promotion/reward/rewardActivity.ts +++ b/src/api/mall/promotion/reward/rewardActivity.ts @@ -1,34 +1,37 @@ import request from '@/config/axios' -export interface DiscountActivityVO { +export interface RewardActivityVO { id?: number name?: string startTime?: Date endTime?: Date + startAndEndTime?: Date[] // 只前端使用 remark?: string conditionType?: number productScope?: number productSpuIds?: number[] - rules?: DiscountProductVO[] + rules?: RewardRule[] } // 优惠规则 -export interface DiscountProductVO { - limit: number - discountPrice: number - freeDelivery: boolean - point: number - couponIds: number[] - couponCounts: number[] +export interface RewardRule { + limit?: number + discountPrice?: number + freeDelivery?: boolean + givePoint?: boolean + point?: number + giveCoupon?: boolean + couponIds?: number[] + couponCounts?: number[] } // 新增满减送活动 -export const createRewardActivity = async (data: DiscountActivityVO) => { +export const createRewardActivity = async (data: RewardActivityVO) => { return await request.post({ url: '/promotion/reward-activity/create', data }) } // 更新满减送活动 -export const updateRewardActivity = async (data: DiscountActivityVO) => { +export const updateRewardActivity = async (data: RewardActivityVO) => { return await request.put({ url: '/promotion/reward-activity/update', data }) } diff --git a/src/views/mall/promotion/rewardActivity/RewardForm.vue b/src/views/mall/promotion/rewardActivity/RewardForm.vue index 9fb69a56..8bf14f3c 100644 --- a/src/views/mall/promotion/rewardActivity/RewardForm.vue +++ b/src/views/mall/promotion/rewardActivity/RewardForm.vue @@ -1,11 +1,11 @@ diff --git a/src/views/mall/promotion/rewardActivity/components/RewardRule.vue b/src/views/mall/promotion/rewardActivity/components/RewardRule.vue new file mode 100644 index 00000000..c119c0db --- /dev/null +++ b/src/views/mall/promotion/rewardActivity/components/RewardRule.vue @@ -0,0 +1,125 @@ + + + + + diff --git a/src/views/mall/promotion/rewardActivity/index.vue b/src/views/mall/promotion/rewardActivity/index.vue index 4f6f8a60..55f30358 100644 --- a/src/views/mall/promotion/rewardActivity/index.vue +++ b/src/views/mall/promotion/rewardActivity/index.vue @@ -4,27 +4,27 @@ - 搜索 - 重置 + + + 搜索 + + + + 重置 + - 新增 + + 新增 @@ -62,47 +69,47 @@ - + - + - +