Bläddra i källkod

feat(KIP-7543): H5临时停车|前端 | 杭州K+ H5临时停车露出

John-Hong 2 år sedan
förälder
incheckning
dc8ab092a0

+ 48 - 29
src/common/js/BaseDictionary.js

@@ -1,35 +1,54 @@
 // lbs 对照表,不区分环境
+const testAppIdInfo = {
+  // 嘉里中国项目管理上海测试公众号
+  appid: 'wxb81a622ed6d60adf',
+};
+
+const SKC = {
+  qa: {
+    ...testAppIdInfo,
+    groupId: '8a8485497c9cafbc017c9cb90b9d0000',
+    mallId: '8a84854a7cfd947d017d02861a9d0002',
+    projectId: 'SKC',
+  },
+  prod: {
+    // TODO: 等待对应公众号上线
+    ...testAppIdInfo,
+    groupId: '8a8884e77cc9e70a017cca1c77e80004',
+    mallId: '8a888aed7d0295e5017d029ff1f40000',
+    projectId: '187',
+  },
+};
+
+const HKC = {
+  qa: {
+    ...testAppIdInfo,
+    groupId: '8a84853b7c91ac5b017c962dab55030e',
+    mallId: '8a84853b7c91ac5b017c961a9b2a030d',
+    projectId: 'HKC',
+  },
+  prod: {
+    // TODO: 等待对应公众号上线
+    ...testAppIdInfo,
+    groupId: '8a8884e77cc9e70a017cca1011970001',
+    mallId: '8a8883557cca9463017ccb002b360001',
+    projectId: '186',
+  },
+};
 export const lbsDictionary = {
   '8a84854a7cfd947d017d0289266a0003': {
-    // prod专用环境
-    // appid: 'wx907c27f16841a919',
-    // secret: 'd9c81d6c47f7de322a2ff85847de6728',
-    // 嘉里中国项目管理上海测试公众号
-    appid: 'wxb81a622ed6d60adf',
-    secret: 'd55a10817ee2c638f278b709358dc22a',
-    qa: {
-      groupId: '8a8485497c9cafbc017c9cb90b9d0000',
-      mallId: '8a84854a7cfd947d017d02861a9d0002',
-      projectId: 'SKC',
-    },
-    prod: {
-      groupId: '8a8884e77cc9e70a017cca1c77e80004',
-      mallId: '8a888aed7d0295e5017d029ff1f40000',
-      projectId: '187',
-    },
+    ...SKC,
   },
   "8a8883607d029a46017d02a2be880000": {
-    appid: 'wxb81a622ed6d60adf',
-    secret: 'd55a10817ee2c638f278b709358dc22a',
-    qa: {
-      groupId: '8a8485497c9cafbc017c9cb90b9d0000',
-      mallId: '8a84854a7cfd947d017d02861a9d0002',
-      projectId: 'SKC',
-    },
-    prod: {
-      groupId: '8a8884e77cc9e70a017cca1c77e80004',
-      mallId: '8a888aed7d0295e5017d029ff1f40000',
-      projectId: '187',
-    },
-  }
+    ...SKC,
+  },
+  '8a84853b7c91ac5b017c96bc8eab0310': {
+    ...HKC,
+  },
+  '8a8883557cca9463017ccaedb04f0000': {
+    ...HKC,
+  },
 };
+
+
+

+ 0 - 16
src/components/plate-number/plateNumber.vue

@@ -416,15 +416,12 @@ export default {
   },
   watch: {
     ind(val) {
-      console.log(420420, 'carnoIndex', val);
       this.carnoIndex = val;
     },
     active(val) {
-      console.log(420420, 'activeIndex', val);
       this.activeIndex = val;
     },
     numArr(val) {
-      console.log(420420, 'carnoArr', val);
       this.carnoArr = val;
     },
   },
