Ver Fonte

优化无牌车扫码出场时,无需缴费的流程

john.hong há 2 anos atrás
pai
commit
b9abd96d43
2 ficheiros alterados com 29 adições e 1 exclusões
  1. 20 1
      src/pages/parkingFee/mixins/parkingFeeDetail.js
  2. 9 0
      src/store/order.js

+ 20 - 1
src/pages/parkingFee/mixins/parkingFeeDetail.js

@@ -320,7 +320,26 @@ export default {
           gateId: this.$route.query?.gateId,
           endlessLoop: this.endlessLoop,
           callback: (res) => {
-            console.log(303, res);
+            // 如果 无牌车扫码出场扫码 无需缴费,直接展示无需缴费页面
+            if(/unlicensedOut/.test(res.code) && res?.unlicensed) {
+              this.$router.replace({
+                path: 'parkingFeeMsg?type=pay',
+              });
+              return
+            }
+            // 如果是无需缴费的话,提示用户无需缴费
+            if (res?.orderDetail?.parkingRecord?.totalFee <= 0) {
+              this.$store.dispatch('order/orderInitRule', res);
+              uni.showModal({
+                showCancel: false,
+                title: '提示',
+                content: '当前无需缴费',
+                complete: () => {
+                  this.$router.back()
+                },
+              });
+              return
+            }
             if (/NOT_FOUND|PARKING_RECORD_NOT_FOUND/.test(res.code)) {
               // 当前车辆没有查到账单
               this.$router.replace({

+ 9 - 0
src/store/order.js

@@ -152,6 +152,15 @@ const actions = {
       // 场内缴费,调 check-out 接口,
       const method = unlicensed && endlessLoop ? unlicensedCarCheckout : checkOut
       const res = await method(vehicleNo, false, gateId);
+      if ( res?.parkingRecord?.totalFee <= 0) {
+        callback && callback({
+          unlicensed,
+          endlessLoop,
+          code: endlessLoop,
+          orderDetail: res,
+        }); // 统一处理错误原因
+       return
+      }
       // console.log(vehicleNo, res);
       // 所有的优惠时间长转为金额
       // console.log(112, '所有的优惠时间长转为金额');