فهرست منبع

feat(KIP-6765): 验证支付环节

John-Hong 2 سال پیش
والد
کامیت
42f8b0f21b

+ 5 - 0
src/App.vue

@@ -303,9 +303,14 @@ export default {
           this.$store.commit('SET_OPENID', openid);
           // 用户选择不登录
           if (this.isLogin !== '3') {
+            this.isInit = false;
             // 判断用户是否需要登录
             this.checkIsLogin(() => {
+              this.isInit = true;
               // window.location.reload();
+              this.$store.dispatch('getUserDetail');
+              this.$store.commit('SET_MEMBER', uni.getStorageSync('member'));
+              uni.getStorageSync();
             });
           }
         } else {

+ 6 - 4
src/pages/login/openWx.vue

@@ -75,19 +75,21 @@ export default {
           // `&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirect`;
           `&response_type=code&scope=snsapi_base&state=1#wechat_redirect`;
       } else {
+        console.log(78, code);
         this.getOpenId(code); //把code传给后台获取用户信息
       }
     },
     async getOpenId(code) {
       try {
-        /*this.$store.commit('SET_OPENID', 'odJnI0-Y6ZJap-Ow9nmJH-4WyxhU');
+        // this.$store.commit('SET_OPENID', 'odJnI0-Y6ZJap-Ow9nmJH-4WyxhU');
+        this.$store.commit('SET_OPENID', 'oEDin6CwQMev3iRu74IAsE4mYYwo'); // 参数公众号
         // 判断用户是否需要登录,
         await this.checkIsLogin(() => {
           this.$router.replace({
             path: 'home',
           });
-        });*/
-
+        });
+        /*
         // 通过code获取 openId等用户信息,/api/user/wechat/login 为后台接口
         const { appid, secret } = getAppIdByGroupIdAndMallId({
           groupId: this.$route.params.groupId,
@@ -113,7 +115,7 @@ export default {
               path: 'home',
             });
           });
-        }
+        }*/
       } catch (err) {
         console.log(106, err);
       }

+ 4 - 3
src/pages/parkingFee/parkingFeeDetail.vue

@@ -487,6 +487,7 @@ export default {
     this.orderno = option.orderno;
     this.id = option.id;
     this.init();
+    // debugger;
     this.createParkOrder();
     console.log('created', this.parkInfo);
     // if (uni.getStorageSync('isReload') === '3') {
@@ -502,7 +503,7 @@ export default {
     console.log('activated', uni.getStorageSync('isReload'));
     const platform = getPlatform();
     if (platform === 'micromessenger') {
-      await initWxJsSdkConfig(['chooseWXPay', 'scanQRCode']);
+      // await initWxJsSdkConfig(['chooseWXPay', 'scanQRCode']);
       try {
         // if (window.wxJsSdkConfigInitPromise) {
         //   // console.log(window.wxJsSdkConfigInitPromise);
@@ -605,7 +606,7 @@ export default {
     },
 
     // 创建订单
-    async createParkOrder({ groupId, mallId, type }) {
+    async createParkOrder() {
       // console.log(603);
       // debugger;
       try {
@@ -626,7 +627,7 @@ export default {
         };
         if (getIsWxh5()) {
           // 如果是微信公众号环境
-          const { projectId } = getAppIdByGroupIdAndMallId({
+          const { projectId, appId } = getAppIdByGroupIdAndMallId({
             groupId: uni.getStorageSync('groupId'),
             mallId: uni.getStorageSync('mallId'),
             type: 'all',

+ 1 - 0
src/pages/parkingFee/vehicleManagement.vue

@@ -450,6 +450,7 @@ export default {
     },
     // 获取会员绑定的车牌列表
     getKipMemberVehicles() {
+      console.log(453);
       uni.showLoading({
         title: '加载中',
       });

+ 1 - 0
src/routes/index.js

@@ -173,6 +173,7 @@ const otherTparkingRoutes = routes.map((item) => {
 
 const router = new VueRouter({
   mode: 'history',
+  base: '/tparking/',
   routes: [
     ...routes,
     ...wxRoutes,

+ 3 - 2
src/utils/uniHooks.js

@@ -3,7 +3,7 @@ import qs from 'qs';
 import _ from 'lodash';
 import { Encrypt, Decrypt } from './crypto';
 import { Toast } from 'vant';
-
+let ToastObj = null;
 function getStorageSync(key) {
   const value = window.localStorage.getItem(key);
   if (value && value.indexOf('"') === 0) {
@@ -36,7 +36,7 @@ function showLoading(
       forbidClick: true,
     };
   }
-  Toast.loading(params);
+  ToastObj = Toast.loading(params);
   // console.log('showLoading');
   // // window.toWXSendMsg({
   // //   type: 'showLoading',
@@ -49,6 +49,7 @@ function showModal() {
 }
 
 function hideLoading() {
+  ToastObj.clear();
   console.log('hideLoading');
   // window.toWXSendMsg({
   //   type: 'hideLoading',