@@ -469,13 +466,6 @@ export default {
     },
     // 选择车牌号后面的数字和字母
     checkEnglish_num(index) {
-      console.log(467, index);
-      console.log(468, {
-        numArr: this.carnoArr,
-        active: this.activeIndex,
-        ind: this.carnoIndex,
-      });
-      // return;
       // 点击删除键
       if (this.English_Number[index].id == 99) {
         this.carnoArr[this.carnoIndex] = '';
@@ -518,29 +508,23 @@ export default {
       });
     },
     openKeyboardCN() {
-      // this.$refs["chinese_popup"].open();
-      console.log(521, '打开属性面板', this.init);
       this.closeKeyboardEN();
       this.chinese_popup = true;
       this.allBoard_popup = false;
     },
     closeKeyboardCN() {
       this.chinese_popup = false;
-      // this.$refs["chinese_popup"].close();
     },
     openKeyboardEN() {
       this.openKeyboardCN();
       this.allBoard_popup = true;
       this.chinese_popup = false;
-      // this.$refs["allBoard_popup"].open();
     },
     closeKeyboardEN() {
       this.allBoard_popup = false;
-      // this.$refs["allBoard_popup"].close();
     },
     // 关闭虚拟键盘
     close_keyboard() {
-      console.log(526);
       this.activeIndex = null;
       this.closeKeyboardCN();
       this.closeKeyboardEN();

+ 1 - 1
src/manifest.json

@@ -2,7 +2,7 @@
     "name" : "嘉里集团",
     "appid" : "__UNI__14A40A0",
     "description" : "",
-    "versionName" : "1.31.0",
+    "versionName" : "2.0.0",
     "versionCode" : "100",
     "transformPx" : false,
     "app-plus" : {

+ 19 - 53
src/pages/parkingFee/parkingFee.vue

@@ -1,6 +1,5 @@
 <template>
   <div style="background-color: #f4f7ff">
-    <!--    <LoginDom></LoginDom>-->
     <scroll-view class="wrap-box">
       <div class="parkingFee" ref="parkingFee">
         <div class="parkingFee-top bg">
@@ -214,15 +213,10 @@
 </template>
 
 <script>
-// import authorize from '../../components/authorize/authorize.vue';
 import plateNumber from '../../components/plate-number/plateNumber.vue';
 import { REG_SOURCE } from '@/constants';
 import LoginDom from '@/components/Login/Login.vue';
 import { mapState } from 'vuex';
-import MemberCacheTool from '../../utils/member-cache-tool.js';
-import { Decrypt, Encrypt } from '@/utils/crypto.js';
-// import ws from '@/utils/websocket';
-// const app = getApp()
 const app = {
   globalData: {
     regSource: '',
@@ -232,7 +226,6 @@ import uni from '../../utils/uniHooks';
 
 export default {
   components: {
-    // authorize,
     plateNumber,
     LoginDom,
   },
@@ -277,24 +270,8 @@ export default {
       member: (state) => state.member,
       mobile: (state) => state.mobile,
     }),
-    /* groupId: (state) => state.groupId,
-      openid: (state) => state.openid,
-      mallId: (state) => state.mallId,
-      kipUserId: (state) => state.kipUserId,
-      userInfo: (state) => state.userInfo,
-      member: (state) => state.member, */
   },
-  // beforeRouteLeave(to, from, next) {
-  //   // 设置下一个路由的 meta
-  //   to.meta.keepAlive = false; // 让 A 缓存,即不刷新
-  //   next();
-  // },
   beforeRouteLeave(to, from, next) {
-    // 设置下一个路由的 meta
-    // if (/index|home/.test(to.name)) {
-    //   // 不在缓存列表中,从cachedViews缓存列表中移除
-    //   this.$store.commit('cachedViews/DEL_CACHED_VIEW', from);
-    // }
     this.$store.commit('cachedViews/DEL_CACHED_VIEW', to);
     next();
   },
@@ -316,10 +293,7 @@ export default {
         title: '停车缴费',
       });
     }, 300);
-    // console.log(286, this.openid);
-    // this.getParkInfo();
     if (this.openid) {
-      // this.openId = this.openid;
       this.getParkInfo();
       this.showSq = false;
     } else {
@@ -331,14 +305,6 @@ export default {
       if (this.options?.tpName) {
         app.globalData.tpName = this.options?.tpName;
       }
-      /*this.$refs.authorize.login('/pages/parkingFee/parkingFee', () => {
-        const openId =
-          uni.getStorageSync('openId') ||
-          uni.getStorageSync('member').openid ||
-          app.globalData.openId;
-        _this.openId = openId;
-        _this.getParkInfo();
-      });*/
       this.showSq = true;
     }
   },
@@ -362,15 +328,15 @@ export default {
         // app.globalData.isNewMember = '';
         // 场景二维码记录(是否扫码进入)
         // app.globalData.paramsScene = {};
-        ths.$saveSceneQrcodeDetail(
-          'page',
-          'parkingFee',
-          '停车缴费',
-          '',
-          '',
-          '',
-          ''
-        );
+        // this.$saveSceneQrcodeDetail(
+        //   'page',
+        //   'parkingFee',
+        //   '停车缴费',
+        //   '',
+        //   '',
+        //   '',
+        //   ''
+        // );
       }
       // 埋点本地化
       this.preUrl = uni.getStorageSync('previousUrl');
