From ab64a1d1df9e03948dc238d15c6b30a95b42315f Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 7 Jan 2024 22:41:17 +0800 Subject: [PATCH 01/14] =?UTF-8?q?=F0=9F=93=96=20MALL=EF=BC=9Acode=20review?= =?UTF-8?q?=20=E6=BB=A1=E5=87=8F=E9=80=81=E6=B4=BB=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.dev | 6 +- .../mall/promotion/reward/rewardActivity.ts | 28 +- .../promotion/rewardActivity/RewardForm.vue | 261 ++++++++++-------- .../mall/promotion/rewardActivity/index.vue | 10 +- 4 files changed, 168 insertions(+), 137 deletions(-) diff --git a/.env.dev b/.env.dev index 610924b8..3c41cc68 100644 --- a/.env.dev +++ b/.env.dev @@ -4,8 +4,8 @@ NODE_ENV=development VITE_DEV=true # 请求路径 -# VITE_BASE_URL='http://api-dashboard.yudao.iocoder.cn' -VITE_BASE_URL='http://dofast.demo.huizhizao.vip:20001' +VITE_BASE_URL='http://api-dashboard.yudao.iocoder.cn' +# VITE_BASE_URL='http://dofast.demo.huizhizao.vip:20001' # 上传路径 VITE_UPLOAD_URL='http://api-dashboard.yudao.iocoder.cn/admin-api/infra/file/upload' @@ -35,4 +35,4 @@ VITE_OUT_DIR=dist VITE_MALL_H5_DOMAIN='http://mall.yudao.iocoder.cn' # 验证码的开关 -VITE_APP_CAPTCHA_ENABLE=true +VITE_APP_CAPTCHA_ENABLE=false diff --git a/src/api/mall/promotion/reward/rewardActivity.ts b/src/api/mall/promotion/reward/rewardActivity.ts index 50c33564..691db476 100644 --- a/src/api/mall/promotion/reward/rewardActivity.ts +++ b/src/api/mall/promotion/reward/rewardActivity.ts @@ -1,17 +1,18 @@ import request from '@/config/axios' export interface DiscountActivityVO { - id?:number, + id?: number name?: string - startTime?:Date - endTime?:Date - remark?:string - conditionType?:number - productScope?:number - productSpuIds?:number[] - rules?:DiscountProductVO[] + startTime?: Date + endTime?: Date + remark?: string + conditionType?: number + productScope?: number + productSpuIds?: number[] + rules?: DiscountProductVO[] } -//优惠规则 + +// 优惠规则 export interface DiscountProductVO { limit: number discountPrice: number @@ -21,23 +22,26 @@ export interface DiscountProductVO { couponCounts: number[] } - // 新增满减送活动 export const createRewardActivity = async (data: DiscountActivityVO) => { return await request.post({ url: '/promotion/reward-activity/create', data }) } + // 更新满减送活动 export const updateRewardActivity = async (data: DiscountActivityVO) => { return await request.put({ url: '/promotion/reward-activity/update', data }) } + // 查询满减送活动列表 export const getRewardActivityPage = async (params) => { return await request.get({ url: '/promotion/reward-activity/page', params }) } + // 查询满减送活动详情 -export const getReward = async (id:number) => { - return await request.get({ url: '/promotion/reward-activity/get?id='+id, }) +export const getReward = async (id: number) => { + return await request.get({ url: '/promotion/reward-activity/get?id=' + id }) } + // 删除限时折扣活动 export const deleteRewardActivity = async (id: number) => { return await request.delete({ url: '/promotion/reward-activity/delete?id=' + id }) diff --git a/src/views/mall/promotion/rewardActivity/RewardForm.vue b/src/views/mall/promotion/rewardActivity/RewardForm.vue index 716f4e26..9fb69a56 100644 --- a/src/views/mall/promotion/rewardActivity/RewardForm.vue +++ b/src/views/mall/promotion/rewardActivity/RewardForm.vue @@ -24,51 +24,96 @@ {{ dict.label }} + {{ dict.label }} + - + + 添加活动层级 {{ dict.label }} + {{ dict.label }} + @@ -87,9 +132,9 @@ > {{ item.name }} - ¥{{ (item.price / 100.0).toFixed(2) }} + + ¥{{ (item.price / 100.0).toFixed(2) }} + @@ -106,15 +151,8 @@ diff --git a/src/views/mall/promotion/rewardActivity/index.vue b/src/views/mall/promotion/rewardActivity/index.vue index 86f91fea..c1d352be 100644 --- a/src/views/mall/promotion/rewardActivity/index.vue +++ b/src/views/mall/promotion/rewardActivity/index.vue @@ -122,8 +122,7 @@ diff --git a/src/views/mall/product/spu/form/BasicInfoForm.vue b/src/views/mall/product/spu/form/BasicInfoForm.vue index f7da536d..42059718 100644 --- a/src/views/mall/product/spu/form/BasicInfoForm.vue +++ b/src/views/mall/product/spu/form/BasicInfoForm.vue @@ -7,131 +7,62 @@ :rules="rules" label-width="120px" > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 单规格 - 多规格 - - - - - - - 默认设置 - 单独设置 - - - - - - - - - - 添加属性 - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -161,30 +92,15 @@ @click="imagePreview(row.sliderPicUrls)" /> - - - - diff --git a/src/views/mall/product/spu/form/index.vue b/src/views/mall/product/spu/form/index.vue index 9d69923a..73225e03 100644 --- a/src/views/mall/product/spu/form/index.vue +++ b/src/views/mall/product/spu/form/index.vue @@ -1,7 +1,7 @@