浏览代码

feat: 微服务接入改造10%

John-Hong 2 年之前
父节点
当前提交
f548984f88
共有 32 个文件被更改,包括 785 次插入513 次删除
  1. 1 0
      package.json
  2. 12 2
      src/App.vue
  3. 25 0
      src/api/parking/index.js
  4. 165 0
      src/api/request.js
  5. 4 6
      src/pages/parkingFee/components/base/parkingFee.vue
  6. 4 5
      src/pages/parkingFee/components/officeBlue/home.vue
  7. 99 48
      src/pages/parkingFee/mixins/home.js
  8. 4 2
      src/pages/parkingFee/mixins/parkingFeeList.js
  9. 361 362
      src/pages/parkingFee/mixins/vehicleManagement.js
  10. 1 3
      src/pages/parkingFee/parkingFee.vue
  11. 1 3
      src/pages/parkingFee/parkingFeeCoupon.vue
  12. 4 7
      src/pages/parkingFee/parkingFeeDetail.vue
  13. 1 3
      src/pages/parkingFee/parkingFeeDetailSuccess.vue
  14. 1 3
      src/pages/parkingFee/parkingFeeDiscounts.vue
  15. 1 3
      src/pages/parkingFee/parkingFeeHint/parkingFeeHint.vue
  16. 1 3
      src/pages/parkingFee/parkingFeeList.vue
  17. 1 3
      src/pages/parkingFee/parkingFeePaperCoupon.vue
  18. 1 3
      src/pages/parkingFee/parkingFeePayment.vue
  19. 2 3
      src/pages/parkingFee/parkingFeeSuccess.vue
  20. 1 3
      src/pages/parkingFee/parkingReceipt/parkingApplication.vue
  21. 1 3
      src/pages/parkingFee/parkingReceipt/parkingChangeHeader.vue
  22. 1 3
      src/pages/parkingFee/parkingReceipt/parkingChooseHeader.vue
  23. 1 3
      src/pages/parkingFee/parkingReceipt/parkingHeaderDetail.vue
  24. 1 3
      src/pages/parkingFee/parkingReceipt/parkingInvoice.vue
  25. 1 3
      src/pages/parkingFee/parkingReceipt/parkingInvoiceImage.vue
  26. 1 3
      src/pages/parkingFee/parkingReceipt/parkingOrderDetail.vue
  27. 1 3
      src/pages/parkingFee/parkingReceipt/parkingReceipt.vue
  28. 1 3
      src/pages/parkingFee/vehicleAddOrEdit.vue
  29. 1 3
      src/pages/parkingFee/vehicleManagement.vue
  30. 30 19
      src/store/index.js
  31. 51 5
      src/utils/request-crm-ms.js
  32. 5 0
      yarn.lock

+ 1 - 0
package.json

@@ -19,6 +19,7 @@
     "moment": "^2.29.4",
     "sa-sdk-javascript": "^1.23.3",
     "sa-sdk-miniprogram": "^1.17.12",
+    "uuid": "^9.0.0",
     "vant": "^2.12.50",
     "vue": "^2.7.14",
     "vue-router": "^3.6.5",

+ 12 - 2
src/App.vue

@@ -22,6 +22,7 @@
   </div>
 </template>
 <script>
+import { createAxiosByinterceptors } from "@/api/request";
 import { KIP_API_CODE } from '@/common/js/config';
 import Stomp from '@/lib/stompjs';
 import loginMinix from '@/mixins/login';
