浏览代码

feat:【商城】店铺装修-优惠劵:完善优惠描述、剩余数量

YunaiV 10 月之前
父节点
当前提交
0f43503085

+ 1 - 1
src/components/DiyEditor/components/mobile/CouponCard/component.tsx

@@ -43,7 +43,7 @@ export const CouponDiscountDesc = defineComponent({
     const discountDesc =
       coupon.discountType === PromotionDiscountTypeEnum.PRICE.type
         ? `减${floatToFixed2(coupon.discountPrice)}元`
-        : `打${coupon.discountPercent}折`
+        : `打${coupon.discountPercent / 10.0}折`
     return () => (
       <div>
         <span>{useCondition}</span>

+ 9 - 2
src/components/DiyEditor/components/mobile/CouponCard/index.vue

@@ -49,7 +49,13 @@
           <div class="flex flex-col justify-evenly gap-4px">
             <!-- 优惠值 -->
             <CouponDiscount :coupon="coupon" />
-            <div>{{ coupon.name }}</div>
+            <!-- 优惠描述 -->
+            <CouponDiscountDesc :coupon="coupon" />
+            <!-- 领取说明 -->
+            <div v-if="coupon.totalCount >= 0">
+              仅剩:{{ coupon.totalCount - coupon.takeCount }}张
+            </div>
+            <div v-else-if="coupon.totalCount === -1">仅剩:不限制</div>
           </div>
           <div class="flex flex-col">
             <div
@@ -67,7 +73,8 @@
         <div v-else class="flex flex-col items-center justify-around gap-4px p-4px">
           <!-- 优惠值 -->
           <CouponDiscount :coupon="coupon" />
-          <div>{{ coupon.name }}</div>
+          <!-- 优惠描述 -->
+          <CouponDiscountDesc :coupon="coupon" />
           <div
             class="rounded-20px p-x-8px p-y-2px"
             :style="{