Эх сурвалжийг харах

Merge pull request #312 from John-Hong/John/release-2.19.0/KIP-12669

John/release 2.19.0/kip 12669
Tron 1 жил өмнө
parent
commit
bb59956c2a

+ 97 - 0
src/api/mockData/checkout.pd20.response.json

@@ -0,0 +1,97 @@
+{
+  "parkingRecord": {
+    "vehicleNo": "沪A00001",
+    "enterTime": "2023-10-11 10:54:00",
+    "serviceMin": 13302,
+    "totalFee": 6600,
+    "actualPayFee": 66.0,
+    "thirdParkOrderNo": "s2023102016383185e0a29af8",
+    "createdByQrCode": false,
+    "getTime": "2023-10-20 16:38:32",
+    "totalFeeInYuan": 66.00
+  },
+  "discountInfo": {
+    "usingTotalDiscount": 0,
+    "memberLevelDiscount": false,
+    "memberGrade": [
+      {
+        "selected": false
+      }
+    ],
+    "consume": [
+      {
+        "defaultSelected": true,
+        "selected": false,
+        "defaultDiscountTime": 1,
+        "discountFee": 12,
+        "redeemSalesAmount": 300,
+        "couponCodes": "sbyqi4igrxd_t"
+      }
+    ],
+    "points": [
+      {
+        "available": 14800,
+        "selected": true,
+        "pointsPerUnit": 1000,
+        "unitAmount": 12,
+        "totalAvailable": 14800,
+        "unitHour": 1,
+        "newMember": false,
+        "label": "14800积分可减免",
+        "discountFee": 0
+      }
+    ],
+    "coupons": [
+      {
+        "code": "wtxr3y5e8wo_t",
+        "couponId": "01e3321b0acb41079b9d654c3c376d75",
+        "selected": false,
+        "status": "available",
+        "name": "停车优惠券",
+        "expirationDate": "2023-10-23 23:59:59",
+        "discountFee": 12,
+        "defaultSelected": false,
+        "superposition": "2",
+        "limitCountPerOrder": 2
+      },
+      {
+        "code": "lqzparjeo7t_t",
+        "couponId": "01e3321b0acb41079b9d654c3c376d75",
+        "selected": false,
+        "status": "available",
+        "name": "停车优惠券",
+        "expirationDate": "2023-10-23 23:59:59",
+        "discountFee": 12,
+        "defaultSelected": false,
+        "superposition": "2",
+        "limitCountPerOrder": 2
+      }
+    ],
+    "paperCoupons": [
+      {
+        "description": "纸质优惠券不限制会员使用。",
+        "selected": false
+      }
+    ]
+  },
+  "parkingRule": {
+    "maxOneTimeDiscountTime": 2,
+    "enableNewMemberPoints": false,
+    "enablePoints": true,
+    "unLimitWeekendPoints": false,
+    "enableCoupon": true,
+    "enablePaperCoupons": true,
+    "enableConsume": true,
+    "enableConsumeNonSplit": false,
+    "remainConsumeTime": 3,
+    "hourPrice": 12,
+    "oneTimeLimitation": true,
+    "oneDayLimitation": false
+  },
+  "parkInfo": {
+    "parkName": "PD",
+    "description": "12元/小时。8-24小时封顶96元。纸质优惠券不限制使用数量。每次最多优惠2小时。积分兑换停车费用1200积分=1小时。积分商城售卖停车电子券的使用类型。单日累计消费满300元赠送1张消费600元赠2张1小时的停车券,不重复发券,消费跨天不累计,",
+    "parkMallCode": 1,
+    "buildingId": "184-100035"
+  }
+}

+ 1 - 1
src/components/checkCarPopup/checkCarPopup.vue

@@ -1,5 +1,5 @@
 <template>
-  <van-popup v-model="show">
+  <van-popup v-model="show"  :style="{ top: '480px' }">
     <div class="popup-box">
       <img class="unlicensed" :src="`${require(`../../pages/parkingFee/static/images/vnfo-2.19.svg`)}`"
            alt="unlicensed"/>

+ 2 - 2
src/components/plate-number/plateNumber.vue

@@ -545,14 +545,14 @@ export default {
 };
 </script>
 
-<style lang="less">
+<style lang="less" scoped>
 .class-van-button-small {
   min-width: 0;
   border-radius: 10px;
   margin: 6px 3px;
   box-shadow: 0px 2px 0px #9da0a3;
 }
