john 1 rok pred
rodič
commit
7ec44e5fa5

+ 1 - 1
src/App.vue

@@ -142,7 +142,7 @@ export default {
       }
       uni.setStorageSync('env', window.env);
       // 如果是支付宝小程序:初始化
-      if (isAlipayClient) {
+      if (this.isAlipayClient) {
         setToken()
         localStorageInit();
         windowSendInit()

+ 2 - 1
src/api/request.js

@@ -1,3 +1,4 @@
+import Vue from 'vue'
 import uni from '@/utils/uniHooks';
 import { getUTMSource } from '@/utils/utils';
 import axios, { AxiosInstance, AxiosRequestConfig } from 'axios';
@@ -87,7 +88,7 @@ function XUser(config) {
     userId: store.state?.kipUserId || '', // K+用户ID
     // userId: '2c9d85868652dee50186532bdbbb0001', // K+用户ID
     // sourceType: 'WECHAT',
-    sourceType: isAlipayClient ? 'ALIPAY' : 'WECHAT',
+    sourceType: Vue.prototype.isAlipayClient ? 'ALIPAY' : 'WECHAT',
     // phoneNumber: '18521563898',
     phoneNumber: store.state?.mobile || '', // 终端用户ID, 微信端传openId, 支付宝小程序传阿里userId, APP传KIP的userId
     // projectId: store.state.projectId || '4028e3817c2b3f79017c2b48c54c0000', // 楼盘id

+ 1 - 1
src/components/wx-points-auth/wx-points-auth.vue

@@ -198,7 +198,7 @@ export default {
                  "url": "/pages/accumulatePoints/selfServicePoints?redirect=1&backUrl=pages/package-parkingFee/parkingFeeWebView" // 去 login 页面 1 去登录
                 })
             }
-            if (isAlipayClient) {
+            if (this.isAlipayClient) {
                 my?.navigateTo({
                     "url": "/pages/accumulatePoints/selfServicePoints?redirect=1" // 去 login 页面 1 去登录
                 })

+ 1 - 0
src/main.js

@@ -62,6 +62,7 @@ window.wx = wx;
 Vue.prototype.$wx = window.wx;
 Vue.prototype.$store = store;
 Vue.prototype.$request = request;
+Vue.prototype.isAlipayClient = window.isAlipayClient;
 //
 Vue.config.productionTip = false;
 App.mpType = 'app';

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

@@ -61,7 +61,7 @@ export default {
       supportUnlicensed: false, // 控制当前site,是否使用无牌车
       qrCodeHistory: '',
       currentTabType: this.carType,
-      isAlipayClient: isAlipayClient,
+      // isAlipayClient: isAlipayClient,
       licensePlateList: [],
       // custTypeId: 0,
       // 2.19新增内容

+ 2 - 2
src/pages/parkingFee/mixins/parkingFeeDetail.js

@@ -184,7 +184,7 @@ export default {
     },
     // 前往支付
     async toPay() {
-      if (!isAlipayClient) {
+      if (!this.isAlipayClient) {
         // 判断微信小程序与 h5 是否正常通信
         const isReload = await theCommunicationBetweenWechatAndH5IsNormal()
         if(!isReload) {
@@ -520,7 +520,7 @@ export default {
                 options: options,
               });
               window.subscribe('wxPayOver', (options) => {
-                if(isAlipayClient) {
+                if(this.isAlipayClient) {
                   options.wxPayOver = options.options.wxPayOver 
                 }
                 // this.Toastloading.clear();

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

@@ -89,7 +89,7 @@ export default {
     // 扫码
    async scanCode() {
       const runScanFn = ( res ) => {
-        if ( res.scanType == 'QR_CODE' && res.scanType || (isAlipayClient && res.scanType == 'QR')) {
+        if ( res.scanType == 'QR_CODE' && res.scanType || (this.isAlipayClient && res.scanType == 'QR')) {
           console.log(res.result);
           const url = res.result;
           if ( url.indexOf('auth/') === -1 ) {
@@ -120,7 +120,7 @@ export default {
         });
         window.subscribe('scanQRCodeOver',( options ) => {
           console.log('微信扫码结束之后的返回参数',options);
-          runScanFn(isAlipayClient ? options.options : options);
+          runScanFn(this.isAlipayClient ? options.options : options);
         });
       } else {
         this.$wx.scanQRCode({

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

@@ -86,7 +86,7 @@ export default {
       this.getKipMemberVehicles();
     } else {
       wxToLoginCallback('vehicleManagement', (options) => {
-        if (isAlipayClient && options?.options?.noLoginParkingFeeWebView === 'fail' || options?.noLoginParkingFeeWebView === 'fail') {
+        if (this.isAlipayClient && options?.options?.noLoginParkingFeeWebView === 'fail' || options?.noLoginParkingFeeWebView === 'fail') {
           // 如果是用户明确拒绝登录,执行这段逻辑
           setTimeout(() => {
             Toast({

+ 3 - 3
src/pages/parkingFeeV2/mixins/parkingFee.js

@@ -54,7 +54,7 @@ export default {
       tabbarActive: 'manualPayment',
       supportUnlicensed: false, // 控制当前site,是否使用无牌车
       qrCodeHistory: '',
-      isAlipayClient: isAlipayClient,
+      // isAlipayClient: isAlipayClient,
       // custTypeId: 0,
       // 2.19新增内容
       eligibility: {}, // 
@@ -172,7 +172,7 @@ export default {
     }
     try {
       const href = window.location.href;
-      if (!isAlipayClient && !/808[0-9]/.test(href)) {
+      if (!this.isAlipayClient && !/808[0-9]/.test(href)) {
         setTimeout(async () => {
           await initWxJsSdkConfig(['checkJsApi', 'scanQRCode']);
         }, 1500)
@@ -807,7 +807,7 @@ export default {
         };
         // 微信小程序
         // const platform = getPlatform();
-        if (isAlipayClient) {
+        if (this.isAlipayClient) {
           // 判断微信小程序与 h5 是否正常通信
           // const isReload = await theCommunicationBetweenWechatAndH5IsNormal()
           // if(!isReload) {

+ 3 - 3
src/pages/parkingFeeV2/mixins/parkingFeePaperCoupon.js

@@ -57,7 +57,7 @@ export default {
     try {
       const href = window.location.href;
       console.log('初始化扫码1');
-      if(!isAlipayClient && !/808[0-9]/.test(href)) {
+      if(!this.isAlipayClient && !/808[0-9]/.test(href)) {
         setTimeout(async () => {
           console.log('初始化扫码2');
           await initWxJsSdkConfig(['checkJsApi', 'scanQRCode']);
@@ -107,7 +107,7 @@ export default {
     // this.getPaperCouponInfo(test.result);
     // return
       const runScanFn = ( res ) => {
-        if ( res.scanType == 'QR_CODE' && res.scanType || (isAlipayClient && res.scanType == 'QR')) {
+        if ( res.scanType == 'QR_CODE' && res.scanType || (this.isAlipayClient && res.scanType == 'QR')) {
           console.log(res.result);
           const url = res.result;
           if ( url.indexOf('auth/') === -1 ) {
@@ -126,7 +126,7 @@ export default {
       // 支付宝小程序
       // const platform = getPlatform();
       // console.log(110);
-      if ( isAlipayClient ) {
+      if ( this.isAlipayClient ) {
         window.toWXSendMsg({
           type: 'scanQRCode',
         });

+ 2 - 2
src/pages/parkingFeeV2/mixins/parkingFindCarFirst.js

@@ -54,7 +54,7 @@ export default {
       tabbarActive: 'manualPayment',
       supportUnlicensed: false, // 控制当前site,是否使用无牌车
       qrCodeHistory: '',
-      isAlipayClient: isAlipayClient,
+      // isAlipayClient: isAlipayClient,
       // custTypeId: 0,
       // 2.19新增内容
       eligibility: {}, // 
@@ -760,7 +760,7 @@ export default {
         };
         // 微信小程序
         // const platform = getPlatform();
-        if (isAlipayClient) {
+        if (this.isAlipayClient) {
           // 判断微信小程序与 h5 是否正常通信
           // const isReload = await theCommunicationBetweenWechatAndH5IsNormal()
           // if(!isReload) {

+ 1 - 1
src/pages/parkingFeeV2/parkingFeeMsg.vue

@@ -141,7 +141,7 @@ export default {
       };
       // 微信小程序
       // const platform = getPlatform();
-      if (isAlipayClient) {
+      if (this.isAlipayClient) {
         // 判断微信小程序与 h5 是否正常通信
         // const isReload = await theCommunicationBetweenWechatAndH5IsNormal()
         // if(!isReload) {

+ 5 - 4
src/utils/index.js

@@ -7,6 +7,7 @@ import { lbsDictionary } from '@/common/js/BaseDictionary';
 import uni from './uniHooks';
 import {Dialog} from "vant";
 import kipTheme from "@/kui/theme/theme";
+import Vue from 'vue';
 
 export function getMobileOperatingSystem() {
   // #ifdef H5
@@ -162,7 +163,7 @@ export function wxToLoginCallback( path,callback ) {
     });
     window.subscribe('callback',( options ) => {
       // console.log('登录页面的回调',JSON.stringify(options));
-      if ( options.isReload || isAlipayClient && options?.options?.isReload) {
+      if ( options.isReload || Vue.prototype.isAlipayClient && options?.options?.isReload) {
         // console.log('刷新页面');
         window.location.reload();
       } else {
@@ -269,7 +270,7 @@ export function getUrl() {
 export function windowSendInit() {
   const token = window.token;
   window.toWXSendMsg = function ( {type = '',funcName = '',options = {}} ) {
-    if(isAlipayClient) {
+    if(Vue.prototype.isAlipayClient) {
       my.postMessage({
         name:'h5',
         body: {
@@ -306,7 +307,7 @@ export function windowSendInit() {
 
   // 主动订阅事件回调
   window.subscribe = function ( type,callback ) {
-    if(isAlipayClient) {
+    if(Vue.prototype.isAlipayClient) {
       my.onMessage = function (response) {
         console.log('293my.onMessage', response)
         callback(response.body.data);
@@ -410,7 +411,7 @@ export function backLbsHome() {
             url: source === 'KIP' ? '/pages/tabbar/home/home' : "/pages/package-parkingFee/parkingFeeWebViewLogin?needLogin=1"  // 去 login 页面
           })
         }
-        if (isAlipayClient) {
+        if (Vue.prototype.isAlipayClient) {
           my?.reLaunch({
             url: "/pages/package-parkingFee/parkingFeeWebViewLogin?needLogin=1" // 去 login 页面 1 去登录
           })