@@ -53,6 +54,7 @@ export default {
   created() {
     console.log('重新打包');
     this.initEnv();
+    this.requestInit()
     this.init();
     // 初始化环境变量
   },
@@ -218,8 +220,11 @@ export default {
       const href = window.location.href;
       console.log('当前页面的url地址  ', href);
       if (/dev-|8080/.test(href)) {
-        window.env = 'qa';
-        window.profileApi = 'https://qa-apim.kerryplus.com/c/api';
+        // window.env = 'qa';
+        // window.profileApi = 'https://qa-apim.kerryplus.com/c/api';
+        // window.api = 'qaApi';
+        window.env = 'dev';
+        window.profileApi = 'https://dev-gateway-kip.kerryonvip.com/c/api';
         window.api = 'qaApi';
         return;
       }
@@ -233,6 +238,11 @@ export default {
       window.profileApi = 'https://apim.kerryplus.com/c/api';
       window.api = 'api';
     },
+    requestInit() {
+      window.requestms = createAxiosByinterceptors({
+        baseURL: `${window.profileApi}/temporary-parking-service`,
+      });
+    },
     send() {
       const token = window.token;
       window.stompClient.send(

+ 25 - 0
src/api/parking/index.js

@@ -0,0 +1,25 @@
+// 1.1 获取停车场信息:https://kerryprops.atlassian.net/wiki/spaces/TAIC/pages/93323297/1.1
+// temporary-parking-service/parking-lots
+// https://{kip-service-host}/c/api/temporary-parking-service/parking-lots
+// ${window.profileApi}/temporary-parking-service
+// import {createAxiosByinterceptors} from '@/api/request';
+//
+// // 在初始化时,获取到的 window.profileApi 为空,需要执行一下 request() ,才能拿到正确的 api 地址,进行后续的接口请求
+// const request = createAxiosByinterceptors({
+//   baseURL: `${window.profileApi}/temporary-parking-service`,
+// });
+
+export function parkingLots(params) {
+  return window.requestms.get(`/parking-lots`, { params, loading: true });
+}
+
+
+
+// 1.6 查询车辆是否在场及停车费用: https://kerryprops.atlassian.net/wiki/spaces/TAIC/pages/94076936/1.6
+// 新接口路径:https://{kip-service-host}/c/api/temporary-parking-service/parking/check-out?vehicleNo={{vehicleNo}}
+export function checkOut(vehicleNo) {
+  return window.requestms.get(`/check-out?vehicleNo=${vehicleNo}`, {  loading: true });
+}
+
+
+

+ 165 - 0
src/api/request.js

@@ -0,0 +1,165 @@
+import uni from "@/utils/uniHooks";
+import { getUTMSource } from "@/utils/utils";
+import axios, { AxiosInstance, AxiosRequestConfig } from 'axios';
+// import { Message } from 'element-ui';
+// import { jumpLogin } from '@/utils';
+// import { Loading } from 'element-ui';
+// import { ElLoadingComponent } from 'element-ui/types/loading';
+// import vm from "@/main";
+import { Toast } from 'vant';
+import vue from 'vue';
+import store from '@/store'
+import { v4 as uuidv4 } from 'uuid';
+
+let loadingInstance = null;
+let requestNum = 0;
+
+const CONTENT_TYPE_ARRAY = {
+  json: 'application/json',
+  form: 'application/x-www-form-urlencoded',
+};
+
+function getHeaders(config = {}) {
+  const { contentType = 'json' } = config;
+  const ct = CONTENT_TYPE_ARRAY[contentType];
+  let header = {
+    appId: uni.getStorageSync('appid'),
+    'Content-Type': ct,
+  };
+  const token = getToken();
+  if (token) {
+    header['Authorization'] = `Bearer ${token}`;
+  }
+
+  const groupId = uni.getStorageSync('groupId');
+  const mallId = uni.getStorageSync('mallid');
+  if (groupId) {
+    header['brandId'] = groupId;
+  }
+  if (mallId) {
+    header['lbsId'] = mallId;
+  }
+  const sourceObj = getUTMSource();
+  return Object.assign(header, sourceObj);
+}
+
+function handleConfig(config = {}) {
+  const header = getHeaders(config);
+  const noToken = config.noToken;
+  if (noToken) {
+    delete header.Authorization;
+  }
+  console.log(525252, header);
+  return { header, ...config };
+}
+
+function getToken() {
+  const token = uni.getStorageSync('kipAccessToken');
+  // if (!token || token?.trim() == '' || token == 'null' || token == 'undefined') {
+  if (!token || token == 'null' || token == 'undefined') {
+    return false;
+  }
+  return token;
+}
+
+const addLoading = () => {
+  // 增加loading 如果pending请求数量等于1,弹出loading, 防止重复弹出
+  requestNum++;
+  if (requestNum === 1) {
+    // 展示加载中的状态
+    loadingInstance = Toast.loading({
+      message: '正在努力加载中....',
+    });
+  }
+};
+
+const cancelLoading = () => {
+  // 取消loading 如果pending请求数量等于0,关闭loading
+  requestNum--;
+  if (requestNum === 0) loadingInstance?.clear();
+};
+
+export const createAxiosByinterceptors = (config) => {
+  const instance = axios.create({
+    timeout: 1000, //超时配置
+    baseURL: `${window.profileApi}/temporary-parking-service`,
+    withCredentials: true, //跨域携带cookie
+    ...config, // 自定义配置覆盖基本配置
+  });
+  // 添加请求拦截器
+  instance.interceptors.request.use(
+    function (config) {
+      // 在发送请求之前做些什么
+      const { loading = true } = config;
+      console.log('config:', config);
+      if (loading) addLoading();
+      // 设置 headers
+      config.headers = {
+        ...config.headers,
+        ...handleConfig().header,
+        'X-Conversation-Id': uuidv4(),
+        'X-User': JSON.stringify({
+          userId: store.state.member.id, // K+用户ID
+          sourceType: 'WECHAT', // 登录来源: WECHAT/ALIPAY/H5/APP
+          cId: store.state.openId, // 终端用户ID, 微信端传openId, 支付宝小程序传阿里userId, APP传KIP的userId
+          projectId: store.state.member.groupId, // 楼盘id
+          // projectId: 'ZYJXQV2', // 楼盘id
+          buildingId: store.state.member.mallid, // 楼栋id
+          // buildingId: '%E6%B2%AAA99999', // 楼栋id
+          mobile: store.state.mobile, // 终端用户ID, 微信端传openId, 支付宝小程序传阿里userId, APP传KIP的userId
+          vipCode: store.state.member.vipcode, // 终端用户ID, 微信端传openId, 支付宝小程序传阿里userId, APP传KIP的userId
+        })
+      }
+      // console.log(111111, config.headers, handleConfig().header)
+      console.log(111111, handleConfig().header)
+      return config;
+    },
+    function (error) {
+      // 对请求错误做些什么
+      return Promise.reject(error);
+    }
+  );
+
+  // 添加响应拦截器
+  instance.interceptors.response.use(
+    function (response) {
+      // 对响应数据做点什么
+      console.log('response:', response);
+      const { loading = true } = response.config;
+      if (loading) cancelLoading();
+      const { code, data, message } = response.data;
+      console.log('62response', response);
+      if (code === 200) return data;
+      else if (code === 401) {
+        // 跳转到登陆
+        // jumpLogin();
+      } else {
+        // 错误信息提示
+        // Message.error(message);
+        Toast({
+          message: message,
+        });
+        return Promise.reject(response.data);
+      }
+    },
+    function (error) {
+      // 对响应错误做点什么
+      console.log('error-response:', error.response);
+      console.log('error-config:', error.config);
+      console.log('error-request:', error.request);
+      const { loading = true } = error.config || {};
+      if (loading) cancelLoading();
+      console.log('79error', error);
+      if (error.response) {
+        if (error.response.status === 401) {
+          // 跳转到登陆
+          // jumpLogin();
+        }
+      }
+      // 错误信息提示
+      // Message.error(error?.response?.data?.message || '服务端异常');
+      return Promise.reject(error);
+    }
+  );
+  return instance;
+};

+ 4 - 6
src/pages/parkingFee/components/base/parkingFee.vue

@@ -33,7 +33,7 @@
               <span class="btn">缴费说明</span>
             </div>
             <div class="info" :class="!init_ch ? 'info_show' : ''">
-              <span>{{ parkInfoEntity.payinstruction }}</span>
+              <span>{{ description }}</span>
             </div>
           </div>
           <div
@@ -41,8 +41,8 @@
             @click="top_display"
             v-if="
               !init_ch &&
-              parkInfoEntity.payinstruction &&
-              parkInfoEntity.payinstruction.length > 60
+              description &&
+              description.length > 60
             "
           >
@@ -225,9 +225,7 @@
 import homeJs from '../../mixins/home';
 
 export default {
-  // ...homeJs,
-  // mixins: [homeJs],
-  ...homeJs,
+  mixins: [homeJs],
   name: 'baseCom',
 };
 </script>

+ 4 - 5
src/pages/parkingFee/components/officeBlue/home.vue

@@ -156,15 +156,15 @@
             <span class="title">缴费说明</span>
           </div>
           <div class="info" :class="!init_ch ? 'info_show' : ''">
-            <span>{{ parkInfoEntity.payinstruction }}</span>
+            <span>{{ description }}</span>
           </div>
           <div
             class="top_down"
             @click="top_display"
             v-if="
               !init_ch &&
-              parkInfoEntity.payinstruction &&
-              parkInfoEntity.payinstruction.length > 60
+              description &&
+              description.length > 60
             "
           >
             <van-icon name="arrow-down" />
@@ -189,8 +189,7 @@
 <script>
 import homeJs from '../../mixins/home';
 export default {
-  // mixins: [homeJs],
-  ...homeJs,
+  mixins: [homeJs],
   name: 'officeBlueCom',
 };
 </script>

+ 99 - 48
src/pages/parkingFee/mixins/home.js

@@ -2,6 +2,7 @@ import plateNumber from '@/components/plate-number/plateNumber.vue';
 import { REG_SOURCE } from '@/constants';
 import LoginDom from '@/components/Login/Login.vue';
 import { mapState } from 'vuex';
+
 const app = {
   globalData: {
     regSource: '',
@@ -12,6 +13,7 @@ import uni from '@/utils/uniHooks';
 // import greenCom from '../components/green/home.vue';
 // import officeBlueCom from '../components/officeBlue/home.vue';
 // import purpleCom from '../components/purple/home.vue';
+import { parkingLots, checkOut } from '@/api/parking';
 
 export default {
   components: {
@@ -32,6 +34,7 @@ export default {
       show_chinese: false, //是否显示汉字键盘
       show_allBoard: false, //是否显示英文数字键盘
       plate_number: '', //车牌号
+      description: '', // 车场描述
       ind: null,
       numArr: ['', '', '', '', '', '', ''],
       active: null,
@@ -88,6 +91,7 @@ export default {
       });
     }, 300);
     if (this.openid) {
+      console.log(939393939393);
       this.getParkInfo();
       this.showSq = false;
     } else {
@@ -164,56 +168,96 @@ export default {
       }
     },
     // 获取停车场信息
-    getParkInfo: function () {
+    getParkInfo: async function () {
       uni.showLoading({
         title: '加载中',
       });
       const openid = uni.getStorageSync('openid') || this.openId;
-      let params = {
-        // mallid: '8a84853b7c91ac5b017c961a9b2a030d',
-        // groupId: '8a84853b7c91ac5b017c962dab55030e',
-        mallid: this.mallId,
-        groupId: this.groupId,
-        openid: openid,
-        vipcode: this.member?.vipcode,
-      };
-      console.log(342, params);
-      this.$md(params);
-      this.$request({
-        url: this.$baseURL + 'api/1.0/park/parkInfo',
-        data: params,
-        method: 'POST',
-        header: JSON.parse(uni.getStorageSync('handleUser')),
-      })
-        .then((res) => {
-          if (res.data.code === 0) {
-            const data = res.data.data || {};
-            this.carList = data.carList;
-            this.parkInfoEntity = data.parkInfoEntity;
-            this.hourMoney =
-              parseFloat(this.parkInfoEntity.needmoney) /
-              parseFloat(this.parkInfoEntity.tohours);
-            let reg = /[;;]/g;
-            this.parkInfoEntity.payinstruction =
-              this.parkInfoEntity.payinstruction.replace(reg, '\r\n');
-            this.parkInfoEntity.hourMoney = this.hourMoney;
-            uni.setStorageSync('parkinfo', JSON.stringify(this.parkInfoEntity));
-          } else {
-            uni.showToast({
-              title: res.data.msg,
-              duration: 2000,
-              icon: 'none',
-            });
-          }
-        })
-        .catch((err) => {
-          uni.showToast({
-            title: '网络超时请稍后再试',
-            duration: 2000,
-            icon: 'none',
-          });
-          console.log(err);
-        });
+      /*let params = {
+       // mallid: '8a84853b7c91ac5b017c961a9b2a030d',
+       // groupId: '8a84853b7c91ac5b017c962dab55030e',
+       mallid: this.mallId,
+       groupId: this.groupId,
+       openid: openid,
+       vipcode: this.member?.vipcode,
+       };
+       console.log(342, params);
+       this.$md(params);
+       this.$request({
+       url: this.$baseURL + 'api/1.0/park/parkInfo',
+       data: params,
+       method: 'POST',
+       header: JSON.parse(uni.getStorageSync('handleUser')),
+       })
+       .then((res) => {
+       if (res.data.code === 0) {
+       const data = res.data.data || {};
+       this.carList = data.carList;
+       this.parkInfoEntity = data.parkInfoEntity;
+       this.hourMoney =
+       parseFloat(this.parkInfoEntity.needmoney) /
+       parseFloat(this.parkInfoEntity.tohours);
+       let reg = /[;;]/g;
+       this.parkInfoEntity.payinstruction =
+       this.parkInfoEntity.payinstruction.replace(reg, '\r\n');
+       this.parkInfoEntity.hourMoney = this.hourMoney;
+       uni.setStorageSync('parkinfo', JSON.stringify(this.parkInfoEntity));
+       } else {
+       uni.showToast({
+       title: res.data.msg,
+       duration: 2000,
+       icon: 'none',
+       });
+       }
+       })
+       .catch((err) => {
+       uni.showToast({
+       title: '网络超时请稍后再试',
+       duration: 2000,
+       icon: 'none',
+       });
+       console.log(err);
+       });*/
+      try {
+        const res = await parkingLots();
+        console.log('223,2323', res);
+        const data = {
+          "parkName": "杭州停车场",
+          "parkCode": "hz01",
+          "carList": [],
+          "description": "计费基础规则:10元每小时,上不封顶 ;\n线上缴费渠道:CRM小程序 (分会员通道及非会员通道);1\n会员等级减免:铂金卡当日可免费停车4小时,金卡当时可免费停车2小时,银卡无减免 (当日仅限使用1次,可与其它减免共享);\n积分抵扣:1000积分抵扣10元(手动输入抵扣积分);\n消费减免:消费200元可减免2小时,消费400元可减免4小时,消费800元可减免6小时 。仅限会员,当日有效,当日可多次享受该减免,当日最多可享受消费减免6小时。;\n        消费减免举例:;\n        (1) 某顾客第一次进场,消费230元  离场时可看到减免2小时的选项,默认为选中;\n        (2) 如果顾客未使用减免,顾客第二次进场,消费+270  离场时可看到减免金额提高到4小时;\n         如果顾客使用减免:顾客第二次进场,消费+270  离场时可看到还是只能减免2小时;\n        (3) CRM小程序缴费页面停留时长1分钟,1分钟后自动刷新获取最新缴费金额;\n纸质优惠券核销: 顾客在CRM小程序手动扫码获取优惠券金额;\n会员活动及积分兑换优惠 :通过CRM系统获取(详细情况由CRM另行描述)!"
+        }
+        // let reg = /[;;]/g;
+        // this.parkInfoEntity.description = data.description.replace(reg, '\r\n');
+        this.description = data.description;
+        // const data = res.data.data || {};
+        this.carList = data.carList;
+        // this.parkInfoEntity = data.parkInfoEntity;
+        // this.hourMoney =
+        //   parseFloat(this.parkInfoEntity.needmoney) /
+        //   parseFloat(this.parkInfoEntity.tohours);
+        // let reg = /[;;]/g;
+        // this.parkInfoEntity.payinstruction =
+        //   this.parkInfoEntity.payinstruction.replace(reg, '\r\n');
+        // this.parkInfoEntity.hourMoney = this.hourMoney;
+        // uni.setStorageSync('parkinfo', JSON.stringify(this.parkInfoEntity));
+
+        // console.log(233, res);
+      } catch (e) {
+        console.log(225225, e);
+      }
+      // return;
+      // const data = res.data || {};
+      // this.carList = data.carList;
+      // this.parkInfoEntity = data.parkInfoEntity;
+      // this.hourMoney =
+      //   parseFloat(this.parkInfoEntity.needmoney) /
+      //   parseFloat(this.parkInfoEntity.tohours);
+      // let reg = /[;;]/g;
+      // this.parkInfoEntity.payinstruction =
+      //   this.parkInfoEntity.payinstruction.replace(reg, '\r\n');
+      // this.parkInfoEntity.hourMoney = this.hourMoney;
+      // uni.setStorageSync('parkinfo', JSON.stringify(this.parkInfoEntity));
     },
     //缴费说明隐藏显示
     top_display() {
@@ -299,7 +343,7 @@ export default {
       }, 3000);
     },
     // 查询车费信息
-    handleSearch(carno, clickEvent = '$ClickQueryAndPayment') {
+   async handleSearch(carno, clickEvent = '$ClickQueryAndPayment') {
       this.vehicleNumber = carno;
       const params = {
         carno,
@@ -327,6 +371,13 @@ export default {
       // TODO: 暂定埋点传参为车牌类型,是否需要其他参数比如车牌号码;埋点位置是否要放在查询接口回调函数中
       this.$md(params);
       console.log(539, uni.getStorageSync('handleUser'));
+      try {
+        const res = await checkOut(carno)
+        console.log(res)
+      } catch ( err ) {
+        console.log('errerrerrerr',err)
+      }
+      return
       this.$request({
         // url: this.$baseURL + 'api/1.0/park/checkCarIsInPark',
         url: this.$baseURL + 'api/1.0/park/checkCarIsInParkAndCarFee',
@@ -536,7 +587,7 @@ export default {
         type: 'toPage',
         options: {
           fnName: 'navigateTo',
-          url: '/pages/pointsMall/pointsMall?exchangeTypes=2'
+          url: '/pages/pointsMall/pointsMall?exchangeTypes=2',
         },
       });
     },

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

@@ -1,11 +1,11 @@
 // const app = getApp()
 import uni from '@/utils/uniHooks';
 import LoginDom from '@/components/Login/Login.vue';
-import { wxToLoginCallback } from '@/utils/index';
+import { wxToLoginCallback } from '@/utils';
 
 let canloading = true;
 let pageNum = 1;
-import moment from 'moment';
+// import moment from 'moment';
 // import authorize from '@/components/authorize/authorize.vue';
 import { mapState } from 'vuex';
 // import {data as mockData} from './list'
@@ -38,6 +38,8 @@ export default {
     canloading = true;
     pageNum = 1;
     const member = uni.getStorageSync('member');
+    console.log(4141, member)
+    return
     if (member) {
       this.loadData();
     } else {

+ 361 - 362
src/pages/parkingFee/mixins/vehicleManagement.js

@@ -1,378 +1,377 @@
-  import uniPop from '@/components/uni-popup/uni-popup.vue';
-  import { Dialog } from 'vant';
-  import LoginDom from '@/components/Login/Login.vue';
-  // const app = getApp()
-  const app = {};
-  import {
+import uniPop from '@/components/uni-popup/uni-popup.vue';
+import { Dialog } from 'vant';
+import LoginDom from '@/components/Login/Login.vue';
+// const app = getApp()
+const app = {};
+import {
   kipGetMemberVehicles,
   kipDeleteMemberVehicles,
 } from '@/utils/api-kip.js';
-  import { LICENSE_PLATE_TYPE_ARR } from '@/constants.js';
-  import { mapState } from 'vuex';
-  // import authorize from '@/components/authorize/authorize.vue';
-  import { isCruMarketByKey } from '@/utils/location-util.js';
-  import MemberCacheTool from '@/utils/member-cache-tool.js';
-  import { REG_SOURCE } from '@/constants.js';
-  import uni from '@/utils/uniHooks.js';
-  // import { vehicles as vehiclesList } from './list';
-  import { wxToLoginCallback } from '@/utils/index';
-  import { Toast } from 'vant';
+import { LICENSE_PLATE_TYPE_ARR } from '@/constants.js';
+import { mapState } from 'vuex';
+// import authorize from '@/components/authorize/authorize.vue';
+import { isCruMarketByKey } from '@/utils/location-util.js';
+import MemberCacheTool from '@/utils/member-cache-tool.js';
+import { REG_SOURCE } from '@/constants.js';
+import uni from '@/utils/uniHooks.js';
+// import { vehicles as vehiclesList } from './list';
+import { wxToLoginCallback } from '@/utils/index';
+import { Toast } from 'vant';
 
-  export default {
+export default {
   components: {
-  uniPop,
-  // authorize,
-  LoginDom,
-},
+    uniPop,
+    // authorize,
+    LoginDom,
+  },
   computed: {
-  ...mapState({
-  custTypeId: (state) => state.custTypeId,
-  member: (state) => state.member,
-  groupId: (state) => state.groupId,
-  openid: (state) => state.openid,
-  mallid: (state) => state.mallId,
-  mobile: (state) => state.mobile,
-}),
-},
+    ...mapState({
+      custTypeId: (state) => state.custTypeId,
+      member: (state) => state.member,
+      groupId: (state) => state.groupId,
+      openid: (state) => state.openid,
+      mallid: (state) => state.mallId,
+      mobile: (state) => state.mobile,
+    }),
+  },
   data() {
-  return {
-  list: [],
-  activeId: '',
-  activeCarno: '',
-  licensePlateList: [],
-  isBeijing: false,
-  options: null,
-  preUrl: '',
-  deleteDialogSwitch: false,
-  deleteSuccessDialogSwitch: false,
-};
-},
+    return {
+      list: [],
+      activeId: '',
+      activeCarno: '',
+      licensePlateList: [],
+      isBeijing: false,
+      options: null,
+      preUrl: '',
+      deleteDialogSwitch: false,
+      deleteSuccessDialogSwitch: false,
+    };
+  },
 
   async created() {
-  const option = this.$route.query;
-  this.options = option;
-  await this.$onLaunched;
-  this.localimgPic = this.$staticPicUrl + '/wxminilocalimg/parkingFee/';
-  // #ifdef H5
-  app.globalData.member = JSON.parse(uni.getStorageSync('member'));
-  // #endif
-  // 场景二维码记录(是否扫码进入)
-  app.globalData.paramsScene = {};
-  this.$saveSceneQrcodeDetail(
-  'page',
-  'vehicleManagement',
-  '车牌管理',
-  '',
-  '',
-  '',
-  ''
-  );
-  // 埋点本地化
-  this.preUrl = uni.getStorageSync('previousUrl');
-  uni.setStorageSync(
-  'previousUrl',
-  '/pages/parkingFee/vehicleManagement.vue'
-  );
-},
+    const option = this.$route.query;
+    this.options = option;
+    await this.$onLaunched;
+    this.localimgPic = this.$staticPicUrl + '/wxminilocalimg/parkingFee/';
+    // #ifdef H5
+    app.globalData.member = JSON.parse(uni.getStorageSync('member'));
+    // #endif
+    // 场景二维码记录(是否扫码进入)
+    app.globalData.paramsScene = {};
+    this.$saveSceneQrcodeDetail(
+      'page',
+      'vehicleManagement',
+      '车牌管理',
+      '',
+      '',
+      '',
+      ''
+    );
+    // 埋点本地化
+    this.preUrl = uni.getStorageSync('previousUrl');
+    uni.setStorageSync(
+      'previousUrl',
+      '/pages/parkingFee/vehicleManagement.vue'
+    );
+  },
   async mounted() {
-  setTimeout(() => {
-  uni.setNavigationBarTitle({
-  title: '车辆管理',
-});
-}, 300);
-  // await this.$onLaunched
-  this.isBeijing = isCruMarketByKey('北京');
-  const member = uni.getStorageSync('member');
-  if (JSON.stringify(this.member) !== '{}') {
-  this.getKipMemberVehicles();
-} else {
-  wxToLoginCallback('vehicleManagement', (options) => {
-  // console.log(229, options);
-  if ( options?.noLoginParkingFeeWebView === 'fail' ) {
-  // 如果是用户明确拒绝登录,执行这段逻辑
-  Toast({
-  message: '您还未登录,请登录',
-  icon: 'none',
-  onClose: () => {
-  this.$router.back();
-},
-});
-
-} else {
-  this.$router.back()
-}
-});
-  // const regSource = REG_SOURCE.PARKING;
-  // app.globalData.regSource = regSource;
-  // if (this.options?.regSource) {
-  //   app.globalData.regSource = REG_SOURCE[this.options?.regSource];
-  // }
-  // if (this.options?.tpName) {
-  //   app.globalData.tpName = this.options?.tpName;
-  // }
-  // // this.$refs.authorize.login('/pages/parkingFee/parkingFee', () => {
-  // //   this.getKipMemberVehicles()
-  // // })
-  // this.getKipMemberVehicles();
-}
-},
+    setTimeout(() => {
+      uni.setNavigationBarTitle({
+        title: '车辆管理',
+      });
+    }, 300);
+    // await this.$onLaunched
+    this.isBeijing = isCruMarketByKey('北京');
+    const member = uni.getStorageSync('member');
+    if (JSON.stringify(this.member) !== '{}') {
+      this.getKipMemberVehicles();
+    } else {
+      wxToLoginCallback('vehicleManagement', (options) => {
+        // console.log(229, options);
+        if (options?.noLoginParkingFeeWebView === 'fail') {
+          // 如果是用户明确拒绝登录,执行这段逻辑
+          Toast({
+            message: '您还未登录,请登录',
+            icon: 'none',
+            onClose: () => {
+              this.$router.back();
+            },
+          });
+        } else {
+          this.$router.back();
+        }
+      });
+      // const regSource = REG_SOURCE.PARKING;
+      // app.globalData.regSource = regSource;
+      // if (this.options?.regSource) {
+      //   app.globalData.regSource = REG_SOURCE[this.options?.regSource];
+      // }
+      // if (this.options?.tpName) {
+      //   app.globalData.tpName = this.options?.tpName;
+      // }
+      // // this.$refs.authorize.login('/pages/parkingFee/parkingFee', () => {
+      // //   this.getKipMemberVehicles()
+      // // })
+      // this.getKipMemberVehicles();
+    }
+  },
   onUnload() {
-  // #ifdef MP-WEIXIN
-  var pages = getCurrentPages();
-  var prevPage = pages[pages.length - 2];
-  console.log('==> 车牌管理-返回上一页');
-  prevPage.setData({
-  parkData: 'parkData',
-});
-  // #endif
-  // #ifdef H5
-  uni.setStorage({
-  key: 'parkData',
-  data: 'parkData',
-  success: function () {
-  console.log('parkData-success');
-},
-});
-  // #endif
-},
+    // #ifdef MP-WEIXIN
+    var pages = getCurrentPages();
+    var prevPage = pages[pages.length - 2];
+    console.log('==> 车牌管理-返回上一页');
+    prevPage.setData({
+      parkData: 'parkData',
+    });
+    // #endif
+    // #ifdef H5
+    uni.setStorage({
+      key: 'parkData',
+      data: 'parkData',
+      success: function () {
+        console.log('parkData-success');
+      },
+    });
+    // #endif
+  },
   methods: {
-  // 添加车牌号
-  toAdd() {
-  this.$router.push({ path: 'vehicleAddOrEdit' });
-},
-  // 跳转支付页面
-  toPay(carno) {
-  this.$store.commit('cachedViews/DEL_CACHED_VIEW', {
-  name: 'parkingFeeDetail'
-});
-  // 查询车费信息
-  uni.showLoading({
-  title: '加载中',
-});
-  // const openId = MemberCacheTool.getOpenId(app)
-  const params = {
-  carno,
-  mallid: this.mallid,
-  openid: this.openid,
-  vipcode: this.member?.vipcode,
-  mobile: this.mobile,
-  groupId: this.groupId,
-  createuser: 'sys_miniprogram',
-};
-  this.$md(params);
-  this.$request({
-  url: this.$baseURL + 'api/1.0/park/checkCarIsInPark',
-  data: params,
-  method: 'POST',
-  header: JSON.parse(uni.getStorageSync('handleUser')),
-  timeout: 10000,
-})
-  .then((res) => {
-  // console.log(227, res);
-  uni.hideLoading();
-  if (res.data.code === 0) {
-  this.$router.push({
-  path: 'parkingFeeDetail?carno=' + carno,
-});
-} else if (res.data.code === 1) {
-  // 当前车辆没有查到账单
-  this.$router.push({
-  path: 'parkingFeePayment?msg=' + res.data.msg + '&carno=' + carno,
-});
-} else if (res.data.code === 2) {
-  // 月租车
-  this.$router.push({
-  path: './parkingFeeHint/parkingFeeHint?carno=' + carno,
-});
-} else {
-  uni.showToast({
-  title: res.data.msg,
-  duration: 2000,
-  icon: 'none',
-});
-}
-})
-  .catch((err) => {
-  uni.hideLoading();
-  uni.showToast({
-  title: '网络超时请稍后再试',
-  duration: 2000,
-  icon: 'none',
-});
-  console.log(err);
-});
-},
-  // 编辑
-  toEdit(item) {
-  if (!item) {
-  return;
-}
-  const { id, vehicleNo, licensePlateType } = item;
-  const carType = LICENSE_PLATE_TYPE_ARR.findIndex(
-  (e) => e.value == licensePlateType
-  );
-  this.sensorsClick('$ClickEditLicensePlate', {
-  carno_old: item.vehicleNo,
-  redirect_url: 'pages/parkingFee/vehicleAddOrEdit',
-});
-  this.$router.push({
-  path: `vehicleAddOrEdit?id=${id}&carno=${vehicleNo}&carType=${carType}`,
-});
-},
-  // 删除
-  toDelete(item) {
-  this.activeId = item.id;
-  this.activeCarno = item.vehicleNo;
+    // 添加车牌号
+    toAdd() {
+      this.$router.push({ path: 'vehicleAddOrEdit' });
+    },
+    // 跳转支付页面
+    toPay(carno) {
+      this.$store.commit('cachedViews/DEL_CACHED_VIEW', {
+        name: 'parkingFeeDetail',
+      });
+      // 查询车费信息
+      uni.showLoading({
+        title: '加载中',
+      });
+      // const openId = MemberCacheTool.getOpenId(app)
+      const params = {
+        carno,
+        mallid: this.mallid,
+        openid: this.openid,
+        vipcode: this.member?.vipcode,
+        mobile: this.mobile,
+        groupId: this.groupId,
+        createuser: 'sys_miniprogram',
+      };
+      this.$md(params);
+      this.$request({
+        url: this.$baseURL + 'api/1.0/park/checkCarIsInPark',
+        data: params,
+        method: 'POST',
+        header: JSON.parse(uni.getStorageSync('handleUser')),
+        timeout: 10000,
+      })
+        .then((res) => {
+          // console.log(227, res);
+          uni.hideLoading();
+          if (res.data.code === 0) {
+            this.$router.push({
+              path: 'parkingFeeDetail?carno=' + carno,
+            });
+          } else if (res.data.code === 1) {
+            // 当前车辆没有查到账单
+            this.$router.push({
+              path: 'parkingFeePayment?msg=' + res.data.msg + '&carno=' + carno,
+            });
+          } else if (res.data.code === 2) {
+            // 月租车
+            this.$router.push({
+              path: './parkingFeeHint/parkingFeeHint?carno=' + carno,
+            });
+          } else {
+            uni.showToast({
+              title: res.data.msg,
+              duration: 2000,
+              icon: 'none',
+            });
+          }
+        })
+        .catch((err) => {
+          uni.hideLoading();
+          uni.showToast({
+            title: '网络超时请稍后再试',
+            duration: 2000,
+            icon: 'none',
+          });
+          console.log(err);
+        });
+    },
+    // 编辑
+    toEdit(item) {
+      if (!item) {
+        return;
+      }
+      const { id, vehicleNo, licensePlateType } = item;
+      const carType = LICENSE_PLATE_TYPE_ARR.findIndex(
+        (e) => e.value == licensePlateType
+      );
+      this.sensorsClick('$ClickEditLicensePlate', {
+        carno_old: item.vehicleNo,
+        redirect_url: 'pages/parkingFee/vehicleAddOrEdit',
+      });
+      this.$router.push({
+        path: `vehicleAddOrEdit?id=${id}&carno=${vehicleNo}&carType=${carType}`,
+      });
+    },
+    // 删除
+    toDelete(item) {
+      this.activeId = item.id;
+      this.activeCarno = item.vehicleNo;
 
-  Dialog.confirm({
-  title: '删除已绑定车牌',
-  message: '是否确认删除已经绑定车牌' + '\n' + this.activeCarno,
-  confirmButtonColor: '#333',
-})
-  .then(() => {
-  // on confirm
-  this.doDelete();
-})
-  .catch(() => {
-  // on cancel
-  // this.cancelDelete();
-});
-  // this.deleteDialogSwitch = true;
-},
-  doDelete() {
-  uni.showLoading({
-  title: '加载中',
-});
-  const _this = this;
-  kipDeleteMemberVehicles(this.activeId)
-  .then((result) => {
-  uni.hideLoading();
-  // console.log(resp)
-  // const result = resp.data
-  if (result && result.code == '000000') {
-  this.sensorsClick('$ClickDeleteLicensePlate', {
-  carno_old: this.activeCarno,
-  redirect_url: '',
-});
-  if (result.data) {
-  // this.deleteDialogSwitch = false;
-  // this.deleteSuccessDialogSwitch = true;
+      Dialog.confirm({
+        title: '删除已绑定车牌',
+        message: '是否确认删除已经绑定车牌' + '\n' + this.activeCarno,
+        confirmButtonColor: '#333',
+      })
+        .then(() => {
+          // on confirm
+          this.doDelete();
+        })
+        .catch(() => {
+          // on cancel
+          // this.cancelDelete();
+        });
+      // this.deleteDialogSwitch = true;
+    },
+    doDelete() {
+      uni.showLoading({
+        title: '加载中',
+      });
+      const _this = this;
+      kipDeleteMemberVehicles(this.activeId)
+        .then((result) => {
+          uni.hideLoading();
+          // console.log(resp)
+          // const result = resp.data
+          if (result && result.code == '000000') {
+            this.sensorsClick('$ClickDeleteLicensePlate', {
+              carno_old: this.activeCarno,
+              redirect_url: '',
+            });
+            if (result.data) {
+              // this.deleteDialogSwitch = false;
+              // this.deleteSuccessDialogSwitch = true;
 
-  Dialog.alert({
-  message: '删除成功',
-  confirmButtonColor: '#333',
-}).then(() => {
-  // on confirm
-  // this.doDelete();
-  this.getKipMemberVehicles();
-});
-  // _this.$refs.deleteSuccessDialog.open()
-  return;
-}
-}
-  const message = result.message || '删除失败';
-  uni.showToast({
-  title: message,
-  duration: 2000,
-  icon: 'none',
-});
-})
-  .catch((err) => {
-  uni.hideLoading();
-  console.log(err);
-  uni.showToast({
-  title: '删除失败',
-  duration: 2000,
-  icon: 'none',
-});
-});
-},
-  // 埋点方法
-  sensorsClick(eventName, params) {
-  let optionsQuery = uni.getStorageSync('options_query');
-  let fixedParams = {
-  cta_itemno: '',
-  cta_name: '',
-  previous_url: this.preUrl || '',
-  // 原previous_url: uni.getStorageSync('previousUrl') || ''
-  // previous_url: 使用sdk预置参数$referrer,
-  $brand_id: this.groupId,
-  redirect_url: params.redirect_url || '',
-  $location: this.mallid,
-  $channel: optionsQuery.channel || '',
-  // $utm_lbs: this.optionsQuery.utm_lbs || '',
-  $utm_channel: optionsQuery.utm_channel || '',
-  $utm_method: optionsQuery.utm_method || '',
-  $utm_source: optionsQuery.utm_source || '',
-  $utm_function: optionsQuery.utm_function || '',
-  $utm_user: optionsQuery.utm_user || '',
-},
-  finalParams = Object.assign(fixedParams, params);
-  this.$sensors.track(eventName, finalParams);
-},
-  cancelDelete() {
-  this.deleteDialogSwitch = true;
-},
-  confirmDialog() {
-  // this.$refs.deleteSuccessDialog.close()
-  this.deleteSuccessDialogSwitch = false;
+              Dialog.alert({
+                message: '删除成功',
+                confirmButtonColor: '#333',
+              }).then(() => {
+                // on confirm
+                // this.doDelete();
+                this.getKipMemberVehicles();
+              });
+              // _this.$refs.deleteSuccessDialog.open()
+              return;
+            }
+          }
+          const message = result.message || '删除失败';
+          uni.showToast({
+            title: message,
+            duration: 2000,
+            icon: 'none',
+          });
+        })
+        .catch((err) => {
+          uni.hideLoading();
+          console.log(err);
+          uni.showToast({
+            title: '删除失败',
+            duration: 2000,
+            icon: 'none',
+          });
+        });
+    },
+    // 埋点方法
+    sensorsClick(eventName, params) {
+      let optionsQuery = uni.getStorageSync('options_query');
+      let fixedParams = {
+          cta_itemno: '',
+          cta_name: '',
+          previous_url: this.preUrl || '',
+          // 原previous_url: uni.getStorageSync('previousUrl') || ''
+          // previous_url: 使用sdk预置参数$referrer,
+          $brand_id: this.groupId,
+          redirect_url: params.redirect_url || '',
+          $location: this.mallid,
+          $channel: optionsQuery.channel || '',
+          // $utm_lbs: this.optionsQuery.utm_lbs || '',
+          $utm_channel: optionsQuery.utm_channel || '',
+          $utm_method: optionsQuery.utm_method || '',
+          $utm_source: optionsQuery.utm_source || '',
+          $utm_function: optionsQuery.utm_function || '',
+          $utm_user: optionsQuery.utm_user || '',
+        },
+        finalParams = Object.assign(fixedParams, params);
+      this.$sensors.track(eventName, finalParams);
+    },
+    cancelDelete() {
+      this.deleteDialogSwitch = true;
+    },
+    confirmDialog() {
+      // this.$refs.deleteSuccessDialog.close()
+      this.deleteSuccessDialogSwitch = false;
 
-  this.getKipMemberVehicles();
-},
-  // 获取会员绑定的车牌列表
-  getKipMemberVehicles() {
-  // console.log(453);
-  uni.showLoading({
-  title: '加载中',
-});
-  kipGetMemberVehicles()
-  .then((result) => {
-  uni.hideLoading();
-  console.log(result);
-  // const result = resp.data
-  if (result && result.code == '000000') {
-  const data = result.data || [];
-  if (data && data.length > 0) {
-  // data.forEach((item) => {
-  //   const curLicensePlateType = LICENSE_PLATE_TYPE_ARR.find(
-  //     (e) => e.value == item.licensePlateType
-  //   )
-  //   if (curLicensePlateType) {
-  //     item.licensePlateTypeDesc = curLicensePlateType.label
-  //   }
-  // })
-  this.licensePlateList = this.setLicensePlateList(data);
-} else {
-  this.licensePlateList = [];
-}
-  // this.licensePlateList = vehiclesList.data;
-} else {
-  const message = result.message || '获取信息失败';
-  uni.showToast({
-  title: message,
-  duration: 2000,
-  icon: 'none',
-});
-}
-  // console.log(380, this.licensePlateList);
-})
-  .catch((err) => {
-  uni.hideLoading();
-  console.error(err);
-});
-  // this.licensePlateList = this.setLicensePlateList(vehiclesList.data);
-},
-  setLicensePlateList(data) {
-  if (!data.length) return [];
-  return data.map((item) => {
-  const curLicensePlateType = LICENSE_PLATE_TYPE_ARR.find(
-  (e) => e.value == item.licensePlateType
-  );
-  if (curLicensePlateType) {
-  item.licensePlateTypeDesc = curLicensePlateType.label;
-}
-  return item;
-});
-},
-},
+      this.getKipMemberVehicles();
+    },
+    // 获取会员绑定的车牌列表
+    getKipMemberVehicles() {
+      // console.log(453);
+      uni.showLoading({
+        title: '加载中',
+      });
+      kipGetMemberVehicles()
+        .then((result) => {
+          uni.hideLoading();
+          console.log(result);
+          // const result = resp.data
+          if (result && result.code == '000000') {
+            const data = result.data || [];
+            if (data && data.length > 0) {
+              // data.forEach((item) => {
+              //   const curLicensePlateType = LICENSE_PLATE_TYPE_ARR.find(
+              //     (e) => e.value == item.licensePlateType
+              //   )
+              //   if (curLicensePlateType) {
+              //     item.licensePlateTypeDesc = curLicensePlateType.label
+              //   }
+              // })
+              this.licensePlateList = this.setLicensePlateList(data);
+            } else {
+              this.licensePlateList = [];
+            }
+            // this.licensePlateList = vehiclesList.data;
+          } else {
+            const message = result.message || '获取信息失败';
+            uni.showToast({
+              title: message,
+              duration: 2000,
+              icon: 'none',
+            });
+          }
+          // console.log(380, this.licensePlateList);
+        })
+        .catch((err) => {
+          uni.hideLoading();
+          console.error(err);
+        });
+      // this.licensePlateList = this.setLicensePlateList(vehiclesList.data);
+    },
+    setLicensePlateList(data) {
+      if (!data.length) return [];
+      return data.map((item) => {
+        const curLicensePlateType = LICENSE_PLATE_TYPE_ARR.find(
+          (e) => e.value == item.licensePlateType
+        );
+        if (curLicensePlateType) {
+          item.licensePlateTypeDesc = curLicensePlateType.label;
+        }
+        return item;
+      });
+    },
+  },
 };

+ 1 - 3
src/pages/parkingFee/parkingFee.vue

@@ -1,7 +1,5 @@
 <template>
-  <div>
-    <component :is="componentName"></component>
-  </div>
+  <component :is="componentName"></component>
 </template>
 
 <script>

+ 1 - 3
src/pages/parkingFee/parkingFeeCoupon.vue

@@ -1,7 +1,5 @@
 <template>
-  <div>
-    <component :is="componentName"></component>
-  </div>
+  <component :is="componentName"></component>
 </template>
 
 <script>

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

@@ -1,18 +1,15 @@
 <template>
-  <div>
-    <keep-alive>
-      <component :is="componentName"></component>
-    </keep-alive>
-  </div>
+  <component :is="componentName"></component>
 </template>
 
 <script>
 import officeBlueCom from './components/officeBlue/parkingFeeDetail.vue';
 import baseParkingFeeCom from './components/base/parkingFeeDetail.vue';
-import baseMixins from './mixins/base'
+import baseMixins from './mixins/base';
+
 export default {
   name: 'parkingFeeDetail',
-  mixins:[baseMixins],
+  mixins: [baseMixins],
   components: {
     officeBlueCom,
     baseParkingFeeCom,

+ 1 - 3
src/pages/parkingFee/parkingFeeDetailSuccess.vue

@@ -1,7 +1,5 @@
 <template>
-  <div>
-    <component :is="componentName"></component>
-  </div>
+  <component :is="componentName"></component>
 </template>
 
 <script>

+ 1 - 3
src/pages/parkingFee/parkingFeeDiscounts.vue

@@ -1,7 +1,5 @@
 <template>
-  <div>
-    <component :is="componentName"></component>
-  </div>
+  <component :is="componentName"></component>
 </template>
 
 <script>

+ 1 - 3
src/pages/parkingFee/parkingFeeHint/parkingFeeHint.vue

@@ -1,7 +1,5 @@
 <template>
-  <div>
-    <component :is="componentName"></component>
-  </div>
+  <component :is="componentName"></component>
 </template>
 
 <script>

+ 1 - 3
src/pages/parkingFee/parkingFeeList.vue

@@ -1,7 +1,5 @@
 <template>
-  <div>
-    <component :is="componentName"></component>
-  </div>
+  <component :is="componentName"></component>
 </template>
 
 <script>

+ 1 - 3
src/pages/parkingFee/parkingFeePaperCoupon.vue

@@ -1,7 +1,5 @@
 <template>
-  <div>
-    <component :is="componentName"></component>
-  </div>
+  <component :is="componentName"></component>
 </template>
 
 <script>

+ 1 - 3
src/pages/parkingFee/parkingFeePayment.vue

@@ -1,7 +1,5 @@
 <template>
-  <div>
-    <component :is="componentName"></component>
-  </div>
+  <component :is="componentName"></component>
 </template>
 
 <script>

+ 2 - 3
src/pages/parkingFee/parkingFeeSuccess.vue

@@ -1,7 +1,6 @@
 <template>
-  <div>
-    <component :is="componentName"></component>
-  </div>
+  <component :is="componentName"></component>
+</div>
 </template>
 
 <script>

+ 1 - 3
src/pages/parkingFee/parkingReceipt/parkingApplication.vue

@@ -1,7 +1,5 @@
 <template>
-  <div>
-    <component :is="componentName"></component>
-  </div>
+  <component :is="componentName"></component>
 </template>
 
 <script>

+ 1 - 3
src/pages/parkingFee/parkingReceipt/parkingChangeHeader.vue

@@ -1,7 +1,5 @@
 <template>
-  <div>
-    <component :is="componentName"></component>
-  </div>
+  <component :is="componentName"></component>
 </template>
 
 <script>

+ 1 - 3
src/pages/parkingFee/parkingReceipt/parkingChooseHeader.vue

@@ -1,7 +1,5 @@
 <template>
-  <div>
-    <component :is="componentName"></component>
-  </div>
+  <component :is="componentName"></component>
 </template>
 
 <script>

+ 1 - 3
src/pages/parkingFee/parkingReceipt/parkingHeaderDetail.vue

@@ -1,7 +1,5 @@
 <template>
-  <div>
-    <component :is="componentName"></component>
-  </div>
+  <component :is="componentName"></component>
 </template>
 
 <script>

+ 1 - 3
src/pages/parkingFee/parkingReceipt/parkingInvoice.vue

@@ -1,7 +1,5 @@
 <template>
-  <div>
-    <component :is="componentName"></component>
-  </div>
+  <component :is="componentName"></component>
 </template>
 
 <script>

+ 1 - 3
src/pages/parkingFee/parkingReceipt/parkingInvoiceImage.vue

@@ -1,7 +1,5 @@
 <template>
-  <div>
-    <component :is="componentName"></component>
-  </div>
+  <component :is="componentName"></component>
 </template>
 
 <script>

+ 1 - 3
src/pages/parkingFee/parkingReceipt/parkingOrderDetail.vue

@@ -1,7 +1,5 @@
 <template>
-  <div>
-    <component :is="componentName"></component>
-  </div>
+  <component :is="componentName"></component>
 </template>
 
 <script>

+ 1 - 3
src/pages/parkingFee/parkingReceipt/parkingReceipt.vue

@@ -1,7 +1,5 @@
 <template>
-  <div>
-    <component :is="componentName"></component>
-  </div>
+  <component :is="componentName"></component>
 </template>
 
 <script>

+ 1 - 3
src/pages/parkingFee/vehicleAddOrEdit.vue

@@ -1,7 +1,5 @@
 <template>
-  <div>
-    <component :is="componentName"></component>
-  </div>
+  <component :is="componentName"></component>
 </template>
 
 <script>

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

@@ -1,7 +1,5 @@
 <template>
-  <div>
-    <component :is="componentName"></component>
-  </div>
+  <component :is="componentName"></component>
 </template>
 
 <script>

+ 30 - 19
src/store/index.js

@@ -6,9 +6,11 @@ import uni from '@/utils/uniHooks';
 import { kipAllCities, kipGetUserDetail } from '@/utils/api-kip';
 import cachedViews from './cachedViews';
 import { lbsDictionary } from '@/common/js/BaseDictionary';
-import { getGroupIdAndMallIdByLsbId } from '@/utils/index';
+import { getGroupIdAndMallIdByLsbId } from '@/utils';
+// import { parkingLots } from '@/utils/api-crm-ms';
 
 Vue.use(Vuex);
+
 function getValue(state, key) {
   let value = state[key];
   if (!value) {
@@ -17,6 +19,7 @@ function getValue(state, key) {
   // console.log(1414141414141414, { key, value });
   return value;
 }
+
 const store = new Vuex.Store({
   state: {
     // groupId: '8a84819f7c6e260e017c72669bbe01c2',
@@ -44,7 +47,7 @@ const store = new Vuex.Store({
     bonusCopy: 0,
     source: '', // 访问方:微信小程序:(CRM|KIP)
     brandInfo: {},
-    curMarket: {}
+    curMarket: {},
   },
   mutations: {
     SET_GROUP_ID(state, payload) {
@@ -165,18 +168,26 @@ const store = new Vuex.Store({
           // brandInfo = {},
           // curMarket = {}
         } = options;
-        // console.log(8181, options);
-        commit('SET_SOURCE', source)
+
+        /* {
+         buildingId: mallId,
+         projectId: groupId,
+         openId: openid,
+         }
+         * */
+        // const resp = await parkingLots();
+        // console.log(171171, resp);
+        commit('SET_SOURCE', source);
         // let { groupId, mallId } =
-        if ( source !== 'CRM' ) {
+        if (source !== 'CRM') {
           const groupIdAndMallId = getGroupIdAndMallIdByLsbId(lbsId);
-          groupId = groupIdAndMallId.groupId
-          mallId = groupIdAndMallId.mallId
+          groupId = groupIdAndMallId.groupId;
+          mallId = groupIdAndMallId.mallId;
         }
-        console.log(152,{source,custTypeId, kipUserId});
+        console.log(152, { source, custTypeId, kipUserId });
 
-        if ( source === 'CRM' ) {
-          commit('SET_CUST_TYPE_ID', custTypeId)
+        if (source === 'CRM') {
+          commit('SET_CUST_TYPE_ID', custTypeId);
           // commit('SET_CUR_MARKET', curMarket)
           // commit('SET_BRAND_INFO', brandInfo)
         }
@@ -188,14 +199,14 @@ const store = new Vuex.Store({
         commit('SET_GROUP_ID', groupId);
         commit('SET_MALL_ID', mallId);
         /*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_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);
         if (isLogin) {
           commit('SET_ACCESS_TOKEN', accessToken);
@@ -229,7 +240,7 @@ const store = new Vuex.Store({
       const res = await kipGetUserDetail();
       commit('SET_USER_INFO', res.data);
       // console.log('user_info', res);
-    }
+    },
   },
   modules: {
     cachedViews,

+ 51 - 5
src/utils/request-crm-ms.js

@@ -1,7 +1,53 @@
-// CRM微服务接入
 /*
-* 设计目标
-* 把控多接口请求时
-*
-* */
+ * CRM微服务接入
+ * 一、设计目标
+ *   1、拦截重复请求
+ *   2、支持可配置的登陆校验
+ *   3、可配置的header
+ *   4、根据环境切换
+ *   5、同时需要支持 KIP 接口
+ * */
 
+// import axios from 'axios'
+
+// export default function (  ) {
+//   window.profileApi
+//   // https://{kip-service-host}/c/api/temporary-parking-service/parking-lots
+//   return axios
+// }
+
+import uni from "@/utils/uniHooks";
+import axios from 'axios';
+import { v4 as uuidv4 } from 'uuid';
+function createdHeader(axiosConfig) {
+  const headerConfig = {
+    'Content-Type': 'application/json',
+    // 'X-Conversation-Id': uuidv4(),
+    'X-Conversation-Id': '8aaa87bb8051012901805a0d7f610001',
+    'X-User': JSON.stringify({
+      'userId': '3aaa87bb8051012901805a0d7f610001', // K+用户ID
+      "nickName":"%E6%9A%AE%E4%BA%91%E6%B7%B1",
+      // "vipCode":"KIP0099923",
+      sourceType: 'WECHAT', // 登录来源: WECHAT/ALIPAY/H5/APP
+      "phoneNumber":"15090631337","cId":"8aaa87bb8051012901805a0d7f610001",
+      "projectId":"ZYJXQV2",
+      "buildingId":"%E6%B2%AAA99999",
+      cid:'', // 终端用户ID, 微信端传openId, 支付宝小程序传阿里userId, APP传KIP的userId
+      mobile:'', // 终端用户ID, 微信端传openId, 支付宝小程序传阿里userId, APP传KIP的userId
+      vipCode:'', // 终端用户ID, 微信端传openId, 支付宝小程序传阿里userId, APP传KIP的userId
+      // projectId: uni.getStorageSync('groupId'), // groupId: 项目id
+      // buildingId:uni.getStorageSync('mallid') // mallId:楼栋id
+    })
+  }
+  axiosConfig.headers = headerConfig
+}
+function myAxios(axiosConfig) {
+  const service = axios.create({
+    baseURL: `${window.profileApi}/temporary-parking-service`, // 设置统一的请求前缀
+    timeout: 10000, // 设置统一的超时时长
+  });
+  createdHeader(axiosConfig);
+  return service(axiosConfig);
+}
+
+export default myAxios;

+ 5 - 0
yarn.lock

@@ -9457,6 +9457,11 @@ uuid@^8.3.2:
   resolved "https://nexus-internal.kerryonvip.com/repository/kerry-npm-group/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"
   integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==
 
+uuid@^9.0.0:
+  version "9.0.0"
+  resolved "https://nexus-internal.kerryonvip.com/repository/kerry-npm-group/uuid/-/uuid-9.0.0.tgz#592f550650024a38ceb0c562f2f6aa435761efb5"
+  integrity sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==
+
 v8-to-istanbul@^4.1.3:
   version "4.1.4"
   resolved "https://nexus-internal.kerryonvip.com/repository/kerry-npm-group/v8-to-istanbul/-/v8-to-istanbul-4.1.4.tgz#b97936f21c0e2d9996d4985e5c5156e9d4e49cd6"