Преглед на файлове

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

john преди 2 години
родител
ревизия
edd9405dd1
променени са 2 файла, в които са добавени 17 реда и са изтрити 3 реда
  1. 8 1
      src/pages/parkingFee/mixins/parkingFee.js
  2. 9 2
      src/pages/parkingFee/mixins/parkingFeePaperCoupon.js

+ 8 - 1
src/pages/parkingFee/mixins/parkingFee.js

@@ -4,7 +4,7 @@ import LoginDom from '@/components/Login/Login.vue';
 import { mapState } from 'vuex';
 import { initWxJsSdkConfig } from '@/utils/login';
 import { getPlatform,requestInit } from '@/utils/index';
-import { wxToLoginCallback, getUrlParams } from '@/utils';
+import { wxToLoginCallback, getUrlParams, theCommunicationBetweenWechatAndH5IsNormal } from '@/utils';
 import {getAccessH5} from '@/utils/api-crm-member'
 const app = {
   globalData: {
@@ -617,6 +617,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',
           });

+ 9 - 2
src/pages/parkingFee/mixins/parkingFeePaperCoupon.js

@@ -5,7 +5,7 @@ const app = {};
 import { mapState } from 'vuex';
 import fuiToast from '@/components/fui-toast/fui-toast.vue';
 import { initWxJsSdkConfig } from '@/utils/login';
-import { getPlatform } from '@/utils';
+import { getPlatform, theCommunicationBetweenWechatAndH5IsNormal } from '@/utils';
 import { paperCoupon } from '@/api/parking'
 
 export default {
@@ -87,7 +87,7 @@ export default {
       this.$refs.toast.show(options);
     },
     // 扫码
-    scanCode() {
+   async scanCode() {
       const runScanFn = ( res ) => {
         if ( res.scanType == 'QR_CODE' && res.scanType ) {
           console.log(res.result);
@@ -108,6 +108,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',
         });