Răsfoiți Sursa

支付宝兼容

john 2 ani în urmă
părinte
comite
a945f6f0c1
3 a modificat fișierele cu 34 adăugiri și 16 ștergeri
  1. 11 0
      src/App.vue
  2. 3 8
      src/store/index.js
  3. 20 8
      src/utils/index.js

+ 11 - 0
src/App.vue

@@ -1,5 +1,6 @@
 <template>
   <div>
+    <div v-if="source === 'ALIPAY'" class="back" @click="$router.back()">返回</div>
     <keep-alive v-if="isInit" :include="cachedViews" :max="15">
       <router-view :key="key" />
     </keep-alive>
@@ -51,6 +52,9 @@ export default {
     isInit() {
       return this.$store.state.isInit;
     },
+    source() {
+      return this.$store.state.source;
+    },
   },
   watch: {
     cachedViews() {
@@ -203,4 +207,11 @@ body {
   padding: 0;
   margin: 0;
 }
+
+.back {
+  position: fixed;
+  top: 20px;
+  left: 20px;
+  z-index: 99999999;
+}
 </style>

+ 3 - 8
src/store/index.js

@@ -216,7 +216,7 @@ const store = new Vuex.Store({
         commit('SET_APPID',appId);
 
         // let { groupId, mallId } =
-        if (!/CRM|PUDONG|JINGAN/.test(source)) {
+        if (!/CRM|PUDONG|JINGAN|ALIPAY/.test(source)) {
           const groupIdAndMallId = getGroupIdAndMallIdByLsbId(lbsId);
           groupId = groupIdAndMallId.groupId;
           mallId = groupIdAndMallId.mallId;
@@ -257,7 +257,7 @@ const store = new Vuex.Store({
           commit('SET_KIP_USER_ID',kipUserId);
           commit('SET_MOBILE',mobile);
           dispatch('getUserDetail');
-          const memberRes = await getVIPIntegral()
+          // const memberRes = await getVIPIntegral()
           // const memberRes = await crmQueryMemberInfo({
           //   groupId,
           //   kipUserId,
@@ -268,12 +268,6 @@ const store = new Vuex.Store({
             type: 'getProjectId',
             options: {},
           });
-          const marketListRes = await kipAllCities();
-          if ( memberRes) {
-            dispatch('getUserDetail');
-            commit('SET_MEMBER',memberRes);
-          }
-          // console.log(929292, marketListRes);
         }
         callback && callback();
       } catch ( e ) {
@@ -284,6 +278,7 @@ const store = new Vuex.Store({
     async getUserDetail( {commit} ) {
       const res = await kipGetUserDetail();
       commit('SET_USER_INFO',res.data);
+      commit('SET_MEMBER',res.data);
       // console.log('user_info', res);
     },
     clearUnlicensed( {state,commit} ) {

+ 20 - 8
src/utils/index.js

@@ -173,14 +173,14 @@ export function initEnv() {
   const href = window.location.href;
   console.log('当前页面的url地址  ',href);
   if ( /dev-|8080/.test(href) ) {
-    window.env = 'qa';
-    window.profileApi = 'https://qa-apim.kerryplus.com/c/api';
-    window.cmrApi = 'https://qa-crm.kerryplus.com/xcrm-api/api';
-    window.api = 'qaApi';
-    // window.env = 'dev';
-    // window.profileApi = 'https://dev-gateway-kip.kerryonvip.com/api';
-    // window.cmrApi = 'https://dev-crm.kerryplus.com/xcrm-api/api';
-    // window.api = 'devApi';
+    // window.env = 'qa';
+    // window.profileApi = 'https://qa-apim.kerryplus.com/c/api';
+    // window.cmrApi = 'https://qa-crm.kerryplus.com/xcrm-api/api';
+    // window.api = 'qaApi';
+    window.env = 'dev';
+    window.profileApi = 'https://dev-gateway-kip.kerryonvip.com/api';
+    window.cmrApi = 'https://dev-crm.kerryplus.com/xcrm-api/api';
+    window.api = 'devApi';
     // window.env = 'prod';
     // window.profileApi = 'https://sl-apim.kerryplus.com/c/api';
     // window.cmrApi = 'https://sl-crm.kerryplus.com/xcrm-api/api';
@@ -242,6 +242,18 @@ export function windowSendInit() {
     /**
      * 向小程序端发送消息
      */
+    /* 支付宝相关 */
+    const source = uni.getStorageSync('source')
+    console.log(247, funcName);
+    // if(funcName === 'setNavigationBarColor' || funcName === "setNavigationBarTitle") return false
+    if (source === 'ALIPAY') {
+      // 针对特定程序进行处理
+      if(type ==='uni_func' && funcName === 'setNavigationBarColor' ) {
+        // return
+        // delete options.frontColor
+        funcName = 'setNavigationBar'
+      }
+    }
     if ( !type ) return;
     window.stompClient.send(
       '/sendToWechat',