Kaynağa Gözat

1、修改无牌车扫码展示流程;
2、UI调整

john 2 yıl önce
ebeveyn
işleme
4c9c8aff98

+ 1 - 1
src/api/request.js

@@ -177,7 +177,7 @@ export const createAxiosByinterceptors = (config) => {
       }
       // 错误信息提示
       const { code, langMessage, message,status } = error.response.data;
-      const codeList = ['INTERNAL_SERVER_ERROR', 'VALIDATION_FAILED', 'CAR_NOT_FOUND', 'CAR_HAS_PLATE', "NOT_FOUND", "LOCAL_PARK_ERROR", "LOCK_OCCUPIED", "REMOTE_CALL_FAIL", 'PLEASE_SCAN_QRCODE']; // 默认处理的错误code
+      const codeList = ['INTERNAL_SERVER_ERROR', 'VALIDATION_FAILED', 'CAR_HAS_PLATE', "NOT_FOUND", "LOCAL_PARK_ERROR", "LOCK_OCCUPIED", "REMOTE_CALL_FAIL", 'PLEASE_SCAN_QRCODE']; // 默认处理的错误code
       if (codeList.indexOf(code) > -1) {
         uni.showToast({ title: langMessage || message, duration: 3000, icon: 'fail' });
       }

+ 20 - 6
src/kui/components/k-tab/k-tab.vue

