Przeglądaj źródła

Merge pull request #567 from John-Hong/release-3.15.0

feat(KIP-17684):  移除buildingId相关逻辑和注释
Tron 11 miesięcy temu
rodzic
commit
a600b8c415

+ 0 - 12
src/App.vue

@@ -191,18 +191,6 @@ export default {
         if (window.location.href.indexOf('cryptojs') > -1) {
           return;
         }
-        // // 保留 carList
-        // const carList = uni.getStorageSync('carList');
-        // // 保留 buildingId
-        // const buildingId = window.localStorage.getItem('buildingId')
-        // // 每次进入页面清空 缓存数据
-        // window.localStorage.clear();
-        // if (carList) {
-        //   uni.setStorageSync('carList', JSON.parse(carList));
-        // }
-        // if (buildingId) {
-        //   window.localStorage.setItem('buildingId', buildingId)
-        // }
         setToken();
         localStorageInit();
         this.$store.commit('SET_IS_INIT', false);

+ 3 - 15
src/api/parking/index.js

@@ -25,9 +25,6 @@ export function checkOut(vehicleNo, unlicensed) {
   return window.requestms.get(`/parking/check-out?vehicleNo=${vehicleNo}&unlicensed=${unlicensed}`, {
     loading: false,
     timeout: 10000,
-    headers: {
-      buildingId: window.localStorage.getItem('buildingId'),
-    },
   });
 }
 
@@ -45,23 +42,14 @@ export function orders(params) {
 // 1.20 用户重新计算优惠信息校验
 export function calculateDiscount(params) {
   return window.requestms.post(`/parking/calculate-discount`, params, {
-    loading: true,
-    header: {
-      buildingId: window.localStorage.getItem('buildingId'),
-    },
+    loading: true
   });
 }
 
 // 1.13 下单并发起支付
-export function ordersAndPrepay({params, unlicensed=false, buildingId}) {
-  if(!buildingId) {
-    return Promise.reject(new Error('buildingId 为空'))
-  }
+export function ordersAndPrepay({params, unlicensed=false}) {
   return window.requestms.post(`/parking/orders-and-prepay?unlicensed=${unlicensed}`, params, { 
-    loading: true,
-    'Parking-User': {
-      buildingId: buildingId,
-    }, 
+    loading: true
   });
 }
 

+ 0 - 5
src/api/request.js

@@ -143,11 +143,6 @@ function XUser(config) {
       }
     };
   }
-  
-  // params = {"userId": "8aaa809d835ba76d018378bc57180006","sourceType": "WECHAT","phoneNumber": "18521563898","projectId": "paroject1","buildingId": "QHKC-P1","brandId":"8a84853b7c91ac5b017c962dab55030e","cid": "oIUfO5XAVleJ88z13i1_08DCKIhQ","vipCode":"KERRY100200040","lbsId":"8aaa81cb7c836c6b017c83e46b110001"}
-  /* if (/calculate-discount|unlicensed-car-check-in|unlicensed-car-checkout|paper-coupon/g.test(config.url)) {
-    params.buildingId = window.localStorage.getItem('buildingId');
-  } */
   params = Object.assign(params, config['Parking-User'])
   const newParams = {}
   Object.keys(params).forEach(key => {

+ 0 - 3
src/pages/parkingFee/mixins/parkingFee.js

@@ -910,10 +910,7 @@ export default {
         }
         this.qrCodeHistory = code
         const qrCodesres = await qrCodes(code); // 无牌车扫码
-        // 记录buildingId,确保 buildingId 是最新的数据
-        window.localStorage.setItem('buildingId', qrCodesres.buildingId);
         // 如果是无牌车扫码:出场
-        // console.log('模拟出场', this.unlicensedInfo.type);
         this.$store.commit('cachedViews/DEL_CACHED_VIEW', {
           name: 'parkingFeeDetail',
         });

+ 0 - 1
src/pages/parkingFee/mixins/parkingFeeDetail.js

@@ -353,7 +353,6 @@ export default {
         const res = await ordersAndPrepay({
           params, 
           unlicensed,
-          buildingId: parkInfo.buildingId
         });
         // console.log('orderDetail', res);
         if (res?.paymentType === 'NO_FEE_PAY') {

+ 0 - 2
src/pages/parkingFee/parkingFeeMsg.vue

@@ -174,8 +174,6 @@ export default {
     async qrCodesRule(code) {
       try {
         const qrCodesres = await qrCodes(code); // 无牌车扫码
-        // 记录buildingId,确保 buildingId 是最新的数据
-        window.localStorage.setItem('buildingId', qrCodesres.buildingId);
         // 如果是无牌车扫码:出场
         console.log('模拟出场', this.unlicensedInfo?.type);
         this.$store.commit('cachedViews/DEL_CACHED_VIEW', {

+ 0 - 2
src/pages/parkingFeeV2/mixins/parkingFee.js

@@ -1077,8 +1077,6 @@ export default {
         }
         this.qrCodeHistory = code
         const qrCodesres = await qrCodes(code); // 无牌车扫码
-        // 记录buildingId,确保 buildingId 是最新的数据
-        window.localStorage.setItem('buildingId', qrCodesres.buildingId);
         // 如果是无牌车扫码:出场
         // console.log('模拟出场', this.unlicensedInfo.type);
         this.$store.commit('cachedViews/DEL_CACHED_VIEW', {

+ 1 - 2
src/pages/parkingFeeV2/mixins/parkingFeeDetail.js

@@ -399,8 +399,7 @@ export default {
         }
         const unlicensed = parkingRecord.vehicleNo.indexOf('临') > -1; // true: 临时车牌;false:燃油车牌
         const res = await ordersAndPrepay({
-          params, unlicensed,
-          buildingId: parkInfo.buildingId
+          params, unlicensed
         });
         if (res?.paymentType === 'NO_FEE_PAY') {
           this.btnLoading = false;

+ 0 - 7
src/pages/parkingFeeV2/mixins/parkingFindCarFirst.js

@@ -813,8 +813,6 @@ export default {
     },
     // 处理扫码结果: 组装参数,剩余流程,在 缴费支付页面 实现
     async qrCodesRule(code, source = '') {
-      console.log(717, code, source);
-      // source 是为了避免重复刷新
       if (this.$store.state.pageHistory.parkingFeeMsg && !source) {
         return
       }
@@ -824,15 +822,10 @@ export default {
         }
         this.qrCodeHistory = code
         const qrCodesres = await qrCodes(code); // 无牌车扫码
-        // 记录buildingId,确保 buildingId 是最新的数据
-        window.localStorage.setItem('buildingId', qrCodesres.buildingId);
         // 如果是无牌车扫码:出场
-        // console.log('模拟出场', this.unlicensedInfo.type);
         this.$store.commit('cachedViews/DEL_CACHED_VIEW', {
           name: 'parkingFeeDetail',
         });
-        console.log(735);
-        // return
         if (this.unlicensedInfo?.type === 'unlicensedOut') {
           const query = {
             ...this.$route.query,

+ 0 - 2
src/pages/parkingFeeV2/parkingFeeMsg.vue

@@ -319,8 +319,6 @@ export default {
     async qrCodesRule(code) {
       try {
         const qrCodesres = await qrCodes(code); // 无牌车扫码
-        // 记录buildingId,确保 buildingId 是最新的数据
-        window.localStorage.setItem('buildingId', qrCodesres.buildingId);
         // 如果是无牌车扫码:出场
         console.log('模拟出场', this.unlicensedInfo?.type);
         this.$store.commit('cachedViews/DEL_CACHED_VIEW', {

+ 0 - 2
src/pages/parkingFeeV2/qrCodeLicensedCar.vue

@@ -330,8 +330,6 @@ export default {
     async qrCodesRule(code) {
       try {
         const qrCodesres = await qrCodes(code); // 无牌车扫码
-        // 记录buildingId,确保 buildingId 是最新的数据
-        window.localStorage.setItem('buildingId', qrCodesres.buildingId);
         // 如果是无牌车扫码:出场
         console.log('模拟出场', this.unlicensedInfo?.type);
         this.$store.commit('cachedViews/DEL_CACHED_VIEW', {

+ 0 - 33
src/store/index.js

@@ -194,15 +194,6 @@ const store = new Vuex.Store({
   actions: {
     async baseInit({ commit, dispatch }, { options, callback }) {
       try {
-        // console.log(
-        //   'Encrypt',
-        //   Encrypt(
-        //     // '8a8480487c96d58f017c9b7bab7d0020_8a84811682cf02420182ed5fb8c4000d_8a8485067ce4da2d017ce555e9b20000_ozdsB4yx3I7ez2Ba3DgEmeSR-CFY_15267617473'
-        //     '8aaa81947c6e1ca0017c7201e82d0001#8aaa80cc7d4fc7b3017d55c4d6120000#8aaa80b47c784020017c78b00d060022#ozdsB4yx3I7ez2Ba3DgEmeSR-CFY#13601829387'
-        //   )
-        // );
-        // console.log('128128128128', options);
-        // if (!pageId) return;
         let {
           groupId = '',
           mallId = '',
@@ -226,15 +217,6 @@ const store = new Vuex.Store({
           unionId = ''
         } = options;
         console.log({ lbsId });
-
-        /* {
-         buildingId: mallId,
-         projectId: groupId,
-         openId: openid,
-         }
-         * */
-        // const resp = await parkingLots();
-        // console.log(171171, resp);
         commit('SET_SOURCE', source);
         commit('SET_APPID', appId);
 
@@ -245,7 +227,6 @@ const store = new Vuex.Store({
           const groupIdAndMallId = getGroupIdAndMallIdByLsbId(lbsId);
           groupId = groupIdAndMallId.groupId;
           mallId = groupIdAndMallId.mallId;
-          // console.log('lbsId', groupIdAndMallId)
           commit('SET_LBS_ID', mallId);
         } else {
           commit('SET_LBS_ID', lbsId);
@@ -263,22 +244,10 @@ const store = new Vuex.Store({
         commit('SET_GROUP_ID', groupId);
         commit('SET_MALL_ID', mallId);
         commit('SET_BRAND_ID', brandId);
-        // console.log('用户扫码进入的', unlicensedInfo, unlicensedInfo?.type);
         // 如果是无牌车
         if (unlicensedInfo?.type) {
-          // console.log('用户扫码进入的', unlicensedInfo);
           commit('SET_UNLICENSED_INFO', unlicensedInfo)
-          // commit('SET_ENDLESS_LOOP', true)
         }
-        /*if (/dev-|8080|qa-/.test(href)) {
-         commit('SET_GROUP_ID', groupId);
-         commit('SET_MALL_ID', mallId);
-         } else {
-         commit('SET_GROUP_ID', '8a8884e77cc9e70a017cca1c77e80004');
-         groupId = '8a8884e77cc9e70a017cca1c77e80004';
-         mallId = '8a888aed7d0295e5017d029ff1f40000';
-         commit('SET_MALL_ID', '8a888aed7d0295e5017d029ff1f40000');
-         }*/
         commit('SET_OPENID', openid || uni.getStorageSync('openid'));
         if (isLogin) {
           if(!kipUserId) {
@@ -390,9 +359,7 @@ const store = new Vuex.Store({
     async getUserDetail({ commit }) {
       try {
         const res = await kipGetUserDetail();
-        // console.log(296, res);
         commit('SET_USER_INFO', res.data);
-        // console.log('user_info', res);
       } catch (err) {
         console.log(err, err);
       }

+ 0 - 4
src/store/order/index.js

@@ -73,10 +73,6 @@ export default {
     },
     orderInitRule( {commit,dispatch,state},checkOutResponse ) {
       // console.log(119,checkOutResponse);
-      // 记录buildingId
-      if ( checkOutResponse?.parkInfo?.buildingId ) {
-        window.localStorage.setItem('buildingId',checkOutResponse.parkInfo.buildingId);
-      }
       commit('setParkMallCode', checkOutResponse.parkInfo.parkMallCode)
       commit('setOrderDetail',checkOutResponse);
       const isShowDiscounts = checkOutResponse?.parkingRule?.enableCoupon || false;

+ 0 - 5
src/utils/common/localStorage.js

@@ -4,16 +4,11 @@ export function localStorageInit() {
   const carList = uni.getStorageSync('carList');
   const lbs_end_time = uni.getStorageSync('lbs_end_time');
   const lbs_easy_end_time = uni.getStorageSync('lbs_easy_end_time');
-  // 保留 buildingId
-  // const buildingId = window.localStorage.getItem('buildingId')
   // 每次进入页面清空 缓存数据
   window.localStorage.clear();
   if (carList) {
     uni.setStorageSync('carList', JSON.parse(carList));
   }
-  // if (buildingId) {
-  //   window.localStorage.setItem('buildingId', buildingId)
-  // }
   if(lbs_end_time) {
     uni.setStorageSync('lbs_end_time', lbs_end_time);
   }