- .van-overlay {
+ ::v-deep .van-overlay {
    background-color: rgba(0,0,0,0.1);
  }
 .event-box {

+ 14 - 4
src/pages/parkingFee/mixins/parkingFee.js

@@ -364,7 +364,7 @@ export default {
         }
       }
     },
-    async checkEligibility() {
+    async checkEligibility(vehicleNumber = this.vehicleNumber) {
       try {
         /*
         * 如果是杭州,并且是登陆情况
@@ -384,7 +384,7 @@ export default {
         * 
         * */
         // 如果是杭州,并且是登陆情况
-        this.eligibility = await checkEligibility(this.vehicleNumber)
+        this.eligibility = await checkEligibility(vehicleNumber)
         /*this.eligibility = {
           "eligible": false, // 是否优惠车
           "isBound": false, // 是否绑定
@@ -410,9 +410,9 @@ export default {
                   userId: this.kipUserId,
                   licensePlateType: LICENSE_PLATE_TYPE_ARR[this.carType].value,
                   vehicleNo: this.vehicleNumber,
-                })
+              })
               if(res?.id) {
-                this.toParkingFeeDetail()
+                this.toParkingFeeDetail()  
               }
             },
             bottomBtnFn: () => {
@@ -491,6 +491,16 @@ export default {
       })
     },
     // 历史车牌快速查询
+    async toHandleSearchBefore(vehicleNo) {
+      // 不是杭州的车牌 或者 用户拒绝登陆的场景
+      if (!isHZ(this.mallId) || this.$route.query.isLogin === 'loginDenied')  {
+        this.toHandleSearch(vehicleNo)
+        return
+      }
+      // 查询车辆优惠资格并提示跳转页面
+      await this.checkEligibility(vehicleNo)
+      
+    },
     toHandleSearch(vehicleNo) {
       uni.setStorageSync('carList', [...new Set([vehicleNo, ...this.carList])].slice(0, 6));
       this.$store.commit('cachedViews/DEL_CACHED_VIEW', {

+ 14 - 5
src/pages/parkingFee/mixins/vehicleManagement.js

@@ -17,7 +17,7 @@ import uni from '@/utils/uniHooks.js';
 // import { vehicles as vehiclesList } from './list';
 import { wxToLoginCallback, isHZ } from '@/utils/index';
 import { Toast } from 'vant';
-import { getVehicles, delVehicle } from '@/api/parking/index'
+import { getVehicles, delVehicle, parkingLots } from '@/api/parking/index'
 
 export default {
   components: {
@@ -55,11 +55,14 @@ export default {
       deleteDialogSwitch: false,
       deleteSuccessDialogSwitch: false,
       show: false, // 删除车牌时提示内容
+      parkingLotsInfo: {},
+      enableDiscountVehicle: false
     };
   },
 
   async created() {
     this.options = this.$route.query;
+    this.parkingLots()
   },
   async mounted() {
     setTimeout(() => {
@@ -121,6 +124,12 @@ export default {
     // #endif
   },
   methods: {
+    // 获取车场信息
+    async parkingLots() {
+      const res = await parkingLots(this.$store.state.lbsId)
+      this.parkingLotsInfo = res;
+      this.enableDiscountVehicle = res.enableDiscountVehicle;
+    },
     // 添加车牌号
     toAdd() {
       if(this.isNoLogin) return
@@ -129,7 +138,7 @@ export default {
     // 跳转支付页面
     toPayBefore(item) {
       // 不是杭州的车牌 或者 是非优惠的车牌
-      if(!this.isHZ || item.eligible){
+      if(!this.isHZ || !item.eligible || !this.enableDiscountVehicle){
         this.toPay(item.vehicleNo)
         return
       }
@@ -264,7 +273,7 @@ export default {
       this.activeId = item.id;
       this.activeCarno = item.vehicleNo;
       // 不是杭州的车牌 或者 是非优惠的车牌
-      if(!this.isHZ || !item.eligible) {
+      if(!this.isHZ || !item.eligible || !this.enableDiscountVehicle) {
         this.show = true
         return
       }
@@ -296,8 +305,8 @@ export default {
     },
     // 编辑
     toEditBefore(item) {
-      // TODO 不是杭州的车牌 或者 是非优惠的车牌
-      if(!this.isHZ || !item.eligible){
+      // 不是杭州的车牌 或者 是非优惠的车牌
+      if(!this.isHZ || !item.eligible || !this.enableDiscountVehicle){
         this.toEdit(item)
         return
       }

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

@@ -97,7 +97,7 @@
                   <!-- <image src="./static/images/icon5.png" class="vehicleMgt-title-img"/> -->
                 </div>
                 <div class="vehicleMgt-content" v-if="carList.length">
-                  <div class="item" v-for="(item, index) in carList" :key="index" @click="toHandleSearch(item, 1)" :class="vehicleNumber == item ? 'vehicleMgt-content_cls' : ''">
+                  <div class="item" v-for="(item, index) in carList" :key="index" @click="toHandleSearchBefore(item, 1)" :class="vehicleNumber == item ? 'vehicleMgt-content_cls' : ''">
                     {{ item | formatCarno }}
                   </div>
                 </div>

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

@@ -20,7 +20,7 @@
               我的车牌
             </div>
 <!--            <img v-if="isHZ && item.eligible" class="discountCar" :src="`${require(`@/pages/parkingFee/static/images/${source ==='KIP' ? 'discountCarOffice': 'discountCar' }.svg`)}`" />-->
-            <div class="discountCar" v-if="isHZ && item.eligible">
+            <div class="discountCar" v-if="isHZ && item.eligible && this.enableDiscountVehicle">
               优惠车
             </div>
             <div class="plate_plate_index plate_plate_index2">

+ 14 - 5
src/pages/parkingFeeV2/mixins/parkingFee.js

@@ -210,9 +210,8 @@ export default {
         title: '加载中',
       });
       try {
-        // console.log('加载车场信息', this.$store.state.lbsId);
-        // const res = await parkingLots('8aaa82ea804d07cd0180516ff03b0008'); // TODO: 临时写死
-        const res = await parkingLots(this.$store.state.lbsId); // TODO: 临时写死
+        // 加载车场信息
+        const res = await parkingLots(this.$store.state.lbsId);
         // console.log(res);
         let reg = /[;;]/g;
         this.description = res?.description?.replace(reg, '\r\n').replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>');
@@ -271,7 +270,7 @@ export default {
         }
       }
     },
-    async checkEligibility() {
+    async checkEligibility(vehicleNumber = this.vehicleNumber) {
       try {
         /*
         * 如果是杭州,并且是登陆情况
@@ -291,7 +290,7 @@ export default {
         * 
         * */
         // 如果是杭州,并且是登陆情况
-        this.eligibility = await checkEligibility(this.vehicleNumber)
+        this.eligibility = await checkEligibility(vehicleNumber)
         /*this.eligibility = {
           "eligible": false, // 是否优惠车
           "isBound": false, // 是否绑定
@@ -398,6 +397,16 @@ export default {
       })
     },
     // 历史车牌快速查询
+    async toHandleSearchBefore(vehicleNo) {
+      // 不是杭州的车牌 或者 用户拒绝登陆的场景
+      if (!isHZ(this.mallId) || this.$route.query.isLogin === 'loginDenied')  {
+        this.toHandleSearch(vehicleNo)
+        return
+      }
+      // 查询车辆优惠资格并提示跳转页面
+      await this.checkEligibility(vehicleNo)
+      
+    },
     toHandleSearch(vehicleNo) {
       uni.setStorageSync('carList', [...new Set([vehicleNo, ...this.carList])].slice(0, 6));
       this.$store.commit('cachedViews/DEL_CACHED_VIEW', {

+ 8 - 2
src/pages/parkingFeeV2/mixins/parkingFeeDiscounts.js

@@ -318,9 +318,14 @@ export default {
         // 转化公式之后
         // this.maxReduceDiscount = remainConsumeTime > couponCodesLength ? couponCodesLength : remainConsumeTime
         // console.log(319, this.remainPrice >= maxOneTimeDiscountFee)
-        this.maxReduceDiscount = couponCodesLength > defaultDiscountTime ? defaultDiscountTime> remainHour > defaultDiscountTime ? defaultDiscountTime : remainHour : remainHour > couponCodesLength?couponCodesLength:remainHour; 
+        // this.maxReduceDiscount = couponCodesLength > defaultDiscountTime ? defaultDiscountTime> remainHour > defaultDiscountTime ? defaultDiscountTime : remainHour : remainHour > couponCodesLength?couponCodesLength:remainHour;
+        this.maxReduceDiscount = defaultDiscountTime;
+        // 323323323 3 2 2 2
+        // 323323323 3 1 2 1
+        // console.log('323323323', couponCodesLength, remainHour, defaultDiscountTime, this.reduceHours )
+        
         // this.reduceHours = this.maxReduceDiscount
-        !isSelected && (this.reduceHours = this.maxReduceDiscount)
+        !isSelected && remainHour - defaultDiscountTime > 0 && (this.reduceHours = 1)
         return
         // 如果超过限制就置灰
         // const maxOneTimeDiscountTimeFee = (couponCodes.split('#').length) * hourPrice
@@ -464,6 +469,7 @@ export default {
             // this.isReduces = false;
             return
           }
+          return;
         }
          if (this.parkMallCode !== 4 && this.parkMallCode !== 6) {
            // 如果不是沈阳,重新计算计算最大上限

+ 13 - 4
src/pages/parkingFeeV2/mixins/vehicleManagement.js

@@ -17,7 +17,7 @@ import uni from '@/utils/uniHooks.js';
 // import { vehicles as vehiclesList } from './list';
 import {isHZ, wxToLoginCallback} from '@/utils/index';
 import { Toast } from 'vant';
-import { getVehicles, delVehicle } from '@/api/parking/index'
+import { getVehicles, delVehicle, parkingLots } from '@/api/parking/index'
 
 export default {
   components: {
@@ -56,11 +56,14 @@ export default {
       deleteDialogSwitch: false,
       deleteSuccessDialogSwitch: false,
       show: false, // 删除车牌时提示内容
+      parkingLotsInfo: {},
+      enableDiscountVehicle: false
     };
   },
 
   async created() {
     this.options = this.$route.query;
+    this.parkingLots()
   },
   async mounted() {
     // setTimeout(() => {
@@ -139,6 +142,12 @@ export default {
     // #endif
   },
   methods: {
+    // 获取车场信息
+    async parkingLots() {
+      const res = await parkingLots(this.$store.state.lbsId)
+      this.parkingLotsInfo = res;
+      this.enableDiscountVehicle = res.enableDiscountVehicle;
+    },
     // 添加车牌号
     toAdd() {
       if (this.isNoLogin) return
@@ -147,7 +156,7 @@ export default {
     // 跳转支付页面
     toPayBefore(item) {
       // 不是杭州的车牌 或者 是非优惠的车牌
-      if(!this.isHZ || item.eligible){
+      if(!this.isHZ || !item.eligible || !this.enableDiscountVehicle){
         this.toPay(item.vehicleNo)
         return
       }
@@ -164,7 +173,7 @@ export default {
     // 编辑
     toEditBefore(item) {
       // 不是杭州的车牌 或者 是非优惠的车牌
-      if(!this.isHZ || !item.eligible){
+      if(!this.isHZ || !item.eligible || !this.enableDiscountVehicle){
         this.toEdit(item)
         return
       }
@@ -319,7 +328,7 @@ export default {
       this.activeId = item.id;
       this.activeCarno = item.vehicleNo;
       // 不是杭州的车牌 或者 是非优惠的车牌
-      if(!this.isHZ || !item.eligible) {
+      if(!this.isHZ || !item.eligible || !this.enableDiscountVehicle) {
         this.show = true
         return
       }

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

@@ -95,7 +95,7 @@
                   <!-- <image src="./static/images/icon5.png" class="vehicleMgt-title-img"/> -->
                 </div>
                 <div class="vehicleMgt-content" v-if="carList.length">
-                  <div class="item" v-for="(item, index) in carList" :key="index" @click="toHandleSearch(item, 1)" :class="vehicleNumber == item ? 'vehicleMgt-content_cls' : ''">
+                  <div class="item" v-for="(item, index) in carList" :key="index" @click="toHandleSearchBefore(item, 1)" :class="vehicleNumber == item ? 'vehicleMgt-content_cls' : ''">
                     {{ item | formatCarno }}
                   </div>
                 </div>

+ 1 - 1
src/pages/parkingFeeV2/vehicleManagement.vue

@@ -20,7 +20,7 @@
               我的车牌
             </div>
             <!-- <img v-if="isHZ && item.eligible" class="discountCar" :src="`${require(`@/pages/parkingFee/static/images/${source ==='KIP' ? 'discountCarOffice': 'discountCar' }.svg`)}`" />-->
-            <div class="discountCar" v-if="isHZ && item.eligible">
+            <div class="discountCar" v-if="isHZ && item.eligible && enableDiscountVehicle">
               优惠车
             </div>
             <div class="plate_plate_index plate_plate_index2">

+ 1 - 1
src/store/order/index.js

@@ -1,4 +1,4 @@
-import checkOutQHResponse from "@/api/mockData/checkout.bj2.response.json";
+import checkOutQHResponse from "@/api/mockData/checkout.pd17.response.json";
 import { checkOut,calculateDiscount,ordersAndPrepay,currentUnlicensedPlate,unlicensedCarCheckIn,unlicensedCarCheckout } from '@/api/parking';
 import state from "@/store/order/state";
 import mutations from "@/store/order/mutations";