|
@@ -5,7 +5,7 @@ const app = {};
|
|
import { mapState } from 'vuex';
|
|
import { mapState } from 'vuex';
|
|
import fuiToast from '@/components/fui-toast/fui-toast.vue';
|
|
import fuiToast from '@/components/fui-toast/fui-toast.vue';
|
|
import { initWxJsSdkConfig } from '@/utils/login';
|
|
import { initWxJsSdkConfig } from '@/utils/login';
|
|
-import { getPlatform } from '@/utils';
|
|
|
|
|
|
+import { getPlatform, theCommunicationBetweenWechatAndH5IsNormal } from '@/utils';
|
|
import { paperCoupon } from '@/api/parking'
|
|
import { paperCoupon } from '@/api/parking'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
@@ -87,7 +87,7 @@ export default {
|
|
this.$refs.toast.show(options);
|
|
this.$refs.toast.show(options);
|
|
},
|
|
},
|
|
// 扫码
|
|
// 扫码
|
|
- scanCode() {
|
|
|
|
|
|
+ async scanCode() {
|
|
const runScanFn = ( res ) => {
|
|
const runScanFn = ( res ) => {
|
|
if ( res.scanType == 'QR_CODE' && res.scanType ) {
|
|
if ( res.scanType == 'QR_CODE' && res.scanType ) {
|
|
console.log(res.result);
|
|
console.log(res.result);
|
|
@@ -108,6 +108,13 @@ export default {
|
|
// 微信小程序
|
|
// 微信小程序
|
|
const platform = getPlatform();
|
|
const platform = getPlatform();
|
|
if ( platform === 'miniprogram' ) {
|
|
if ( platform === 'miniprogram' ) {
|
|
|
|
+ // 判断微信小程序与 h5 是否正常通信
|
|
|
|
+ const isReload = await theCommunicationBetweenWechatAndH5IsNormal()
|
|
|
|
+ if(!isReload) {
|
|
|
|
+ uni.setStorageSync('isReload', 1)
|
|
|
|
+ window.location.reload()
|
|
|
|
+ return
|
|
|
|
+ }
|
|
window.toWXSendMsg({
|
|
window.toWXSendMsg({
|
|
type: 'scanQRCode',
|
|
type: 'scanQRCode',
|
|
});
|
|
});
|