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

fix(SCRM-4980): [DE][C端]临时停车,BKC.用户在使用优惠的情况下,点击支付,应该提示用户“请确认是否使用优惠”

john 1 жил өмнө
parent
commit
96509b3266

+ 47 - 56
src/api/mockData/checkout.pd17.response.json

@@ -2,66 +2,57 @@
   "parkingRecord": {
     "vehicleNo": "沪A00001",
     "enterTime": "2023-10-11 10:54:00",
-    "serviceMin": 12942,
-    "totalFee": 82200,
-    "actualPayFee": 798,
-    "thirdParkOrderNo": "s20231020103910951c42a795",
+    "serviceMin": 13302,
+    "totalFee": 6600,
+    "actualPayFee": 42.0,
+    "thirdParkOrderNo": "s2023102016383185e0a29af8",
     "createdByQrCode": false,
-    "getTime": "2023-10-20 10:39:10",
-    "totalFeeInYuan": 822
+    "getTime": "2023-10-20 16:38:32",
+    "totalFeeInYuan": 66.00
   },
   "discountInfo": {
     "usingTotalDiscount": 24,
     "memberLevelDiscount": false,
-    "consume": [
-      {
-        "defaultSelected": true,
-        "defaultDiscountTime": 2,
-        "discountFee": 24,
-        "redeemSalesAmount": 600,
-        "couponCodes": "l55nmr898ee_t#jlc9epqlc1s_t#vj2vsdjihve_t#xmzzanteeui_t"
-      }
-    ],
-    "points": [
-      {
-        "available": 5120,
-        "pointsPerUnit": 1000,
-        "unitAmount": 12,
-        "totalAvailable": 5120,
-        "unitHour": 1,
-        "newMember": false,
-        "label": "5120积分可减免"
-      }
-    ],
-    "coupons": [
-      {
-        "code": "wtxr3y5e8wo_t",
-        "couponId": "01e3321b0acb41079b9d654c3c376d75",
-        "status": "available",
-        "name": "停车优惠券",
-        "expirationDate": "2023-10-23 23:59:59",
-        "discountFee": 12,
-        "defaultSelected": false,
-        "superposition": "2",
-        "limitCountPerOrder": 2
-      },
-      {
-        "code": "lqzparjeo7t_t",
-        "couponId": "01e3321b0acb41079b9d654c3c376d75",
-        "status": "available",
-        "name": "停车优惠券",
-        "expirationDate": "2023-10-23 23:59:59",
-        "discountFee": 12,
-        "defaultSelected": false,
-        "superposition": "2",
-        "limitCountPerOrder": 2
-      }
-    ],
-    "paperCoupons": [
-      {
-        "description": "纸质优惠券不限制会员使用。"
-      }
-    ]
+    "consume": [{
+      "defaultSelected": true,
+      "defaultDiscountTime": 2,
+      "discountFee": 24,
+      "redeemSalesAmount": 600,
+      "couponCodes": "sbyqi4igrxd_t#95bdiagpwmw_t#gyqo80lc6t8_t"
+    }],
+    "points": [{
+      "available": 14800,
+      "pointsPerUnit": 1000,
+      "unitAmount": 12,
+      "totalAvailable": 14800,
+      "unitHour": 1,
+      "newMember": false,
+      "label": "14800积分可减免"
+    }],
+    "coupons": [{
+      "code": "wtxr3y5e8wo_t",
+      "couponId": "01e3321b0acb41079b9d654c3c376d75",
+      "status": "available",
+      "name": "停车优惠券",
+      "expirationDate": "2023-10-23 23:59:59",
+      "discountFee": 12,
+      "defaultSelected": false,
+      "superposition": "2",
+      "limitCountPerOrder": 2
+    }, {
+      "code": "lqzparjeo7t_t",
+      "couponId": "01e3321b0acb41079b9d654c3c376d75",
+      "status": "available",
+      "name": "停车优惠券",
+      "expirationDate": "2023-10-23 23:59:59",
+      "discountFee": 12,
+      "defaultSelected": false,
+      "superposition": "2",
+      "limitCountPerOrder": 2
+    }],
+    "paperCoupons": [{
+      "description": "纸质优惠券不限制会员使用。"
+    }]
   },
   "parkingRule": {
     "maxOneTimeDiscountTime": 2,
@@ -72,7 +63,7 @@
     "enablePaperCoupons": true,
     "enableConsume": true,
     "enableConsumeNonSplit": false,
-    "remainConsumeTime": 4,
+    "remainConsumeTime": 3,
     "hourPrice": 12,
     "oneTimeLimitation": true,
     "oneDayLimitation": false

+ 29 - 5
src/pages/parkingFeeV2/mixins/parkingFeeDetail.js

@@ -11,6 +11,7 @@ import { ordersAndPrepay } from '@/api/parking';
 import store from "@/store";
 // import newMemberPoints from '@/components/newMemberPoints/index.vue'
 import newMemberPointsItem from '@/components/newMemberPoints/item.vue'
+import kipTheme from "@/kui/theme/theme";
 
 export default {
   name: 'parkingFeeDetail',
@@ -220,6 +221,25 @@ export default {
         });
       }, 700)
     },
