Переглянути джерело

Merge pull request #315 from John-Hong/release-2.19.0

Release 2.19.0
Tron 1 рік тому
батько
коміт
f241423f2e

+ 75 - 0
src/api/mockData/checkout.pd21.response.json

@@ -0,0 +1,75 @@
+{
+  "parkingRecord": {
+    "vehicleNo": "沪A00001",
+    "enterTime": "2023-10-11 10:54:00",
+    "serviceMin": 20075,
+    "totalFee": 7800,
+    "actualPayFee": 54,
+    "thirdParkOrderNo": "s2023102509290179bb795006",
+    "createdByQrCode": false,
+    "getTime": "2023-10-25 09:29:02",
+    "totalFeeInYuan": 78
+  },
+  "discountInfo": {
+    "usingTotalDiscount": 24,
+    "memberLevelDiscount": false,
+    "consume": [
+      {
+        "defaultSelected": true,
+        "defaultDiscountTime": 2,
+        "discountFee": 24,
+        "redeemSalesAmount": 600,
+        "couponCodes": "rfqkki5ipz8_t#mkp0je6lzqf_t"
+      }
+    ],
+    "points": [
+      {
+        "available": 6300,
+        "pointsPerUnit": 1000,
+        "unitAmount": 12,
+        "totalAvailable": 6300,
+        "unitHour": 1,
+        "newMember": false,
+        "label": "6300积分可减免"
+      }
+    ],
+    "coupons": [
+      {
+        "code": "ovtahbbtisz_t",
+        "couponId": "7c9573c1042d421988d06eff44d2976b",
+        "status": "available",
+        "name": "可叠加优惠券-Allison",
+        "expirationDate": "2023-10-27 23:59:59",
+        "discountFee": 12,
+        "defaultSelected": false,
+        "superposition": "2",
+        "limitCountPerOrder": 5
+      }
+    ],
+    "paperCoupons": [
+      {
+        "description": "纸质优惠券不限制会员使用。"
+      }
+    ]
+  },
+  "parkingRule": {
+    "maxOneTimeDiscountTime": 2,
+    "enableNewMemberPoints": false,
+    "enablePoints": true,
+    "unLimitWeekendPoints": false,
+    "enableCoupon": true,
+    "enablePaperCoupons": true,
+    "enableConsume": true,
+    "enableConsumeNonSplit": false,
+    "remainConsumeTime": 2,
+    "hourPrice": 12,
+    "oneTimeLimitation": true,
+    "oneDayLimitation": false
+  },
+  "parkInfo": {
+    "parkName": "PD",
+    "description": "12元/小时。8-24小时封顶96元。纸质优惠券不限制使用数量。每次最多优惠2小时。积分兑换停车费用1200积分=1小时。积分商城售卖停车电子券的使用类型。单日累计消费满300元赠送1张消费600元赠2张1小时的停车券,不重复发券,消费跨天不累计,",
+    "parkMallCode": 1,
+    "buildingId": "184-100035"
+  }
+}

+ 19 - 2
src/pages/parkingFeeV2/mixins/parkingFeeDiscounts.js

@@ -325,7 +325,8 @@ export default {
         // console.log('323323323', couponCodesLength, remainHour, defaultDiscountTime, this.reduceHours )
         
         // this.reduceHours = this.maxReduceDiscount
-        !isSelected && remainHour - defaultDiscountTime > 0 && (this.reduceHours = 1)
+        !isSelected && remainConsumeTime - remainHour > 0 && defaultDiscountTime && (this.reduceHours = 1)
+        // remainConsumeTime - remainHour > 0 && defaultDiscountTime && (this.reduceHours = 1)
         return
         // 如果超过限制就置灰
         // const maxOneTimeDiscountTimeFee = (couponCodes.split('#').length) * hourPrice
@@ -469,6 +470,13 @@ export default {
             // this.isReduces = false;
             return
           }
+          // 如果还有剩余优惠的话,给一个默认值
+          const {defaultDiscountTime} = this.consume
+          const remainHour = this.remainPrice / hourPrice
+          if(remainConsumeTime - remainHour > 0 && defaultDiscountTime){
+            this.reduceHours = 1
+            this.remainPrice = this.remainPrice + hourPrice
+          } 
           return;
         }
          if (this.parkMallCode !== 4 && this.parkMallCode !== 6) {
@@ -493,7 +501,7 @@ export default {
     },
     // 超限提示
     crossMessage(type) {
-      const { maxOneTimeDiscountTime, hourPrice, oneTimeLimitation, oneDayLimitation, maxOneDayDiscountFee } = this.orderDetail.parkingRule;
+      const { maxOneTimeDiscountTime, hourPrice, oneTimeLimitation, oneDayLimitation, maxOneDayDiscountFee, remainConsumeTime } = this.orderDetail.parkingRule;
       const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice;
       // console.log(373, this.remainPrice, this.availableDiscountFee);
       // 单日上限
@@ -514,6 +522,15 @@ export default {
         // return [true,( maxOneTimeDiscountFee - (this.reduceHours - 1) * hourPrice ) / hourPrice]
         return [true, (this.remainPrice - maxOneTimeDiscountFee) / hourPrice];
       }
+      // 单次上限限制 浦东
+      const remainHour = this.remainPrice / hourPrice
+      if (oneTimeLimitation &&  remainConsumeTime - remainHour < 1) {
+        Toast({
+          message: `超出抵扣上限,每次最高可抵扣${maxOneTimeDiscountTime}小时`,
+          icon: 'none',
+        });
+        return [true, (this.remainPrice - maxOneTimeDiscountFee) / hourPrice];
+      }
       return [false, 0];
     },
     // 验证当前的选项是否可选择

+ 1 - 1
src/store/order/index.js

@@ -1,4 +1,4 @@
-import checkOutQHResponse from "@/api/mockData/checkout.pd17.response.json";
+import checkOutQHResponse from "@/api/mockData/checkout.pd21.response.json";
 import { checkOut,calculateDiscount,ordersAndPrepay,currentUnlicensedPlate,unlicensedCarCheckIn,unlicensedCarCheckout } from '@/api/parking';
 import state from "@/store/order/state";
 import mutations from "@/store/order/mutations";