Эх сурвалжийг харах

feat(KIP-6765): KERRY+小程序临停缴费功能未登录身份使用流程

John-Hong 2 жил өмнө
parent
commit
d58a91f77e

+ 2 - 0
src/common/js/BaseDictionary.js

@@ -6,10 +6,12 @@ export const lbsDictionary = {
     qa: {
       groupId: '8a8485497c9cafbc017c9cb90b9d0000',
       mallId: '8a84854a7cfd947d017d02861a9d0002',
+      projectId: 'SKC',
     },
     prod: {
       groupId: '8a8884e77cc9e70a017cca1c77e80004',
       mallId: '8a888aed7d0295e5017d029ff1f40000',
+      projectId: '187',
     },
   },
 };

+ 2 - 2
src/mixins/login.js

@@ -36,7 +36,7 @@ export default {
       }
     },
     checkKipToken(kipAccessToken) {
-      debugger;
+      // debugger;
       return new Promise(async (resolve) => {
         try {
           const resp = await kipCheckToken(kipAccessToken);
@@ -77,7 +77,7 @@ export default {
       });
     },
     toLogin() {
-      debugger;
+      // debugger;
       console.warn('===>清除所有缓存1');
       log.info(`清除所有缓存1`);
       this.cleanAll();

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

@@ -53,8 +53,8 @@ export default {
   },
   methods: {
     getCode() {
-      console.log(56, this.$route);
-      debugger;
+      // console.log(56, this.$route);
+      // debugger;
       const { code = '' } = getUrlParams(); // 截取路径中的code,如果没有就去微信授权,如果已经获取到了就直接传code给后台获取openId
       const local = `${window.location.href}`.replace(/openWx/g, '');
       // return;
@@ -80,15 +80,15 @@ export default {
     },
     async getOpenId(code) {
       try {
-        this.$store.commit('SET_OPENID', 'odJnI0-Y6ZJap-Ow9nmJH-4WyxhU');
+        /*this.$store.commit('SET_OPENID', 'odJnI0-Y6ZJap-Ow9nmJH-4WyxhU');
         // 判断用户是否需要登录,
         await this.checkIsLogin(() => {
           this.$router.replace({
             path: 'home',
           });
-        });
+        });*/
 
-        /*// 通过code获取 openId等用户信息,/api/user/wechat/login 为后台接口
+        // 通过code获取 openId等用户信息,/api/user/wechat/login 为后台接口
         const { appid, secret } = getAppIdByGroupIdAndMallId({
           groupId: this.$route.params.groupId,
           mallId: this.$route.params.mallId,
@@ -113,7 +113,7 @@ export default {
               path: 'home',
             });
           });
-        }*/
+        }
       } catch (err) {
         console.log(106, err);
       }

+ 22 - 7
src/pages/parkingFee/parkingFeeDetail.vue

@@ -273,7 +273,11 @@ import log from '@/utils/log.js';
 import { compare } from '@/utils/location.js';
 import uni from '@/utils/uniHooks';
 import { initWxJsSdkConfig } from '@/utils/login';
-import { getPlatform } from '@/utils/index';
+import {
+  getAppIdByGroupIdAndMallId,
+  getIsWxh5,
+  getPlatform,
+} from '@/utils/index';
 import { Dialog, Toast } from 'vant';
 
 export default {
@@ -601,9 +605,9 @@ export default {
     },
 
     // 创建订单
-    async createParkOrder() {
-      console.log(603);
-      debugger;
+    async createParkOrder({ groupId, mallId, type }) {
+      // console.log(603);
+      // debugger;
       try {
         uni.showLoading({
           title: '加载中',
@@ -617,9 +621,20 @@ export default {
           mobile: this.mobile,
           groupId: this.groupId,
           createuser: 'sys_miniprogram',
-          projectId: uni.getStorageSync('groupId'),
+          // projectId: 'SKC',
           // appId: uni.getStorageSync('appid'),
         };
+        if (getIsWxh5()) {
+          // 如果是微信公众号环境
+          const { projectId } = getAppIdByGroupIdAndMallId({
+            groupId: uni.getStorageSync('groupId'),
+            mallId: uni.getStorageSync('mallId'),
+            type: 'all',
+          });
+          params.projectId = projectId;
+          params.appId = appId;
+        }
+
         this.$md(params);
         const res = await this.$request({
           url: this.$baseURL + 'api/1.0/park/createParkOrderAndCarFee',
@@ -628,8 +643,8 @@ export default {
           header: JSON.parse(uni.getStorageSync('handleUser')),
         });
         uni.hideLoading();
-        console.log(629, res.data);
-        debugger;
+        // console.log(629, res.data);
+        // debugger;
         if (res.data.code === 0) {
           this.bindflag = res.data.data.bind;
           this.parkInfo = res.data.data;

+ 1 - 3
src/utils/index.js

@@ -61,9 +61,7 @@ export function getPlatform() {
   if (/micromessenger/g.test(userAgent)) {
     return 'micromessenger';
   }
-  // TODO: 发布前取消注释
-  // return 'browser';
-  return 'micromessenger';
+  return 'browser';
 }
 
 // 是否在微信小程序中运行