+    goPay(){
+      // 北京特殊处理
+      if(this.parkMallCode === 3 && this.usingTotalDiscount) {
+        this.$dialog.alert({
+          confirmButtonColor: kipTheme[this.theme].primaryColor,
+          title: '提示',
+          message: '请确认是否使用优惠,确认后无法返还!',
+          showCancelButton: true
+        }) .then(() => {
+          // on confirm
+          this.toPay()
+        })
+        .catch(() => {
+          // on cancel
+        });  
+        return
+      }
+      this.toPay();
+    },
     // 前往支付
     async toPay() {
       // if (!isAlipayClient) {
@@ -416,8 +436,10 @@ export default {
           // 如果接口返回异常,重置当前页面数据
           console.log('err::::', err)
           if (err.code !=='NO_FEE_NEED_TO_PAY') {
-            this.reCreateParkOrder()
-          } else {
+            this.reCreateParkOrder(err.langMessage)
+          } else if(['ETCP_RECORD_COUPON_FAILED', 'ETCP_COUPON_CONFIG_EXCEPTION', 'ETCP_COUPON_INSUFFICIENT_STOCK', 'ETCP_RECORD_COUPON_FAILED', 'ETCP_PUSH_DISCOUNT_FAILED'].indexOf(err.code) > -1) {
+            this.reCreateParkOrder(err.langMessage)
+          }else {
             Dialog.alert({
               title: '提示',
               message: '当前无需缴费',
@@ -630,12 +652,13 @@ export default {
         });
     },
     // 支付失败弹框 重新创建订单
-    reCreateParkOrder() {
+    reCreateParkOrder(msg = '支付失败') {
       // console.log('支付失败弹框 重新创建订单');
       Dialog.alert({
         title: '提示',
-        message: '支付失败',
-        confirmButtonColor: '#333',
+        message: this.parkMallCode === 3 ? msg: '支付失败',
+        // confirmButtonColor: '#333',
+        confirmButtonColor: kipTheme[this.theme].primaryColor,
       }).then(() => {
         this.$refs.countDown.reset(); // 停车场重置费用倒计时3分钟
         this.$store.dispatch('order/orderInit', {
@@ -789,6 +812,7 @@ export default {
     // 重置倒计时
     resetCountDown() {
       this.$refs?.countDown?.reset();
+      Dialog.close();
       this.btnLoading = false;
       this.isPay = false;
       this.popup = false;

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

@@ -112,7 +112,7 @@
           </div>
         </div>
         <div class="btn-box">
-          <k-button style="width: 100%;max-width: 240px" title="支付" disabledColor="#D1D2D9" :disabled="orderDetail.parkingRecord.totalFeeInYuan === 0 ? true : false || btnLoading" @click="toPay" >
+          <k-button style="width: 100%;max-width: 240px" title="支付" disabledColor="#D1D2D9" :disabled="orderDetail.parkingRecord.totalFeeInYuan === 0 ? true : false || btnLoading" @click="goPay" >
             <template v-slot:left>
               <van-loading v-if="btnLoading" size="20" color="#fff" style="margin-right: 10px"/>
             </template>

+ 1 - 1
vue.config.js

@@ -124,7 +124,7 @@ module.exports = {
       '/msApi': {
         // target: 'https://dev-kip-service-internal.kerryonvip.com/temporary-parking-service', //代理地址,这里设置的地址会代替axios中设置的baseURL
         // target: 'https://qa-apim.kerryplus.com/c/api/temporary-parking-service', //代理地址,这里设置的地址会代替axios中设置的baseURL
-        target: 'http://172.21.200.122:8080', // 代理地址,这里设置的地址会代替axios中设置的baseURL
+        target: 'http://172.20.50.137:8080', // 代理地址,这里设置的地址会代替axios中设置的baseURL
         changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
         //ws: true, // proxy websockets
         //pathRewrite方法重写url