john 2 years ago
parent
commit
f6c3c28150

+ 62 - 0
src/api/mockData/checkout.pd3.response.json

@@ -0,0 +1,62 @@
+{
+  "parkingRecord": {
+    "vehicleNo": "沪D00020",
+    "enterTime": "2023-04-25 08:46:00",
+    "serviceMin": 378,
+    "totalFee": 700,
+    "actualPayFee": 0,
+    "thirdParkOrderNo": "4970693",
+    "createdByQrCode": false,
+    "totalFeeInYuan": 7
+  },
+  "discountInfo": {
+    "usingTotalDiscount": 10,
+    "memberLevelDiscount": true,
+    "memberGrade": [
+      {
+        "defaultSelected": true,
+        "memberGrade": "01",
+        "memberGradeText": "嘉友卡",
+        "discountTime": 1,
+        "discountFee": 10
+      }
+    ],
+    "points": [
+      {
+        "available": 10000,
+        "pointsPerUnit": 1200,
+        "unitAmount": 0,
+        "newMember": false,
+        "label": "10000积分可减免"
+      }
+    ],
+    "paperCoupons": [
+      {
+        "description": "纸质优惠券不限制会员使用。"
+      }
+    ]
+  },
+  "parkingRule": {
+    "maxOneTimeDiscountTime": 10, 单次最多
+    "enableNewMemberPoints": false, 
+    "enablePoints": true,
+    "oneDayLimitation": true,
+    "oneTimeLimitation": true,
+    "enableCoupon": false,
+    "maxOneDayCoupons": 5,
+    "remainCoupons": 5, 保留优惠券
+    "enablePaperCoupons": true,
+    "paperCouponsDescription": "纸质优惠券不限制会员使用。",
+    "enableConsume": false, 启用消费
+    "enableConsumeSplit": false, 启用消费拆分
+    "maxConsumeTime": 0, 最大消耗时间
+    "remainConsumeTime": 0,  剩余消费时间
+    "hourPrice": 10 每小时单价
+  },
+  "parkInfo": {
+    "parkName": "浦东嘉里停车场",
+    "description": "12元/小时。8-24小时封顶96元。纸质优惠券不限制使用数量。每次最多优惠2小时。积分兑换停车费用1200积分=1小时。积分商城售卖停车电子券的使用类型。单日累计消费满300元赠送1张消费600元赠2张1小时的停车券,不重复发券,消费跨天不累计,优惠有效期7天",
+    "parkMallCode": 1,
+    "buildingId": "PKC-P1"
+  }
+}

+ 96 - 0
src/api/mockData/checkout.pd6.response.json

@@ -0,0 +1,96 @@
+{
+  "parkingRecord": {
+    "vehicleNo": "沪K10003",
+    "enterTime": "2023-04-27 12:59:00",
+    "serviceMin": 1696,
+    "totalFee": 2500,
+    "actualPayFee": 0,
+    "thirdParkOrderNo": "4970706",
+    "createdByQrCode": false,
+    "totalFeeInYuan": 25
+  },
+  "discountInfo": {
+    "usingTotalDiscount": 36,
+    "memberLevelDiscount": true,
+    "memberGrade": [
+      {
+        "defaultSelected": true,
+        "memberGradeText": "嘉礼卡",
+        "discountTime": 1,
+        "discountFee": 12
+      }
+    ],
+    "consume": [
+      {
+        "defaultSelected": true,
+        "defaultDiscountTime": 1,
+        "discountFee": 12,
+        "redeemSalesAmount": 10
+      }
+    ],
+    "points": [
+      {
+        "available": 1234,
+        "pointsPerUnit": 1000,
+        "unitAmount": 1,
+        "newMember": false,
+        "label": "1234积分可减免"
+      }
+    ],
+    "coupons": [
+      {
+        "code": "fvqwcec9tnx_t",
+        "name": "积分商城兑换券",
+        "expirationDate": "2023-03-29 23:59:59",
+        "discountFee": 12,
+        "defaultSelected": true,
+        "superposition": "2",
+        "limitCountPerOrder": 5
+      },
+      {
+        "code": "pua6du6eqjm_t",
+        "name": "积分商城兑换券",
+        "expirationDate": "2023-03-30 23:59:59",
+        "discountFee": 36,
+        "defaultSelected": false,
+        "superposition": "1",
+        "limitCountPerOrder": 0
+      },
+      {
+        "code": "xyzr0yyxca0_t",
+        "name": "积分商城兑换券",
+        "expirationDate": "2023-03-31 23:59:59",
+        "discountFee": 24,
+        "defaultSelected": false,
+        "superposition": "2",
+        "limitCountPerOrder": 5
+      }
+    ],
+    "paperCoupons": [
+      {
+        "description": "paper coupon 描述"
+      }
+    ]
+  },
+  "parkingRule": {
+    "maxOneTimeDiscountTime": 5,
+    "enableNewMemberPoints": false,
+    "enablePoints": true,
+    "enableCoupon": true,
+    "enablePaperCoupons": true,
+    "paperCouponsDescription": "paper coupon 描述",
+    "enableConsume": true,
+    "enableConsumeSplit": false,
+    "maxConsumeTime": 5,
+    "remainConsumeTime": 5,
+    "hourPrice": 12,
+    "oneTimeLimitation": true,
+    "oneDayLimitation": false
+  },
+  "parkInfo": {
+    "parkName": "浦东嘉里停车场",
+    "description": "深圳停车场最新描述涨价到10块一小时",
+    "parkMallCode": 1,
+    "buildingId": "PKC-P1"
+  }
+}

+ 15 - 3
src/pages/parkingFee/mixins/parkingFeeDiscounts.js

@@ -129,6 +129,17 @@ export default {
           }
           }
           orderDetail.discountInfo.paperCoupons = paperCoupons
           orderDetail.discountInfo.paperCoupons = paperCoupons
         }
         }
+        // 电子券:coupons
+        if ( orderDetail.discountInfo.coupons.length ) {
+          let coupons = orderDetail.discountInfo.coupons
+          coupons = coupons.map(item => {
+            return {
+              ...item,
+              selected: item.hasOwnProperty('selected') ? item.selected : item.defaultSelected
+            }
+          })
+          orderDetail.discountInfo.coupons = coupons
+        }
         this.$store.dispatch('order/saveDiscounts', {orderDetail,  callback: () => this.$router.back()})
         this.$store.dispatch('order/saveDiscounts', {orderDetail,  callback: () => this.$router.back()})
       } else {
       } else {
         this.$router.back();
         this.$router.back();
@@ -139,7 +150,7 @@ export default {
     // 验证当前的选项是否可选择
     // 验证当前的选项是否可选择
     isCheck( callback ) {
     isCheck( callback ) {
       const {parkInfo,parkingRule,discountInfo} = this.orderDetail
       const {parkInfo,parkingRule,discountInfo} = this.orderDetail
-      const {maxOneTimeDiscountTime,oneTimeLimitation,oneDayLimitation,hourPrice,remainConsumeTime} = parkingRule
+      const {maxOneTimeDiscountTime, maxOneDayDiscountFee, oneTimeLimitation, oneDayLimitation, hourPrice, remainConsumeTime} = parkingRule
       console.log(129, this.parkMallCode)
       console.log(129, this.parkMallCode)
       // 浦东
       // 浦东
       if ( this.parkMallCode === 1 ) {
       if ( this.parkMallCode === 1 ) {
@@ -147,8 +158,9 @@ export default {
         const remainConsumeTimeFee = remainConsumeTime * hourPrice
         const remainConsumeTimeFee = remainConsumeTime * hourPrice
         console.log(133, this.usingTotalDiscount, remainConsumeTimeFee, maxOneTimeDiscountFee )
         console.log(133, this.usingTotalDiscount, remainConsumeTimeFee, maxOneTimeDiscountFee )
         console.log('this.isMember', this.usingTotalDiscount, remainConsumeTimeFee, maxOneTimeDiscountFee, this.memberLevelDiscount)
         console.log('this.isMember', this.usingTotalDiscount, remainConsumeTimeFee, maxOneTimeDiscountFee, this.memberLevelDiscount)
-        this.isMember = !(this.usingTotalDiscount + remainConsumeTimeFee < maxOneTimeDiscountFee && this.memberLevelDiscount)
-        this.isReduces = !(this.usingTotalDiscount + remainConsumeTimeFee < maxOneTimeDiscountFee && this.enableConsume)
+        // TODO: 统计纸质优惠券的总金额, usingTotalDiscount - 纸质优惠券的总金额,才是用户当前订单使用的优惠总数 
+        this.isMember = !(this.usingTotalDiscount < (oneTimeLimitation ? maxOneTimeDiscountFee:maxOneDayDiscountFee ) && this.memberLevelDiscount)
+        this.isReduces = !(this.usingTotalDiscount < (oneTimeLimitation ? maxOneTimeDiscountFee:maxOneDayDiscountFee ) && this.enableConsume)
       }
       }
       // if ( this.checkedTotal === 2 ) {
       // if ( this.checkedTotal === 2 ) {
       //   if ( this.checkedList.indexOf(type) > -1 ) {
       //   if ( this.checkedList.indexOf(type) > -1 ) {

+ 10 - 2
src/pages/parkingFee/mixins/parkingFeePaperCoupon.js

@@ -5,7 +5,7 @@ const app = {};
 import { mapState } from 'vuex';
 import { mapState } from 'vuex';
 import fuiToast from '@/components/fui-toast/fui-toast.vue';
 import fuiToast from '@/components/fui-toast/fui-toast.vue';
 import { initWxJsSdkConfig } from '@/utils/login';
 import { initWxJsSdkConfig } from '@/utils/login';
-import { getPlatform } from '@/utils/index';
+import { getPlatform } from '@/utils';
 
 
 export default {
 export default {
   components: {
   components: {
@@ -17,7 +17,7 @@ export default {
   data() {
   data() {
     return {
     return {
       parkFee: {}, // 停车规则相关信息
       parkFee: {}, // 停车规则相关信息
-      parkPaperCouponRemark: '', // 纸质优惠券说明
+      // parkPaperCouponRemark: '', // 纸质优惠券说明
       servicefee: 0, // 应缴金额
       servicefee: 0, // 应缴金额
       paperDiscountFee: 0, // 纸质优惠券减免金额
       paperDiscountFee: 0, // 纸质优惠券减免金额
       paperDiscountTime: 0, // 纸质优惠券减免时长
       paperDiscountTime: 0, // 纸质优惠券减免时长
@@ -58,6 +58,7 @@ export default {
       openId: (state) => state.openid,
       openId: (state) => state.openid,
       member: (state) => state.member,
       member: (state) => state.member,
       groupId: (state) => state.groupId,
       groupId: (state) => state.groupId,
+      orderDetail: (state) => state.order.orderDetail
     }),
     }),
     // 实际支付金额
     // 实际支付金额
     actualFee() {
     actualFee() {
@@ -84,6 +85,11 @@ export default {
       return this.parkDiscountTotal.feeCopy + this.paperDiscountFee;
       return this.parkDiscountTotal.feeCopy + this.paperDiscountFee;
     },
     },
   },
   },
+  watch: {
+    orderDetail(){
+      console.log('909090', this.orderDetail)
+    }
+  },
   methods: {
   methods: {
     showToast(text) {
     showToast(text) {
       let options = {};
       let options = {};
@@ -301,6 +307,8 @@ export default {
 
 
     // 确认
     // 确认
     confirm() {
     confirm() {
+      console.log(310, this.orderDetail);
+      return
       let paperCouponcode = '';
       let paperCouponcode = '';
       this.paperCouponList.forEach((e, i) => {
       this.paperCouponList.forEach((e, i) => {
         if (i === this.paperCouponList.length - 1) {
         if (i === this.paperCouponList.length - 1) {

+ 29 - 51
src/pages/parkingFee/parkingFeePaperCoupon.vue

@@ -3,7 +3,7 @@
     <div class="worp">
     <div class="worp">
       <div class="title">纸质优惠劵减免说明</div>
       <div class="title">纸质优惠劵减免说明</div>
       <div style="font-size: 28px; color: #808080; padding-top: 12px">
       <div style="font-size: 28px; color: #808080; padding-top: 12px">
-        {{ parkPaperCouponRemark }}
+        {{ orderDetail && orderDetail.parkingRule && orderDetail.parkingRule.paperCouponsDescription || '' }}
       </div>
       </div>
     </div>
     </div>
     <template v-if="paperCouponList.length">
     <template v-if="paperCouponList.length">
@@ -33,8 +33,6 @@
     <div
     <div
       :class="{
       :class="{
         worp_button: true,
         worp_button: true,
-        blue_flewx_index3: custTypeId === 1,
-        green_flewx_index3: custTypeId === 2,
       }"
       }"
       @click="scanCode"
       @click="scanCode"
     >
     >
@@ -45,27 +43,23 @@
       <div>扫码用劵</div>
       <div>扫码用劵</div>
     </div>
     </div>
     <div class="flewx">
     <div class="flewx">
-      <!-- <div class="flewx-content">应付<span style="color: red;font-size: 32px;padding-left: 20px;">{{actualFee |
+      <div style="display: flex; width: 100%;align-items: center">
+        <!-- <div class="flewx-content">应付<span style="color: red;font-size: 32px;padding-left: 20px;">{{actualFee |
       currency}}</span> 元 <span style="color: #8d8d8d;padding-left: 30px;font-size: 28px;">已优惠{{discountFee |
       currency}}</span> 元 <span style="color: #8d8d8d;padding-left: 30px;font-size: 28px;">已优惠{{discountFee |
           currency}}元</span>
           currency}}元</span>
       </div> -->
       </div> -->
-      <div class="flewx-content">
-        已选<span class="num">{{ paperCouponList.length }}张</span>
-        <span class="discountFee"
-        >优惠券可优惠{{ discountFee | currency }}</span
-        >
-      </div>
-      <div
-        :class="{
-          flewx_index3: true,
-          blue_flewx_index3: custTypeId === 1,
-          green_flewx_index3: custTypeId === 2,
-          'btn-disabled': !parkInfo.servicefee,
-        }"
-        @click="confirm"
-      >
-        确定
+        <div class="flewx-content">
+          已选<span class="num">{{ paperCouponList.length }}张</span>
+          <span class="discountFee"
+          >优惠券可优惠{{ discountFee | currency }}</span
+          >
+        </div>
+        <div class="btn-box">
+          <k-button style="width: 100%;max-width: 240px" title="确定" disabledColor="#D1D2D9" @click="confirm"/>
+        </div>
       </div>
       </div>
+      <!-- 开启底部安全区适配 -->
+      <van-number-keyboard safe-area-inset-bottom />
     </div>
     </div>
     <!-- 新的toast -->
     <!-- 新的toast -->
     <fui-toast ref="toast"></fui-toast>
     <fui-toast ref="toast"></fui-toast>
@@ -139,7 +133,7 @@ export default {
   color: #fff;
   color: #fff;
   margin-top: 45px;
   margin-top: 45px;
   // background-image: linear-gradient(to right, #7e4fa1, #433c7f);
   // background-image: linear-gradient(to right, #7e4fa1, #433c7f);
-  background: #064c8a;
+  background: var(--k-color-primary);
   margin-left: 30px;
   margin-left: 30px;
   display: flex;
   display: flex;
   align-items: center;
   align-items: center;
@@ -157,47 +151,31 @@ export default {
   // padding-bottom: constant(safe-area-inset-bottom);
   // padding-bottom: constant(safe-area-inset-bottom);
   // padding-bottom: env(safe-area-inset-bottom);
   // padding-bottom: env(safe-area-inset-bottom);
   padding-bottom: 20px;
   padding-bottom: 20px;
+  padding-top: 33px;
 
 
   .flewx-content {
   .flewx-content {
     font-weight: 400;
     font-weight: 400;
-    position: absolute;
-    left: 16px;
+    padding-left: 30px;
     font-size: 28px;
     font-size: 28px;
+    flex: 1;
+    color: #999999;
     .num {
     .num {
-      color: #064c8a;
+      color: var(--k-color-primary);
     }
     }
     .discountFee {
     .discountFee {
       color: #ee4d3f;
       color: #ee4d3f;
+      margin-left: 20px;
     }
     }
   }
   }
 
 
-  .flewx_index3 {
-    width: 150px;
-    height: 70px;
-    border-radius: 45px;
-    text-align: center;
-    font-size: 28px;
-    line-height: 70px;
-    color: #fff;
-    // background-image: linear-gradient(to right, #7e4fa1, #433c7f);
-    background: #064c8a;
-    box-shadow: 2px 3px 5px #888888;
-    position: absolute;
-    right: 16px;
+  .btn-box {
+    display: flex;
+    justify-content: flex-end;
+    margin-left: 35px;
+    margin-right: 24px;
+    //flex: 1;
+    width: 240px;
+    max-width: 240px;
   }
   }
 }
 }
-
-.blue_flewx_index3 {
-  .color_flewx_index3('blue');
-}
-
-.green_flewx_index3 {
-  .color_flewx_index3('green');
-}
-
-.color_flewx_index3(@value) {
-  @color: 'color-@{value}';
-  background-image: none !important;
-  background-color: @@color !important;
-}
 </style>
 </style>

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

@@ -1,4 +1,4 @@
-import checkOutQHResponse from "@/api/mockData/checkout.pd5.response.json";
+import checkOutQHResponse from "@/api/mockData/checkout.pd6.response.json";
 import { checkOut,calculateDiscount,ordersAndPrepay,currentUnlicensedPlate,unlicensedCarCheckIn,unlicensedCarCheckout } from '@/api/parking';
 import { checkOut,calculateDiscount,ordersAndPrepay,currentUnlicensedPlate,unlicensedCarCheckIn,unlicensedCarCheckout } from '@/api/parking';
 import state from "@/store/order/state";
 import state from "@/store/order/state";
 import mutations from "@/store/order/mutations";
 import mutations from "@/store/order/mutations";
@@ -35,8 +35,8 @@ export default {
         // console.log('无牌车扫码出场', endlessLoop);
         // console.log('无牌车扫码出场', endlessLoop);
         // 场内缴费,调 check-out 接口,
         // 场内缴费,调 check-out 接口,
         const method = unlicensed && endlessLoop || !vehicleNo ? unlicensedCarCheckout : checkOut
         const method = unlicensed && endlessLoop || !vehicleNo ? unlicensedCarCheckout : checkOut
-        const res = await method(vehicleNo, unlicensed, gateId);
-        // const res = checkOutQHResponse
+        // const res = await method(vehicleNo, unlicensed, gateId);
+        const res = checkOutQHResponse
         if ( res?.parkingRecord?.totalFee <= 0 ) {
         if ( res?.parkingRecord?.totalFee <= 0 ) {
           callback && callback({
           callback && callback({
             unlicensed,
             unlicensed,

+ 2 - 2
src/store/order/points.js

@@ -131,7 +131,7 @@ export default {
       // 判断符合上限 
       // 判断符合上限 
 
 
       // 浦东积分上限判断
       // 浦东积分上限判断
-      if ( parkMallCode === 1 && type === 'add' && state.usingTotalDiscount + remainConsumeTimeFee <= maxOneTimeDiscountFee ) {
+      if ( parkMallCode === 1 && type === 'add' && state.usingTotalDiscount <= maxOneTimeDiscountFee ) {
         msg = `超出抵扣上限,每次最高可抵扣${ maxOneTimeDiscountTime }小时`
         msg = `超出抵扣上限,每次最高可抵扣${ maxOneTimeDiscountTime }小时`
       }
       }
     }
     }
@@ -144,7 +144,7 @@ export default {
       // 判断符合上限 
       // 判断符合上限 
 
 
       // 浦东积分上限判断
       // 浦东积分上限判断
-      if ( parkMallCode === 1 && type === 'add' && state.usingTotalDiscount + remainConsumeTimeFee <= maxOneTimeDiscountFee ) {
+      if ( parkMallCode === 1 && type === 'add' && state.usingTotalDiscount <= maxOneTimeDiscountFee ) {
         msg = `超出抵扣上限,每次最高可抵扣${ maxOneTimeDiscountTime }小时`
         msg = `超出抵扣上限,每次最高可抵扣${ maxOneTimeDiscountTime }小时`
       }
       }
     }
     }

+ 2 - 1
vue.config.js

@@ -123,7 +123,8 @@ module.exports = {
       },
       },
       '/msApi': {
       '/msApi': {
         // target: 'http://172.21.201.251:8080',
         // target: 'http://172.21.201.251:8080',
-        target: 'http://172.21.203.156:8080',
+        // target: 'http://172.21.203.156:8080',
+        target: 'http://172.20.51.69:8080',
         // target: 'http://172.21.202.133:8080',
         // target: 'http://172.21.202.133:8080',
         // target: 'https://dev-kip-service-internal.kerryonvip.com/temporary-parking-service', //代理地址,这里设置的地址会代替axios中设置的baseURL
         // target: 'https://dev-kip-service-internal.kerryonvip.com/temporary-parking-service', //代理地址,这里设置的地址会代替axios中设置的baseURL
         // target: 'http://172.21.203.140:8080', //代理地址,这里设置的地址会代替axios中设置的baseURL   2023-2-9
         // target: 'http://172.21.203.140:8080', //代理地址,这里设置的地址会代替axios中设置的baseURL   2023-2-9