瀏覽代碼

fix(create-order): 修复月卡计算逻辑

- 在 OrderDetailCardProductList 和 SelectOrderDetailCard 组件中
- 修复了 12 个月卡计算错误的问题
- 对月卡计算逻辑进行了优化,考虑到了 12 个月的特殊情况

Signed-off-by: tangshizhe <48740614+tangshizhe@users.noreply.github.com>
tangshizhe 1 月之前
父節點
當前提交
76bcca52fe

+ 5 - 2
src/views/create-order/components/order-detail-submodule/OrderDetailCardProductList.vue

@@ -600,7 +600,11 @@ export default {
           days += value;
           text = `${value}日`;
         } else if (textValue.includes('月')) {
-          days += value * 30;
+          if(value === 12) {
+            days += 365;
+          } else {
+            days += value * 30;
+          }
           text = `${value}个月`;
         } else if (textValue.includes('季度')) {
           days += value * 90;
@@ -615,7 +619,6 @@ export default {
       // 计算购买和赠送部分
       const buyResult = processCycle(buy_cycle, buy_type);
       const giveResult = processCycle(give_cycle, give_type);
-
       // 总天数
       let totalDays = buyResult.days + giveResult.days;
 

+ 5 - 1
src/views/create-order/components/order-detail-submodule/SelectOrderDetailCard.vue

@@ -850,7 +850,11 @@ export default {
           days += value;
           text = `${value}日`;
         } else if (textValue.includes('月')) {
-          days += value * 30;
+          if(value === 12) {
+            days += 365;
+          } else {
+            days += value * 30;
+          }
           text = `${value}个月`;
         } else if (textValue.includes('季度')) {
           days += value * 90;