From 326e88762cbf32bc05fbbcf472ccc0a0dcc6ea76 Mon Sep 17 00:00:00 2001 From: xingyu4j Date: Wed, 5 Nov 2025 15:24:20 +0800 Subject: [PATCH] feat: diy editor property --- .../coupon-card/coupon-discount-desc.tsx | 2 +- .../mobile/coupon-card/coupon-discount.tsx | 2 +- .../mobile/coupon-card/property.vue | 55 +++++++++++-------- 3 files changed, 33 insertions(+), 26 deletions(-) diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/coupon-card/coupon-discount-desc.tsx b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/coupon-card/coupon-discount-desc.tsx index 8056bd29d..89f360564 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/coupon-card/coupon-discount-desc.tsx +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/coupon-card/coupon-discount-desc.tsx @@ -23,7 +23,7 @@ export const CouponDiscountDesc = defineComponent({ const discountDesc = coupon.discountType === PromotionDiscountTypeEnum.PRICE.type ? `减${floatToFixed2(coupon.discountPrice)}元` - : `打${coupon.discountPercent ?? 0 / 10}折`; + : `打${(coupon.discountPercent ?? 0) / 10}折`; return () => (
{useCondition} diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/coupon-card/coupon-discount.tsx b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/coupon-card/coupon-discount.tsx index bd1acea06..15a95887c 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/coupon-card/coupon-discount.tsx +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/coupon-card/coupon-discount.tsx @@ -17,7 +17,7 @@ export const CouponDiscount = defineComponent({ setup(props) { const coupon = props.coupon as MallCouponTemplateApi.CouponTemplate; // 折扣 - let value = `${coupon.discountPercent ?? 0 / 10}`; + let value = `${(coupon.discountPercent ?? 0) / 10}`; let suffix = ' 折'; // 满减 if (coupon.discountType === PromotionDiscountTypeEnum.PRICE.type) { diff --git a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/coupon-card/property.vue b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/coupon-card/property.vue index 50afc547f..8a0da5805 100644 --- a/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/coupon-card/property.vue +++ b/apps/web-antd/src/views/mall/promotion/components/diy-editor/components/mobile/coupon-card/property.vue @@ -40,8 +40,6 @@ const props = defineProps<{ modelValue: CouponCardProperty }>(); const emit = defineEmits(['update:modelValue']); -const { Text: ATypographyText } = Typography; - const formData = useVModel(props, 'modelValue', emit); const couponList = ref([]); // 已选择的优惠券列表 @@ -90,22 +88,24 @@ watch( :key="index" class="flex items-center justify-between" > - - {{ coupon.name }} - - - - 满{{ floatToFixed2(coupon.usePrice) }}元, - - - 减{{ floatToFixed2(coupon.discountPrice) }}元 - - 打{{ coupon.discountPercent }}折 - + + + {{ coupon.name }} + + + + 满{{ floatToFixed2(coupon.usePrice) }}元, + + + 减{{ floatToFixed2(coupon.discountPrice) }}元 + + 打{{ (coupon.discountPercent ?? 0) / 10 }}折 + +
@@ -126,17 +124,26 @@ watch( - + - + - +