Przeglądaj źródła

fix(SCRM-4320): [DE][C端]临时停车,扫描纸质优惠券以后,缴费页面会直接刷新

john 2 lat temu
rodzic
commit
a7dde74d8e

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

@@ -154,6 +154,7 @@ export default {
       if(!isReload) {
         uni.setStorageSync('isReload', 1)
         window.location.reload()
+        return
       }
       if (this.btnLoading) return
       this.btnLoading = true

+ 9 - 2
src/pages/parkingFee/parkingFeeMsg.vue

@@ -59,7 +59,7 @@ import { qrCodes,unlicensedCarCheckIn } from "@/api/parking";
 import baseMixins from "@/pages/parkingFee/mixins/base";
 import uni from '@/utils/uniHooks';
 import { initWxJsSdkConfig } from '@/utils/login';
-import { getPlatform,getUrlParams } from '@/utils';
+import { getPlatform,getUrlParams, theCommunicationBetweenWechatAndH5IsNormal } from '@/utils';
 import {mapState} from "vuex";
 
 export default {
@@ -101,7 +101,7 @@ export default {
       this.$store.commit('SET_UNLICENSED_INFO', {});
     },
     // 无牌车闸机扫码
-    scanCarCode() {
+    async scanCarCode() {
       const runScanFn = (res) => {
         /*
          针对微信的小程序码进行的兼容改造
@@ -130,6 +130,13 @@ export default {
       // 微信小程序
       const platform = getPlatform();
       if (platform === 'miniprogram') {
+        // 判断微信小程序与 h5 是否正常通信
+        const isReload = await theCommunicationBetweenWechatAndH5IsNormal()
+        if(!isReload) {
+          uni.setStorageSync('isReload', 1)
+          window.location.reload()
+          return
+        }
         window.toWXSendMsg({
           type: 'scanQRCode',
         });