فهرست منبع

支付时,使用小程序传过来的appid

John-Hong 2 سال پیش
والد
کامیت
fc981342ae
2فایلهای تغییر یافته به همراه8 افزوده شده و 4 حذف شده
  1. 4 2
      src/pages/parkingFee/mixins/parkingFeeDetail.js
  2. 4 2
      src/store/index.js

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

@@ -62,7 +62,8 @@ export default {
       usePointsTime: (state) => state.order.usePointsTime,
       enableConsume: (state) => state.order.enableConsume,
       unitAmount: (state) => state.order.unitAmount,
-      unlicensedInfo: state => state.unlicensedInfo
+      unlicensedInfo: state => state.unlicensedInfo,
+      appId: state => state.appId,
       // checkedTotal: state => state.order.checkedTotal,
     }),
     // 支付按钮状态
@@ -165,8 +166,9 @@ export default {
       let appId = uni.getStorageSync('appid');
       let openId = uni.getStorageSync('openid') || this.openid;
       if (platform === 'miniprogram') {
-        appId = 'wx92c3e55fbef6b2af';
+        // appId = 'wx92c3e55fbef6b2af';
         // appId = 'wxd830fe4d1e04988e';
+        appId = this.appId;
       }
       const params = {
         region: 'cn',

+ 4 - 2
src/store/index.js

@@ -136,7 +136,7 @@ const store = new Vuex.Store({
       state.source = payload;
     },
     SET_APPID(state, payload) {
-      // uni.setStorageSync('appId', payload);
+      uni.setStorageSync('appId', payload);
       state.appId = payload;
     },
     SET_BRAND_INFO(state, payload) {
@@ -191,7 +191,7 @@ const store = new Vuex.Store({
           isLogin = false,
           accessToken = '',
           source = '',
-          appId = '',
+          appId = 'wx92c3e55fbef6b2af',
           // 无牌车逻辑
           unlicensedInfo,
           // CRM
@@ -209,6 +209,8 @@ const store = new Vuex.Store({
         // const resp = await parkingLots();
         // console.log(171171, resp);
         commit('SET_SOURCE', source);
+        commit('SET_APPID', appId);
+        
         // let { groupId, mallId } =
         if (source !== 'CRM') {
           const groupIdAndMallId = getGroupIdAndMallIdByLsbId(lbsId);