Bladeren bron

feat(KIP-10673): C端 | HKC 临时停车交互优化

lock.qiu@kerryprops.com 1 jaar geleden
bovenliggende
commit
48d9fbd9f0
2 gewijzigde bestanden met toevoegingen van 33 en 3 verwijderingen
  1. 32 2
      src/pages/parkingFee/mixins/parkingFee.js
  2. 1 1
      src/pages/parkingFeeV2/mixins/parkingFee.js

+ 32 - 2
src/pages/parkingFee/mixins/parkingFee.js

@@ -17,7 +17,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, qrCodes, unlicensedCarCheckIn, getConfValueOfKey } from '@/api/parking';
+import { parkingLots, qrCodes, unlicensedCarCheckIn, getConfValueOfKey, getVehicles } from '@/api/parking';
 import { reject } from 'lodash';
 
 export default {
@@ -61,7 +61,8 @@ export default {
       supportUnlicensed: false, // 控制当前site,是否使用无牌车
       qrCodeHistory: '',
       currentTabType: this.carType,
-      isAlipayClient: isAlipayClient
+      isAlipayClient: isAlipayClient,
+      licensePlateList: []
       // custTypeId: 0,
     };
   },
@@ -114,6 +115,7 @@ export default {
   },
   async mounted() {
     console.log(1111111);
+    this.getVehiclesINTMP()
     setTimeout(() => {
       window?.toWXSendMsg({
         type: 'nowRoute',
@@ -194,6 +196,34 @@ export default {
     }
   },
   methods: {
+    // 获取会员绑定的车牌列表
+    async getVehiclesINTMP() {
+      const res = await getVehicles(this.kipUserId)
+      this.licensePlateList = this.setLicensePlateList(res.content);
+      if (this.licensePlateList.length > 0 && this.mallId == "8a84853b7c91ac5b017c961a9b2a030d1") {
+        console.log('this.licensePlateList::', this.licensePlateList, this.licensePlateList[this.licensePlateList.length - 1])
+        this.numArr[0] = this.licensePlateList[this.licensePlateList.length - 1].charAt(0)
+        this.numArr[1] = this.licensePlateList[this.licensePlateList.length - 1].charAt(1)
+        this.numArr[2] = this.licensePlateList[this.licensePlateList.length - 1].charAt(2)
+        this.numArr[3] = this.licensePlateList[this.licensePlateList.length - 1].charAt(3)
+        this.numArr[4] = this.licensePlateList[this.licensePlateList.length - 1].charAt(4)
+        this.numArr[5] = this.licensePlateList[this.licensePlateList.length - 1].charAt(5)
+      if (this.licensePlateList[this.licensePlateList.length - 1].charAt(6)) {
+        this.numArr[6] = this.licensePlateList[this.licensePlateList.length - 1].charAt(6)
+      }
+      this.disabledBtn = false
+      } else if (this.licensePlateList.length === 0 && this.mallId == "8a84853b7c91ac5b017c961a9b2a030d") {
+        this.numArr[0] = '浙'
+        this.numArr[1] = 'A'
+      }
+    },
+    setLicensePlateList (arr) {
+      var array = []
+      arr.forEach(element => {
+        array.push(element.vehicleNo)
+      });
+      return array
+    },
     toggleType(carType) {
       this.ind = 0;
       this.active = 0;

+ 1 - 1
src/pages/parkingFeeV2/mixins/parkingFee.js

@@ -148,7 +148,7 @@ export default {
     // if (platform === 'micromessenger') {
     //   await initWxJsSdkConfig(['checkJsApi', 'scanQRCode']);
     // }
-
+    this.getVehiclesINTMP()
     const openid= uni.getStorageSync('openid');
       
     // 如果用户未登录的话,返回之后,重新获取数据用户的基础数据