@@ -161,13 +161,26 @@ export default {
 }
 
 .k-tab-group-fill {
+  position: relative;
+  &:before{
+    position: absolute;
+    content: "";
+    left: 0;
+    right: 0;
+    bottom: 0;
+    top: 0;
+    -webkit-box-shadow:0px 0px 0px 0.75px var(--k-color-primary-01, #064c8a);
+    border-radius: 35.75px;
+    z-index: 1;
+  }
   .k-tab-group__item {
+    z-index: 2;
     flex: 1;
     display: flex;
     justify-content: center;
     align-items: center;
-    border-top: 1px var(--k-color-primary-01, #064c8a) solid;
-    border-bottom: 1px var(--k-color-primary-01, #064c8a) solid;
+    //border-top: 1px var(--k-color-primary-01, #064c8a) solid;
+    //border-bottom: 1px var(--k-color-primary-01, #064c8a) solid;
     // padding: 8px 16px;
     margin-left: -24.375px;
     // font-size: 15px;
@@ -182,22 +195,23 @@ export default {
     /* identical to box height */
     padding: 13px 26px;
     // text-align: right;
-    color: #999999;
+    //color: #999999;
+    color: var(--k-color-primary-01, #064c8a);
   }
 
   .k-tab-group__item.k-tab-group__item-first {
-    border-left: 1px var(--k-color-primary-01, #064c8a) solid;
+    //border-left: 1px var(--k-color-primary-01, #064c8a) solid;
     margin-left: 0;
     border-radius: 35.75px 0 0 35.75px;
   }
 
   .k-tab-group__item.k-tab-group__item-last {
-    border-right: 1px var(--k-color-primary-01, #064c8a) solid;
+    //border-right: 1px var(--k-color-primary-01, #064c8a) solid;
     border-radius: 0 35.75px 35.75px 0;
   }
 
   .k-tab-group__item.k-tab-group__item--active {
-    border: 1px var(--k-color-primary-01, #064c8a) solid;
+    //border: 1px var(--k-color-primary-01, #064c8a) solid;
     border-radius: 35.75px;
     background-color: var(--k-color-primary-01, #064c8a);
     color: #fff;

+ 28 - 12
src/pages/parkingFee/components/purple/parkingFee.vue

@@ -72,11 +72,12 @@
                 <div class="li" @click="clickShowKeyboard(5)" :class="[active === 5 ? 'active' : '']">
                   {{ numArr[5] }}
                 </div>
-                <div :class="['li', carType !== 1 && 'dashed', active === 6 ? 'active' : '']" @click="clickShowKeyboard(6)">
+                <div :class="['li', active === 6 ? 'active' : '']" @click="clickShowKeyboard(6)">
                   {{ numArr[6] }}
                 </div>
-                <div class="li dashed" @click="clickShowKeyboard(7)" :class="[active === 7 ? 'active' : '']" v-if="carType == 1">
-                  <span v-if="numArr[7]">{{ numArr[7] }}</span>
+                <div class="li dashed green-active" @click="clickShowKeyboard(7)" :class="[active === 7 ? 'active' : '']" >
+                  <span v-if="numArr[7] && carType === 1">{{ numArr[7] }}</span>
+                  <img v-else :src="require('../../static/images/unlicensed/leaf.svg')">
                 </div>
               </div>
               <k-button title="查询缴费" style="margin-top: 46px;margin-bottom: 43px;" :disabled="disabledBtn" disabledColor="#D1D2D9" @click="preHandleSearch" />
@@ -170,7 +171,7 @@ export default {
     flex-direction: column;
 
     .top_menu {
-      background: #fff;
+      background: #FBFCFF;
       box-sizing: border-box;
       display: flex;
       justify-content: space-between;
@@ -217,7 +218,7 @@ export default {
         padding-top: 46px;
         padding-left: 27px;
         padding-bottom: 50px;
-        background-color: #ffffff;
+        background-color: #FBFCFF;
         display: flex;
         align-items: flex-end;
 
@@ -261,7 +262,7 @@ export default {
         width: 100%;
         display: flex;
         flex-direction: column;
-        background: #fff;
+        background: #FBFCFF;
         box-sizing: border-box;
 
         .search_tip {
@@ -354,7 +355,17 @@ export default {
               border-style: dashed;
             }
             &.active {
-              border-color: #3e67ff;
+              border-color: var(--k-color-primary-01, #064c8a);
+            }
+            &.green-active {
+              background: #F8FFED;
+              border-color: #7DB124;
+              color: #7DB124;
+              img{
+
+                width: 41px;
+                height: 39px;
+              }
             }
           }
 
@@ -400,7 +411,7 @@ export default {
         padding-bottom: 34px;
         //margin-top: 20px;
         //padding-top: 20px;
-        background-color: #ffffff;
+        background-color: #FBFCFF;
 
         .vehicleMgt-title {
           //width: 91%;
@@ -459,7 +470,7 @@ export default {
     }
     /* 无牌车UI */
     .unlicensed-box {
-      background-color: #fff;
+      background-color: #FBFCFF;
 
       .no-car-unlicensed-box {
         box-sizing: border-box;
@@ -499,17 +510,22 @@ export default {
       .in-car {
         box-sizing: border-box;
         .car-number-box {
-          padding-top: 53px;
+          height: 230px;
+          //padding-top: 53px;
           padding-left: 18px;
-          padding-bottom: 34px;
+          //padding-bottom: 34px;
           background: #fbfcff;
           border: 1px solid #d9dbe0;
           border-radius: 4px;
           margin: 0 24px;
           display: flex;
           margin-bottom: 40px;
+          display: flex;
+          align-items: center;
+          
           img {
             width: 288px;
+            height: 142px;
           }
           .car-number {
             .number {
@@ -544,7 +560,7 @@ export default {
       background-size: 100% 30%;
       padding-left: 27px;
       padding-right: 27px;
-      background-color: #ffffff;
+      background-color: #FBFCFF;
 
       .top_content {
         box-sizing: border-box;

+ 13 - 2
src/pages/parkingFee/components/purple/vehicleAddOrEdit.vue

@@ -40,8 +40,9 @@
         <div :class="['li', carType !== 1 && 'dashed', active === 6 ? 'active' : '']" @click="clickShowKeyboard(6)">
           {{ numArr[6] }}
         </div>
-        <div class="li dashed" @click="clickShowKeyboard(7)" :class="[active === 7 ? 'active' : '']" v-if="carType == 1">
-          <span v-if="numArr[7]">{{ numArr[7] }}</span>
+        <div class="li dashed green-active" @click="clickShowKeyboard(7)" :class="[active === 7 ? 'active' : '']" >
+          <span v-if="numArr[7] && carType === 1">{{ numArr[7] }}</span>
+          <img v-else :src="require('../../static/images/unlicensed/leaf.svg')">
         </div>
       </div>
       <k-button :title="$route.query.carno ? '确认修改' : '确认添加'" style="margin: 46px auto 43px; display: block" :disabled="disabledBtn" disabledColor="#D1D2D9" @click="handleAddLicensePlateByKipMember" />
@@ -149,6 +150,16 @@ export default {
       &.active {
         border-color: var(--k-color-primary);
       }
+      &.green-active {
+        background: #F8FFED;
+        border-color: #7DB124;
+        color: #7DB124;
+        img{
+
+          width: 41px;
+          height: 39px;
+        }
+      }
     }
 
     .input_box_dian {

+ 11 - 10
src/pages/parkingFee/mixins/parkingFee.js

@@ -228,6 +228,7 @@ export default {
     },
     // 唤起键盘
     clickShowKeyboard(index) {
+      if ( this.carType !== 1 && index === 7) return
       this.ind = index;
       this.active = index;
       if (index === 0) {
@@ -636,18 +637,18 @@ export default {
         })
       } catch (err) {
         // 车场扫描道闸入口,发现无车/车场扫描道闸入口,发现有牌车 >>> 停止往下执行,默认提示报错信息
-        if (/CAR_NOT_FOUND|CAR_HAS_PLATE/.test(err.code)) {
+        if (/CAR_HAS_PLATE/.test(err.code)) {
           return
         }
-        console.log('模拟出场的报错', err);
-        return
-        // 如果是其他错误的话,则继续往下执行
-        this.$router.push({
-          path: 'parkingFeeMsg',
-          query: {
-            type: 'fail'
-          }
-        })
+        if (/CAR_NOT_FOUND/.test(err.code)) {
+          // 如果是其他错误的话,则继续往下执行
+          this.$router.push({
+            path: 'parkingFeeMsg',
+            query: {
+              type: 'fail'
+            }
+          })
+        }
       }
     },
     // 前往支付

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

@@ -343,6 +343,17 @@ export default {
                 }, 1000)
               return
             }
+            if ( /CAR_NOT_FOUND/.test(res.code) ) {
+              setTimeout(() => {
+                this.$router.replace({
+                  path: 'parkingFeeMsg',
+                  query: {
+                    type: 'outFail'
+                  }
+                })  
+              }, 300)
+              return;
+            }
             if (/NOT_FOUND|PARKING_RECORD_NOT_FOUND/.test(res.code)) {
               // 当前车辆没有查到账单
               this.$router.replace({

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

@@ -102,6 +102,7 @@ export default {
     },
     // 唤起键盘
     clickShowKeyboard(index) {
+      if ( this.carType !== 1 && index === 7) return
       this.ind = index;
       this.active = index;
       // console.log('唤起键盘', this.ind, this.active);

+ 117 - 37
src/pages/parkingFee/parkingFeeMsg.vue

@@ -40,13 +40,27 @@
       <img class="pay-log" :src="require(`./static/images/unlicensed/pay.svg`)" />
       <span class="info">您已缴费成功,欢迎下次光临</span>
     </div>
+    <!-- 出场临牌:失败 -->
+    <div class="fail-box" v-if="type === 'outFail'">
+      <img class="out-fail-log" :src="require(`./static/images/unlicensed/no-car-out.svg`)" />
+      <k-button disabledColor="#D1D2D9" @click="scanCarCode">
+        <template v-slot:left>
+          <img class="unlicensed-scan" :src="`${require(`./static/images/unlicensed-scan.png`)}`" />
+        </template>
+        重新扫码
+      </k-button>
+<!--      <span class="info">您已缴费成功,欢迎下次光临</span>-->
+    </div>
   </div>
 </template>
 
 <script>
+import { qrCodes,unlicensedCarCheckIn } from "@/api/parking";
 import uni from '@/utils/uniHooks';
 import { initWxJsSdkConfig } from '@/utils/login';
-import { getPlatform } from '@/utils/index';
+import { getPlatform,getUrlParams } from '@/utils/index';
+import {mapState} from "vuex";
+
 export default {
   name: 'parkingFeeMsg',
   data() {
@@ -56,6 +70,11 @@ export default {
       vehicleNo: '',
     };
   },
+  computed:{
+    ...mapState({
+      unlicensedInfo: (state) => state.unlicensedInfo,
+    })
+  },
   async created() {
     setTimeout(() => {
       uni.setNavigationBarTitle({
@@ -67,37 +86,32 @@ export default {
       await initWxJsSdkConfig(['checkJsApi', 'scanQRCode']);
     }
     console.log(this.$route.query);
-    if (this.$route.query?.type) {
-      this.type = this.$route.query?.type;
-    }
-    if (this.type === 'success') {
-      this.vehicleNo = this.$route.query?.vehicleNo;
-    }
+    this.pageInit()
   },
   mounted() {},
   methods: {
+    pageInit(){
+      if (this.$route.query?.type) {
+        this.type = this.$route.query?.type;
+      }
+      if (this.type === 'success') {
+        this.vehicleNo = this.$route.query?.vehicleNo;
+      }
+      this.$store.commit('SET_UNLICENSED_INFO', {});
+    },
     // 无牌车闸机扫码
     scanCarCode() {
       const runScanFn = (res) => {
-        if (res.scanType == 'QR_CODE' && res.scanType) {
-          console.log(res.result);
-          // 获取二维码参数之后,模拟提取参数
-          const url = res.result;
-          if (url.indexOf('auth/') === -1) {
-            // 单纯的code
-            console.log('提取到的参数', res.result);
-            // this.getPaperCouponInfo(res.result);
-          } else {
-            // 从url中提取参数
-            const start = url.indexOf('auth/');
-            const end = url.indexOf('?');
-            const params = url.slice(start, end).split('/');
-            if (params && params.length) {
-              const couponCode = params[1];
-              console.log('提取到的参数', couponCode);
-              // this.getPaperCouponInfo(couponCode);
-            }
-          }
+        /*
+         针对微信的小程序码进行的兼容改造
+         微信扫码结束之后的返回参数 {"errMsg": "scanCode:ok", "scanType": "WX_CODE", "charSet": "ISO8859-1", "rawData": "bGsoP3gyT1Aud3QpbW1JeHRfVHJsUjg4JnR5cGU9dW5saWNlbnNlZElu", "path": "pages/automatic/automaticIndex?scene=code%3D9988%26type%3DunlicensedIn"}
+         */
+        if(res.scanType && res.scanType === 'WX_CODE') {
+          const params = getUrlParams(`?${decodeURIComponent(res.path.replace(/.*scene=/g, ''))}`)
+          this.$store.commit('SET_UNLICENSED_INFO', params);
+          this.$nextTick(() => {
+            this.qrCodesRule(params.code);
+          })
         }
       };
       // 微信小程序
@@ -127,6 +141,62 @@ 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', {
+          name: 'parkingFeeDetail',
+        });
+        if (this.unlicensedInfo?.type === 'unlicensedOut') {
+          setTimeout(() => {
+            this.$router.replace({
+              path: 'parkingFeeDetail',
+              query: {
+                gateId: qrCodesres.gateId,
+                vehicleNo: '',
+                type: 'unlicensedOut'
+              }
+            })  
+          }, 300)
+          return
+        }
+        // 如果是无牌车扫码:入场
+        const unlicensedCarCheckInres = await unlicensedCarCheckIn({ // 获取无牌车牌
+          gateId: qrCodesres.gateId
+        });
+        // 前往 缴费支付页面
+        this.$router.replace({
+          path: 'parkingFeeMsg',
+          query: {
+            type: 'success',
+            vehicleNo: unlicensedCarCheckInres.vehicleNo
+          }
+        })
+      } catch (err) {
+        // 车场扫描道闸入口,发现无车/车场扫描道闸入口,发现有牌车 >>> 停止往下执行,默认提示报错信息
+        if (/CAR_HAS_PLATE/.test(err.code)) {
+          return
+        }
+        if (/CAR_NOT_FOUND/.test(err.code)) {
+          setTimeout(() => {
+            // 如果是其他错误的话,则继续往下执行
+            this.$router.replace({
+              path: 'parkingFeeMsg',
+              query: {
+                type: this.unlicensedInfo?.type === 'unlicensedOut' ? 'outFail' : 'fail'
+                // this.type
+              }
+            }) 
+            this.pageInit()
+          }, 300)
+        }
+      }
+    },
     goHome() {
       this.$router.replace({
         path: 'home',
@@ -138,11 +208,12 @@ export default {
 
 <style lang="less" scoped>
 .bg {
-  background-color: #fbfcff;
+  background-color: #FBFCFF;
 }
 .pay-box {
   text-align: center;
-  margin-top: 84px;
+  //margin-top: 84px;
+  padding-top: 84px;
   .pay-log {
     width: 523px;
     display: block;
@@ -161,9 +232,10 @@ export default {
 
 .success-box,
 .fail-box {
-  margin-top: 123px;
+  //margin-top: 123px;
+  //padding-top: 123px;
   text-align: center;
-  padding: 0 24px;
+  padding: 123px 24px 0;
   .icon {
     width: 80px;
     height: 80px;
@@ -177,6 +249,7 @@ export default {
     font-size: 36px;
     line-height: 50px;
     color: #333333;
+    margin-bottom: 42px;
   }
   .status-info {
     font-family: 'PingFang SC';
@@ -189,25 +262,24 @@ export default {
   }
   .card-box {
     height: 230px;
-    margin-top: 39px;
+    margin-top: 42px;
     margin-bottom: 52px;
     background: #fbfcff;
     border: 1px solid #d9dbe0;
     border-radius: 4px;
     display: flex;
-    // align-items: center;
-    // padding-top: 53px;
-    // padding-left: 18px;
-    // padding-bottom: 34px;
 
     img {
       width: 288px;
       height: 142px;
-      margin-top: 62px;
       display: block;
+      margin: auto 0;
     }
     .car-number {
-      margin-top: 68px;
+      //margin-top: 68px;
+      display: flex;
+      flex-direction: column;
+      justify-content: center;
       .number {
         font-size: 50px;
         line-height: 56px;
@@ -218,9 +290,17 @@ export default {
       }
       .tips {
         color: #999999;
+        text-align: left;
       }
     }
   }
+  .out-fail-log {
+    width: 535px;
+    height: 410px;
+    display: block;
+    margin:  0 auto 68px;
+  }
+  
   .unlicensed-scan {
     width: 60px;
     height: 60px;

+ 3 - 0
src/pages/parkingFee/static/images/unlicensed/leaf.svg

@@ -0,0 +1,3 @@
+<svg width="41" height="39" viewBox="0 0 41 39" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M1.48943 39C0.667587 39 0 38.3198 0 37.4824C0 32.2826 1.49216 29.9956 4.43693 25.1937C3.68332 24.092 3.11268 22.9026 2.73723 21.6534C1.64369 18.0199 1.90581 14.3572 2.46146 12.3263C3.29834 9.26729 4.71954 6.8997 6.80283 5.08853C8.72368 3.41926 11.2275 2.22432 14.4562 1.43696C19.932 0.102935 27.225 5.90412e-07 36.9316 5.90412e-07H39.5064C39.9377 -0.00038748 40.3479 0.190547 40.63 0.523051L40.6368 0.529985L40.6504 0.546709C40.9331 0.890292 41.0532 1.33959 40.9781 1.78195C39.6784 9.43286 37.6497 15.7218 34.9507 20.4751C32.6258 24.5649 29.7766 27.5807 26.4823 29.4378C23.8802 30.904 21.0297 31.6468 18.0112 31.6468C17.446 31.6468 16.8835 31.6218 16.3402 31.5731C13.7995 31.3505 11.7435 30.6689 10.4643 30.1375C9.8773 29.8913 9.2957 29.595 8.7346 29.2542C8.03015 28.8271 7.7967 27.8937 8.21581 27.1746C8.48339 26.7169 8.9735 26.4331 9.4964 26.4331C9.76401 26.4333 10.0267 26.5068 10.2568 26.6459C10.6923 26.9102 11.1415 27.1384 11.5906 27.3262C12.7483 27.8088 15.117 28.6199 17.9825 28.6199C20.5013 28.6199 22.8754 28.0008 25.0379 26.7809C31.109 23.3574 35.3753 15.3713 37.7234 3.03811H37.0736C17.5061 3.03811 7.98236 3.46795 5.33251 13.1456C4.97209 14.4629 4.62121 17.5525 5.58779 20.7673C5.76253 21.3515 5.99871 21.9233 6.28954 22.4755C7.26154 21.1804 8.3196 19.9466 9.4445 18.8017C11.9497 16.2463 14.8002 14.0804 17.6849 12.5405C20.5505 11.0089 23.2549 10.1993 25.5035 10.1993C26.324 10.1993 26.9929 10.8796 26.9929 11.717C26.9929 12.553 26.3253 13.2346 25.5035 13.2346C23.7601 13.2346 21.4734 13.9427 19.0638 15.2266C16.4494 16.6219 13.85 18.5986 11.5469 20.9453C8.34689 24.2046 2.97752 28.2665 2.97752 37.481C2.97887 38.3198 2.30993 39 1.48943 39Z" fill="#7DB124"/>
+</svg>

Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 0
src/pages/parkingFee/static/images/unlicensed/no-car-out.svg


Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor