From 13eb6a75a964476cd718ecc77e9325b64c343a8f Mon Sep 17 00:00:00 2001
From: XinWei <2718030729@qq.com>
Date: Wed, 16 Oct 2024 13:41:12 +0800
Subject: [PATCH] =?UTF-8?q?1.=E5=90=8E=E5=8F=B0=E5=89=8D=E7=AB=AF-?=
=?UTF-8?q?=E9=9A=90=E8=97=8F=E4=BC=98=E6=83=A0=E5=88=B8=E6=8A=98=E6=89=A3?=
=?UTF-8?q?=E9=80=89=E9=A1=B9=202.=E5=90=8E=E5=8F=B0=E5=89=8D=E7=AB=AF-?=
=?UTF-8?q?=E4=BC=98=E6=83=A0=E5=88=B8=E6=9C=89=E6=95=88=E6=9C=9F=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../mobile/CouponCard/component.tsx | 3 ++-
.../views/mall/promotion/coupon/formatter.ts | 3 ++-
.../coupon/template/CouponTemplateForm.vue | 24 ++++++++++++-------
3 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/yudao-admin-vue3/src/components/DiyEditor/components/mobile/CouponCard/component.tsx b/yudao-admin-vue3/src/components/DiyEditor/components/mobile/CouponCard/component.tsx
index 689690b..3e06dff 100644
--- a/yudao-admin-vue3/src/components/DiyEditor/components/mobile/CouponCard/component.tsx
+++ b/yudao-admin-vue3/src/components/DiyEditor/components/mobile/CouponCard/component.tsx
@@ -67,7 +67,8 @@ export const CouponValidTerm = defineComponent({
coupon.validEndTime,
'YYYY-MM-DD'
)}`
- : `领取后第 ${coupon.fixedStartTerm} - ${coupon.fixedEndTerm} 天内可用`
+ // : `领取后第 ${coupon.fixedStartTerm} - ${coupon.fixedEndTerm} 天内可用`
+ : `领取后 ${coupon.fixedEndTerm} 天内可用`
return () =>
{text}
}
})
diff --git a/yudao-admin-vue3/src/views/mall/promotion/coupon/formatter.ts b/yudao-admin-vue3/src/views/mall/promotion/coupon/formatter.ts
index f00138a..ee3e73f 100644
--- a/yudao-admin-vue3/src/views/mall/promotion/coupon/formatter.ts
+++ b/yudao-admin-vue3/src/views/mall/promotion/coupon/formatter.ts
@@ -28,7 +28,8 @@ export const validityTypeFormat = (row: CouponTemplateVO) => {
return `${formatDate(row.validStartTime)} 至 ${formatDate(row.validEndTime)}`
}
if (row.validityType === CouponTemplateValidityTypeEnum.TERM.type) {
- return `领取后第 ${row.fixedStartTerm} - ${row.fixedEndTerm} 天内可用`
+ // return `领取后第 ${row.fixedStartTerm} - ${row.fixedEndTerm} 天内可用`
+ return `领取后 ${row.fixedEndTerm + 1} 天内可用`
}
return '未知【' + row.validityType + '】'
}
diff --git a/yudao-admin-vue3/src/views/mall/promotion/coupon/template/CouponTemplateForm.vue b/yudao-admin-vue3/src/views/mall/promotion/coupon/template/CouponTemplateForm.vue
index 408f381..e51e5c9 100644
--- a/yudao-admin-vue3/src/views/mall/promotion/coupon/template/CouponTemplateForm.vue
+++ b/yudao-admin-vue3/src/views/mall/promotion/coupon/template/CouponTemplateForm.vue
@@ -38,7 +38,7 @@
@@ -151,10 +151,10 @@
- 第
+
天有效
@@ -215,7 +215,7 @@ const formData = ref({
validTimes: [],
validStartTime: undefined,
validEndTime: undefined,
- fixedStartTerm: undefined,
+ fixedStartTerm: 0,
fixedEndTerm: undefined,
productScope: PromotionProductScopeEnum.ALL.scope,
productScopeValues: [], // 商品范围:值为 品类编号列表 或 商品编号列表 ,用于提交
@@ -255,6 +255,7 @@ const open = async (type: string, id?: number) => {
const data = await CouponTemplateApi.getCouponTemplate(id)
formData.value = {
...data,
+ fixedEndTerm: data.fixedEndTerm - data.fixedStartTerm + 1, // 显示时总天数(实际需要+1)
discountPrice: formatToFraction(data.discountPrice),
discountPercent:
data.discountPercent !== undefined ? data.discountPercent / 10.0 : undefined,
@@ -283,6 +284,7 @@ const submitForm = async () => {
try {
const data = {
...formData.value,
+ fixedEndTerm: (formData.value.fixedEndTerm || 0) + formData.value.fixedStartTerm - 1, // 得到结束的天数
discountPrice: convertToInteger(formData.value.discountPrice),
discountPercent:
formData.value.discountPercent !== undefined
@@ -335,7 +337,7 @@ const resetForm = () => {
validTimes: [],
validStartTime: undefined,
validEndTime: undefined,
- fixedStartTerm: undefined,
+ fixedStartTerm: 0,
fixedEndTerm: undefined,
productScope: PromotionProductScopeEnum.ALL.scope,
productScopeValues: [],
@@ -383,6 +385,12 @@ function setProductScopeValues(data: CouponTemplateApi.CouponTemplateVO) {
break
}
}
+/** 暂时隐藏掉字典中的折扣 */
+function filteredDictOptions() {
+ return getIntDictOptions(DICT_TYPE.PROMOTION_DISCOUNT_TYPE).filter(
+ dict => dict.value !== 2 // 过滤掉 value 为 2 的选项
+ );
+}
--
2.45.2