Explorar o código

扫描离场二维码后,直接进到停车缴费首页,应进入支付的页面

john.hong %!s(int64=2) %!d(string=hai) anos
pai
achega
dbe7f71fe5

+ 25 - 5
src/pages/parkingFee/mixins/parkingFee.js

@@ -131,7 +131,7 @@ export default {
           options: {},
         });
         window.subscribe('projectId', (newOptions) => {
-          console.log(134, newOptions);
+          console.log('用户是扫码进来的134', newOptions);
           this.$store.dispatch('baseInit', {
             options: newOptions,
             callback: () => {
@@ -141,7 +141,7 @@ export default {
                 this.$store.commit('SET_IS_INIT', true);
                 this.$nextTick(() => {
                   console.log(143, newOptions);
-                  // 如果是无牌车的扫码入场
+                  // 如果是无牌车的扫码入场
                   if(options?.options?.type && /unlicensedIn|unlicensedOut/.test(options.options.type)) {
                     this.$store.commit('SET_UNLICENSED_INFO', options.options);
                   }  
@@ -504,6 +504,7 @@ export default {
       this.tabbarActive = name
       if (name === '无牌缴费') {
         this.$store.dispatch('order/unlicensedRule', (code) => {
+
           // CAR_NOT_FOUND 车场扫描道闸入口,发现无车
           if (code === 'CAR_NOT_FOUND') {
 
@@ -580,6 +581,7 @@ export default {
       try {
 
         const qrCodesres = await qrCodes(code); // 无牌车扫码
+        console.log(584, qrCodesres);
         // 记录buildingId,确保 buildingId 是最新的数据
         window.localStorage.setItem('buildingId', qrCodesres.buildingId);
         // 如果是无牌车扫码:出场
@@ -589,8 +591,26 @@ export default {
         });
         // return
         if (this.unlicensedInfo?.type === 'unlicensedOut') {
-          // 查询用户是否存在车牌
-          this.$store.dispatch('order/unlicensedRule', (vehicleNo) => {
+          this.$router.push({
+            path: 'parkingFeeDetail',
+            query: {
+              type: 'success',
+              gateId: qrCodesres.gateId,
+              vehicleNo: '',
+              type: this.unlicensedInfo.type
+            }
+          })
+          // const res = await unlicensedCarCheckout({
+          //   gateId: qrCodesres.gateId
+          // });
+          // console.log(595, res);
+          // return
+          // 查询用户是否存在车牌(出场扫码不查询车牌,直接前往支付页面)
+          /*this.$store.dispatch('order/unlicensedRule', (vehicleNo) => {
+            if(vehicleNo === 'error') {
+
+              return
+            }
             // 出场前,扫码缴费
             this.$router.push({
               path: 'parkingFeeDetail',
@@ -601,7 +621,7 @@ export default {
                 type: this.unlicensedInfo.type
               }
             })
-          });
+          });*/
           return
         }
         // 如果是无牌车扫码:入场

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

@@ -320,6 +320,7 @@ export default {
           gateId: this.$route.query?.gateId,
           endlessLoop: this.endlessLoop,
           callback: (res) => {
+            console.log(323, res);
             // 如果 无牌车扫码出场扫码 无需缴费,直接展示无需缴费页面
             if(/unlicensedOut/.test(res.code) && res?.unlicensed) {
               this.$router.replace({

+ 8 - 7
src/store/order.js

@@ -144,8 +144,7 @@ const actions = {
   async orderInit({ commit, dispatch, state }, { gateId='124p3LK1', vehicleNo = '浙A616A1', callback, endlessLoop }) {
     try {
       dispatch('clearOrderInfo');
-      setTimeout(async () => {
-        const unlicensed = vehicleNo.indexOf('临') > -1; // true: 临时车牌;false:普通车牌
+        const unlicensed = vehicleNo.indexOf('临') > -1 || !vehicleNo; // true: 临时车牌;false:普通车牌
         // const res = await checkOut('浙A616A1');
         // const res = await checkOut('闽AAQ5519', unlicensed);
         // const res = await checkOut('粤A51113');
@@ -165,13 +164,11 @@ const actions = {
         }
         // console.log(vehicleNo, res);
         // 所有的优惠时间长转为金额
-        // console.log(112, '所有的优惠时间长转为金额');
+        console.log(112, '所有的优惠时间长转为金额');
         // dispatch('orderInitRule', checkOutQHResponse);
         dispatch('orderInitRule', res);
-      }, 100)
-      
     } catch (error) {
-      // console.log('151151151151151', error);
+      console.log('151151151151151', error);
       /* if (/NOT_FOUND|PARKING_RECORD_NOT_FOUND/.test(error.code)) {
         callback && callback(error)
       } */
@@ -181,7 +178,9 @@ const actions = {
   orderInitRule({ commit, dispatch, state }, checkOutResponse) {
     console.log(119, checkOutResponse);
     // 记录buildingId
-    window.localStorage.setItem('buildingId', checkOutResponse.parkInfo.buildingId);
+    if (checkOutResponse?.parkInfo?.buildingId) {
+      window.localStorage.setItem('buildingId', checkOutResponse.parkInfo.buildingId);  
+    }
     commit('setOrderDetail', checkOutResponse);
     const isShowDiscounts = checkOutResponse?.parkingRule?.enableCoupon || false;
     // 是否展示优惠
@@ -519,6 +518,8 @@ const actions = {
       // 如果是扫码进入的用户,在出场时需要重新扫码,这时会在此处传入的一个回调函数,在获取到临牌时,返回给 qrCodesRule 函数
       if(res.vehicleNo && callback) {
         callback(res.vehicleNo);
+      } else {
+        callback('error');
       }
     } catch (err) {
       console.log(err);

+ 3 - 2
vue.config.js

@@ -122,8 +122,9 @@ module.exports = {
         },
       },
       '/msApi': {
-        // target: 'http://172.20.50.208:8080',
-        target: 'https://dev-kip-service-internal.kerryonvip.com/temporary-parking-service', //代理地址,这里设置的地址会代替axios中设置的baseURL
+        target: 'http://172.20.248.37:8080',
+        // target: 'http://172.21.202.133:8080',
+        // target: 'https://dev-kip-service-internal.kerryonvip.com/temporary-parking-service', //代理地址,这里设置的地址会代替axios中设置的baseURL
         // target: 'http://172.21.203.140:8080', //代理地址,这里设置的地址会代替axios中设置的baseURL   2023-2-9
         // target: 'http://172.21.203.20:8080', //代理地址,这里设置的地址会代替axios中设置的baseURL
         // target: 'http://172.21.200.89:8080', //代理地址,这里设置的地址会代替axios中设置的baseURL