@@ -426,11 +392,9 @@ export default {
         header: JSON.parse(uni.getStorageSync('handleUser')),
       })
         .then((res) => {
-          uni.hideLoading();
           if (res.data.code === 0) {
             const data = res.data.data || {};
             this.carList = data.carList;
-            // this.carList = ['辽A98G89', '沪A98GHJ', '陕A98GHJ0', '沪A98GHJ0', '陕A98GHJ', '辽A98G89'];
             this.parkInfoEntity = data.parkInfoEntity;
             this.hourMoney =
               parseFloat(this.parkInfoEntity.needmoney) /
@@ -449,7 +413,6 @@ export default {
           }
         })
         .catch((err) => {
-          uni.hideLoading();
           uni.showToast({
             title: '网络超时请稍后再试',
             duration: 2000,
@@ -544,10 +507,6 @@ export default {
     // 查询车费信息
     handleSearch(carno, clickEvent = '$ClickQueryAndPayment') {
       this.vehicleNumber = carno;
-      uni.showLoading({
-        title: '加载中',
-      });
-
       const params = {
         carno,
         mallid: this.mallId,
@@ -581,11 +540,16 @@ export default {
         data: params,
         method: 'POST',
         header: JSON.parse(uni.getStorageSync('handleUser')),
-        timeout: 10000,
+        timeout: 60000 * 2, // 120S
+        showLoading: {
+          title: '加载中',
+          duration: 0,
+        },
       })
         .then((res) => {
           // console.log(555555, res);
-          uni.hideLoading();
+          // ToastObj.clear();
+          // uni.hideLoading();
           if (res.data.code === 0) {
             // 清理旧数据
             this.parkingFeeDetailInit();
@@ -635,7 +599,7 @@ export default {
           });
         })
         .catch((err) => {
-          uni.hideLoading();
+          // uni.hideLoading();
           uni.showToast({
             title: '网络超时请稍后再试',
             duration: 2000,
@@ -795,6 +759,7 @@ page {
   flex-direction: column;
   width: 100%;
   font-size: 14px;
+
   .parkingFee {
     display: flex;
     flex-direction: column;
@@ -1187,6 +1152,7 @@ page {
 
       .info {
         // padding-left: 18px;
+        white-space: break-spaces;
         font-size: 30px;
         width: 100%;
         color: #999999;

+ 5 - 5
src/utils/index.js

@@ -84,21 +84,21 @@ export function getAppIdByGroupIdAndMallId({ groupId, mallId, type }) {
   }
   if (platform === 'micromessenger') {
     // 后期在其他公众号上线H5应用,appid需要根据地址栏的 project 动态处理, 已预留入口
-    console.log(89);
+    // console.log(89);
     const env = window.env === 'qa' ? 'qa' : 'prod';
     let appInfo = {};
     Object.keys(lbsDictionary).forEach((lbsId) => {
       const elm = lbsDictionary[lbsId];
-      console.log(92, env, elm[env].groupId, groupId, elm[env].mallId, mallId);
+      // console.log(92, env, elm[env].groupId, groupId, elm[env].mallId, mallId);
       if (elm[env].groupId === groupId && elm[env].mallId === mallId) {
         appInfo = {
-          appid: elm.appid,
-          secret: elm.secret,
+          appid: elm[env].appid,
+          // secret: elm[env].secret,
           projectId: elm[env].projectId,
         };
       }
     });
-    console.log(101, appInfo);
+    // console.log(101, appInfo);
     if (JSON.stringify(appInfo) === '{}') {
       // groupId, mallId 错误
       return;

+ 1 - 1
src/utils/request.js

@@ -3,7 +3,7 @@ let reqCount = 0,resCount = 0;//记录请求次数和响应次数
 
 const request = (options) => {
 	reqCount++;
-	uni.showLoading();
+	uni.showLoading(options?.showLoading || {});
 	return new Promise((resolve, reject) => {
 		uni.request({
 			method: options.method,

+ 2 - 23
src/utils/uniHooks.js

@@ -24,9 +24,10 @@ function removeStorageSync(key, value) {
 }
 
 function showLoading(
-  { title = '', mask = false } = { title: '', mask: false }
+  { title = '', mask = false, duration = 2000 } = { title: '', mask: false }
 ) {
   let params = {
+    duration,
     message: title,
   };
   if (mask) {
@@ -37,11 +38,6 @@ function showLoading(
     };
   }
   ToastObj = Toast.loading(params);
-  // console.log('showLoading');
-  // // window.toWXSendMsg({
-  // //   type: 'showLoading',
-  // //   options: { title, mask },
-  // // });
 }
 
 function showModal() {
@@ -50,15 +46,9 @@ function showModal() {
 
 function hideLoading() {
   ToastObj.clear();
-  console.log('hideLoading');
-  // window.toWXSendMsg({
-  //   type: 'hideLoading',
-  //   options: {},
-  // });
 }
 
 function showToast({ title, duration, icon }) {
-  // console.log('showToast');
   const params = {};
   if (title) {
     params.message = title;
@@ -70,13 +60,6 @@ function showToast({ title, duration, icon }) {
     params.icon = icon;
   }
   Toast(params);
-  // if (window?.toWXSendMsg) {
-  //   window?.toWXSendMsg({
-  //     type: 'uni_func',
-  //     funcName: 'showToast',
-  //     options: params,
-  //   });
-  // }
 }
 
 function setNavigationBarTitle({ title }) {
@@ -97,7 +80,6 @@ function login({ title, success }) {
   if (typeof success === 'function') {
     success({});
   }
-  // return {success}
 }
 
 function request({ url, data, method, header, success, fail }) {
@@ -119,8 +101,6 @@ function request({ url, data, method, header, success, fail }) {
     if (/v1\/auth\/phone-login/g.test(url)) {
       params.data = qs.stringify(data);
     }
-    // console.log(params.data, 1141141141141114);
-    // return new Promise().resolve('ok')
   }
   if (success) {
     axios(params)
@@ -141,7 +121,6 @@ function request({ url, data, method, header, success, fail }) {
       });
     return;
   }
-  // console.log(7272727272, params);
   return axios(params);
 }