From 870a1c44e87b4b13f5ecb6cac118f88a447d3909 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=97=B4=E8=B4=A7?= <252048765@qq.com> Date: Sat, 14 Sep 2024 20:29:38 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E3=80=90=E6=B7=BB=E5=8A=A0=E3=80=91?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=B7=BB=E5=8A=A0=E4=BC=98=E6=83=A0=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../discountActivity/discountActivity.data.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/views/mall/promotion/discountActivity/discountActivity.data.ts b/src/views/mall/promotion/discountActivity/discountActivity.data.ts index a4c93ffb..d79dcab7 100644 --- a/src/views/mall/promotion/discountActivity/discountActivity.data.ts +++ b/src/views/mall/promotion/discountActivity/discountActivity.data.ts @@ -72,6 +72,17 @@ const crudSchemas = reactive([ width: 120 } }, + { + label: '优惠类型', + field: 'discountType', + dictType: DICT_TYPE.PROMOTION_DISCOUNT_TYPE, + dictClass: 'number', + isSearch: true, + form: { + component: 'Radio', + value: 1 + } + }, { label: '活动商品', field: 'spuId', From fbed29100f97324d4d2c661c59776d3156753609 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=97=B4=E8=B4=A7?= <252048765@qq.com> Date: Sat, 14 Sep 2024 20:30:16 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E3=80=90BUG=E3=80=91=E6=BB=A1=E5=87=8F?= =?UTF-8?q?=E6=BB=A1=E8=B6=B3=E5=A4=9A=E5=B0=91=E5=85=83=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E5=85=83=E8=BD=AC=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/mall/promotion/rewardActivity/RewardForm.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/views/mall/promotion/rewardActivity/RewardForm.vue b/src/views/mall/promotion/rewardActivity/RewardForm.vue index 9a48d857..0f61c00e 100644 --- a/src/views/mall/promotion/rewardActivity/RewardForm.vue +++ b/src/views/mall/promotion/rewardActivity/RewardForm.vue @@ -118,6 +118,7 @@ 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) }) formData.value = data @@ -150,6 +151,7 @@ const submitForm = async () => { delete data.startAndEndTime // 规则元转分 data.rules.forEach((item) => { + item.limit = yuanToFen(item.limit || 0) item.discountPrice = yuanToFen(item.discountPrice || 0) }) // 设置商品范围 From 4d25dda7fdc950c03f074d34fb5c9e29411957fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=97=B4=E8=B4=A7?= <252048765@qq.com> Date: Sun, 15 Sep 2024 16:27:12 +0800 Subject: [PATCH 03/10] =?UTF-8?q?=E3=80=90=E4=BC=98=E5=8C=96=E3=80=91?= =?UTF-8?q?=E6=BB=A1=E5=87=8F=E9=80=81=E5=88=97=E8=A1=A8=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B4=BB=E5=8A=A8=E8=8C=83=E5=9B=B4=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E3=80=81=E4=BF=AE=E6=94=B9=E7=8A=B6=E6=80=81=E4=B8=BA?= =?UTF-8?q?COMMON=5FSTATUS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mall/promotion/reward/rewardActivity.ts | 12 ++++++------ src/views/mall/promotion/rewardActivity/index.vue | 7 ++++++- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/api/mall/promotion/reward/rewardActivity.ts b/src/api/mall/promotion/reward/rewardActivity.ts index 7d426953..e9f95ed8 100644 --- a/src/api/mall/promotion/reward/rewardActivity.ts +++ b/src/api/mall/promotion/reward/rewardActivity.ts @@ -47,12 +47,12 @@ export const getReward = async (id: number) => { return await request.get({ url: '/promotion/reward-activity/get?id=' + id }) } -// 关闭拼团活动 -export const closeRewardActivity = async (id: number) => { - return await request.put({ url: '/promotion/reward-activity/close?id=' + id }) -} - -// 删除限时折扣活动 +// 删除满减送活动 export const deleteRewardActivity = async (id: number) => { return await request.delete({ url: '/promotion/reward-activity/delete?id=' + id }) } + +// 关闭满减送活动 +export const closeRewardActivity = async (id: number) => { + return await request.put({ url: '/promotion/reward-activity/close?id=' + id }) +} diff --git a/src/views/mall/promotion/rewardActivity/index.vue b/src/views/mall/promotion/rewardActivity/index.vue index 95f63fb9..544420e1 100644 --- a/src/views/mall/promotion/rewardActivity/index.vue +++ b/src/views/mall/promotion/rewardActivity/index.vue @@ -27,7 +27,7 @@ placeholder="请选择活动状态" > + + + Date: Sun, 15 Sep 2024 16:31:23 +0800 Subject: [PATCH 04/10] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E3=80=91=E4=BC=98=E5=8C=96=E9=99=90=E6=97=B6=E6=BB=A1?= =?UTF-8?q?=E5=87=8F=E7=9A=84=E9=87=91=E9=A2=9D=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E4=B8=BA=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mall/promotion/discountActivity/DiscountActivityForm.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/mall/promotion/discountActivity/DiscountActivityForm.vue b/src/views/mall/promotion/discountActivity/DiscountActivityForm.vue index 2f2b441b..ac25eea8 100644 --- a/src/views/mall/promotion/discountActivity/DiscountActivityForm.vue +++ b/src/views/mall/promotion/discountActivity/DiscountActivityForm.vue @@ -193,7 +193,7 @@ const submitForm = async () => { const products = cloneDeep(spuAndSkuListRef.value.getSkuConfigs('productConfig')) products.forEach((item: DiscountActivityApi.DiscountProductVO) => { item.discountPercent = convertToInteger(item.discountPercent) - item.discountPrice = convertToInteger(item.discountPrice) + item.discountPrice = convertToInteger(yuanToFen(item.discountPrice)) }) const data = cloneDeep(formRef.value.formModel) as DiscountActivityApi.DiscountActivityVO data.products = products From c697824b09e4e525ac4d24112f635feab8492a59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=97=B4=E8=B4=A7?= <252048765@qq.com> Date: Sun, 15 Sep 2024 16:33:55 +0800 Subject: [PATCH 05/10] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=95=86=E5=93=81=E5=95=86=E5=93=81=E7=AE=80=E4=BB=8B=E3=80=81?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=A3=85=E4=BF=AE=E4=B8=BB=E9=A1=B5=E5=95=86?= =?UTF-8?q?=E5=93=81=E4=BB=B7=E6=A0=BC=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DiyEditor/components/mobile/ProductCard/index.vue | 2 +- src/views/mall/product/spu/form/InfoForm.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/DiyEditor/components/mobile/ProductCard/index.vue b/src/components/DiyEditor/components/mobile/ProductCard/index.vue index 78ad84f3..25f8cb87 100644 --- a/src/components/DiyEditor/components/mobile/ProductCard/index.vue +++ b/src/components/DiyEditor/components/mobile/ProductCard/index.vue @@ -67,7 +67,7 @@ class="text-16px" :style="{ color: property.fields.price.color }" > - ¥{{ fenToYuan(spu.price) }} + ¥{{ fenToYuan(spu.price as any) }} From fc0de84d782e6a32ed01cc8d3d643d7c905664ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=97=B4=E8=B4=A7?= <252048765@qq.com> Date: Sun, 15 Sep 2024 16:36:05 +0800 Subject: [PATCH 06/10] =?UTF-8?q?=E8=A3=85=E4=BF=AE=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E4=BC=98=E6=83=A0=E5=88=B8=E5=8F=AA=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E7=9B=B4=E6=8E=A5=E9=A2=86=E5=8F=96=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/mall/promotion/coupon/components/CouponSelect.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/mall/promotion/coupon/components/CouponSelect.vue b/src/views/mall/promotion/coupon/components/CouponSelect.vue index e5ac86a2..b568fa1c 100644 --- a/src/views/mall/promotion/coupon/components/CouponSelect.vue +++ b/src/views/mall/promotion/coupon/components/CouponSelect.vue @@ -138,7 +138,7 @@ const queryParams = reactive({ pageSize: 10, name: null, discountType: null, - canTakeTypes: null + canTakeTypes:[1]//只获得直接领取的券 }) const queryFormRef = ref() // 搜索的表单 const selectedCouponList = ref([]) // 选择的数据 From f086b9c32b172016341126f9fa54e120b89c4ac9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=97=B4=E8=B4=A7?= <252048765@qq.com> Date: Sun, 15 Sep 2024 16:37:35 +0800 Subject: [PATCH 07/10] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8C=87=E5=AE=9A?= =?UTF-8?q?=E5=8F=91=E6=94=BE=E4=BC=98=E6=83=A0=E5=88=B8=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/mall/promotion/coupon/formatter.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/views/mall/promotion/coupon/formatter.ts b/src/views/mall/promotion/coupon/formatter.ts index 56b11402..d7382e69 100644 --- a/src/views/mall/promotion/coupon/formatter.ts +++ b/src/views/mall/promotion/coupon/formatter.ts @@ -16,10 +16,15 @@ export const discountFormat = (row: CouponTemplateVO) => { // 格式化【领取上限】 export const takeLimitCountFormat = (row: CouponTemplateVO) => { - if (row.takeLimitCount === -1) { - return '无领取限制' + if(row.takeLimitCount){ + if (row.takeLimitCount === -1) { + return '无领取限制' + } + return `${row.takeLimitCount} 张/人` + }else{ + return ' ' } - return `${row.takeLimitCount} 张/人` + } // 格式化【有效期限】 From 8a225e66b78a28d19fc9d4e136578949a51be614 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 15 Sep 2024 20:22:34 +0800 Subject: [PATCH 08/10] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E3=80=91=E5=95=86=E5=9F=8E=EF=BC=9A=E6=BB=A1=E5=87=8F?= =?UTF-8?q?=E9=80=81=E7=9A=84=E6=9D=A1=E4=BB=B6=E7=B1=BB=E5=9E=8B=E7=9A=84?= =?UTF-8?q?=E6=BB=A1=E8=B6=B3=E4=BB=B7=E6=A0=BC=E4=B8=8D=E5=AF=B9=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mall/promotion/rewardActivity/RewardForm.vue | 6 ++++++ .../rewardActivity/components/RewardRule.vue | 13 ++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/views/mall/promotion/rewardActivity/RewardForm.vue b/src/views/mall/promotion/rewardActivity/RewardForm.vue index 9a48d857..64a2dd4a 100644 --- a/src/views/mall/promotion/rewardActivity/RewardForm.vue +++ b/src/views/mall/promotion/rewardActivity/RewardForm.vue @@ -119,6 +119,9 @@ const open = async (type: string, id?: number) => { // 规则分转元 data.rules?.forEach((item: any) => { item.discountPrice = fenToYuan(item.discountPrice || 0) + if (data.conditionType === PromotionConditionTypeEnum.PRICE.type) { + item.limit = fenToYuan(item.limit || 0) + } }) formData.value = data // 获得商品范围 @@ -151,6 +154,9 @@ const submitForm = async () => { // 规则元转分 data.rules.forEach((item) => { item.discountPrice = yuanToFen(item.discountPrice || 0) + if (data.conditionType === PromotionConditionTypeEnum.PRICE.type) { + item.limit = yuanToFen(item.limit || 0) + } }) // 设置商品范围 setProductScopeValues(data) diff --git a/src/views/mall/promotion/rewardActivity/components/RewardRule.vue b/src/views/mall/promotion/rewardActivity/components/RewardRule.vue index 8dc37b32..2c63a427 100644 --- a/src/views/mall/promotion/rewardActivity/components/RewardRule.vue +++ b/src/views/mall/promotion/rewardActivity/components/RewardRule.vue @@ -10,14 +10,25 @@ 满 + - {{ PromotionConditionTypeEnum.PRICE.type === formData.conditionType ? '元' : '件' }} From f7217a5c833fbda3be3a19b81e550175953479db Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 15 Sep 2024 21:06:21 +0800 Subject: [PATCH 09/10] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E3=80=91=E5=95=86=E5=9F=8E=EF=BC=9A=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=BB=A1=E5=87=8F=E9=80=81=E6=89=B9=E9=87=8F=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E7=9A=84=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) From fe33517ef053e39ac4b41148515855a091a442c0 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 15 Sep 2024 21:10:00 +0800 Subject: [PATCH 10/10] =?UTF-8?q?=E3=80=90=E4=BC=98=E5=8C=96=E3=80=91?= =?UTF-8?q?=E5=85=A8=E5=B1=80=EF=BC=9Arvest.vs-code-prettier-eslint=20?= =?UTF-8?q?=E8=BD=AC=E6=88=90=20esbenp.prettier-vscode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/settings.json | 2 +- src/utils/dict.ts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 7d8aed49..f145f386 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -87,7 +87,7 @@ "source.fixAll.stylelint": "explicit" }, "[vue]": { - "editor.defaultFormatter": "rvest.vs-code-prettier-eslint" + "editor.defaultFormatter": "esbenp.prettier-vscode" }, "i18n-ally.localesPaths": ["src/locales"], "i18n-ally.keystyle": "nested", diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 7fbcfebc..f8a0f43b 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -194,7 +194,6 @@ export enum DICT_TYPE { PROMOTION_COUPON_TEMPLATE_VALIDITY_TYPE = 'promotion_coupon_template_validity_type', // 优惠劵模板的有限期类型 PROMOTION_COUPON_STATUS = 'promotion_coupon_status', // 优惠劵的状态 PROMOTION_COUPON_TAKE_TYPE = 'promotion_coupon_take_type', // 优惠劵的领取方式 - PROMOTION_ACTIVITY_STATUS = 'promotion_activity_status', // 优惠活动的状态 PROMOTION_CONDITION_TYPE = 'promotion_condition_type', // 营销的条件类型枚举 PROMOTION_BARGAIN_RECORD_STATUS = 'promotion_bargain_record_status', // 砍价记录的状态 PROMOTION_COMBINATION_RECORD_STATUS = 'promotion_combination_record_status', // 拼团记录的状态