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 的选项
+ );
+}