Jelajahi Sumber

fix(KIP-19428): 提交优惠金额时,区分积分的计算规则

john 9 bulan lalu
induk
melakukan
e0a4183623
1 mengubah file dengan 5 tambahan dan 3 penghapusan
  1. 5 3
      src/pages/mixins/parkingFeeDetail.js

+ 5 - 3
src/pages/mixins/parkingFeeDetail.js

@@ -263,7 +263,8 @@ export default {
       }, 10000)
       const { parkingRecord, discountInfo = {}, parkingRule = {}, parkInfo = {}} = this.orderDetail;
       const { coupons = [], points = [], memberGrade = [], paperCoupons = [], consume = [], newMemberPoints= {} } = discountInfo
-      const { hourPrice } = parkingRule
+      const { hourPrice } = parkingRule;
+      const isAmount = [5, 8, 10].indexOf(this.parkMallCode) > -1;  // 积分兑换规则是否以 兑换值(元)为主;
       /* 校验 */
       let usingTotalDiscount = 0;
       let parkDiscount = 0;
@@ -335,10 +336,11 @@ export default {
         if (points?.length && points[0].discountFee > 0) {
           // 15 兑换 5元
           const { pointsPerUnit, unitAmount, discountFee, available } = points[0]
+          
           params.discountInfo.points = {
-            "discountTime": discountFee / hourPrice * 60,
+            "discountTime":   discountFee / (isAmount ? unitAmount : hourPrice) * 60,
             "discountFee": discountFee,
-            "discountPoints": discountFee / hourPrice * pointsPerUnit
+            "discountPoints": discountFee / (isAmount ? unitAmount : hourPrice) * pointsPerUnit
           }
           usingTotalDiscount = usingTotalDiscount + discountFee
         }