Explorar o código

浦东主题色适配

john %!s(int64=2) %!d(string=hai) anos
pai
achega
a3ea504f64

+ 110 - 0
src/api/mockData/checkout.pd11.response.json

@@ -0,0 +1,110 @@
+{
+  "parkingRecord": {
+    "vehicleNo": "沪D00010",
+    "enterTime": "2023-04-23 13:01:00",
+    "serviceMin": 33214,
+    "totalFee": 10000,
+    "actualPayFee": 0,
+    "thirdParkOrderNo": "4970687",
+    "createdByQrCode": false,
+    "totalFeeInYuan": 100
+  },
+  "discountInfo": {
+    "usingTotalDiscount": 100,
+    "memberLevelDiscount": true,
+    "memberGrade": [
+      {
+        "defaultSelected": true,
+        "memberGrade": "3",
+        "memberGradeText": "嘉佑卡",
+        "discountTime": 1,
+        "discountFee": 10
+      }
+    ],
+    "consume": [
+      {
+        "defaultSelected": true,
+        "defaultDiscountTime": 1,
+        "discountFee": 10,
+        "redeemSalesAmount": 300,
+        "couponCodes": "xvhy0y94cyu_t"
+      }
+    ],
+    "points": [
+      {
+        "available": 10004000,
+        "pointsPerUnit": 1000,
+        "unitAmount": 10,
+        "totalAvailable": 10010000,
+        "unitHour": 1,
+        "newMember": false,
+        "label": "已选择兑换6小时",
+        "discountFee": 60
+      }
+    ],
+    "coupons": [
+      {
+        "code": "uoscefx2owf_t",
+        "couponId": "60b9e286414b41ec9c32596bf6f2d0c5",
+        "status": "unavailable",
+        "availableDays": "星期六",
+        "name": "5元停车券(周末及法定节假日)",
+        "expirationDate": "2023-05-31 23:59:59",
+        "discountFee": 5,
+        "defaultSelected": false,
+        "superposition": "2",
+        "limitCountPerOrder": 2
+      },
+      {
+        "code": "zodkslpknm0_t",
+        "couponId": "67a5071cfff34264925b96c578c76184",
+        "status": "available",
+        "name": "首2小时免费停车优惠券",
+        "expirationDate": "2023-05-31 23:59:59",
+        "discountFee": 20,
+        "defaultSelected": true,
+        "superposition": "1",
+        "limitCountPerOrder": 1
+      },
+      {
+        "code": "zfhv5xpgmi8_t",
+        "couponId": "489a7f8d727649c6842279318698bbcb",
+        "status": "available",
+        "availableDays": "星期一#星期二#星期三#星期四#星期五#星期六",
+        "name": "首小时免费停车优惠券",
+        "expirationDate": "2023-05-31 23:59:59",
+        "discountFee": 15,
+        "defaultSelected": false,
+        "superposition": "1",
+        "limitCountPerOrder": 0
+      }
+    ],
+    "paperCoupons": [
+      {
+        "description": "纸质优惠券不限制会员使用。"
+      }
+    ]
+  },
+  "parkingRule": {
+    "maxOneTimeDiscountTime": 10,
+    "enableNewMemberPoints": false,
+    "enablePoints": true,
+    "unLimitWeekendPoints": false,
+    "enableCoupon": true,
+    "enablePaperCoupons": true,
+    "paperCouponsDescription": "纸质优惠券不限制会员使用。",
+    "enableConsume": true,
+    "enableConsumeSplit": true,
+    "maxConsumeTime": 33,
+    "remainConsumeTime": 33,
+    "hourPrice": 10,
+    "oneDayLimitation": false,
+    "oneTimeLimitation": true
+  },
+  "parkInfo": {
+    "parkName": "浦东嘉里停车场",
+    "description": "深圳停车场最新描述涨价到10块一小时",
+    "parkMallCode": 1,
+    "buildingId": "PKC-P1"
+  }
+}

+ 3 - 0
src/pages/parkingFee/mixins/base.js

@@ -34,6 +34,9 @@ export default {
       if ( this.source === 'KIP' ) {
         this.theme = 'theme-office'
       }
+      if ( this.source === 'PUDONG' ) {
+        this.theme = 'theme-pudong'
+      }
       // TODO: 根据lbsId动态切换
       // this.theme = 'theme-pudong'
       // this.theme = 'theme-jingan'

+ 133 - 129
src/pages/parkingFee/mixins/parkingFeeDiscounts.js

@@ -5,7 +5,7 @@ import { cloneDeep } from 'lodash'
 import uni from '@/utils/uniHooks';
 // const app = getApp()
 export default {
-  components: {uniNumberBox},
+  components: { uniNumberBox },
   created() {
     // 超限提示
     // this.crossMessage();
@@ -31,22 +31,22 @@ export default {
       enableConsumeSplit: false,
       maxReduceDiscount: 0,
       reduceHours: 0,
-      remainPrice: 0
+      remainPrice: 0,
     };
   },
   computed: {
     ...mapState({
-      orderDetail: state => state.order.orderDetail,
-      custTypeId: ( state ) => state.custTypeId,
-      groupId: ( state ) => state.groupId,
-      enableConsume: state => state.order.enableConsume,
-      actualPayFee: state => state.order.actualPayFee,
-      usingTotalDiscount: state => state.order.usingTotalDiscount,
-      memberLevelDiscount: state => state.order.memberLevelDiscount,
-      checkedTotal: state => state.order.checkedTotal,
-      parkMallCode: state => state.order.parkMallCode,
-      paperDiscountTime: state => state.order.paperDiscountTime,
-      paperDiscountFee: state => state.order.paperDiscountTime,
+      orderDetail: (state) => state.order.orderDetail,
+      custTypeId: (state) => state.custTypeId,
+      groupId: (state) => state.groupId,
+      enableConsume: (state) => state.order.enableConsume,
+      actualPayFee: (state) => state.order.actualPayFee,
+      usingTotalDiscount: (state) => state.order.usingTotalDiscount,
+      memberLevelDiscount: (state) => state.order.memberLevelDiscount,
+      checkedTotal: (state) => state.order.checkedTotal,
+      parkMallCode: (state) => state.order.parkMallCode,
+      paperDiscountTime: (state) => state.order.paperDiscountTime,
+      paperDiscountFee: (state) => state.order.paperDiscountTime,
     }),
     // maxReduceDiscount() {
     //   const {maxOneDayCoupons,maxConsumeTime,maxonedaydiscountFee,maxOneTimeDiscountTime,remainConsumeTime,hourPrice,availableDiscountFee,oneTimeLimitation,oneDayLimitation,maxOneDayDiscountFee} = this.orderDetail.parkingRule;
@@ -66,29 +66,27 @@ export default {
     //     remainPrice = remainPrice + this.memberGrade.discountFee
     //   }
     //   if ( this.checkedList.indexOf('reduces') > -1) {
-    //    
+    //
     //   }
-    //  
-    //  
-    //  
-    //  
+    //
+    //
+    //
+    //
     //   return remainPrice
     // }
   },
   mounted() {
     try {
-      this.isCheck(
-        () => this.pageInit()
-      ); // 验证是否可选  
-    } catch ( err ) {
-      console.log(err)
+      this.isCheck(() => this.pageInit()); // 验证是否可选
+    } catch (err) {
+      console.log(err);
       this.$router.back();
     }
   },
   watch: {
     remainPrice() {
-      const {maxOneDayCoupons,maxonedaydiscountFee,maxOneTimeDiscountTime,remainConsumeTime,hourPrice,availableDiscountFee,oneTimeLimitation,oneDayLimitation,maxOneDayDiscountFee} = this.orderDetail.parkingRule;
-      const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice
+      const { maxOneDayCoupons, maxonedaydiscountFee, maxOneTimeDiscountTime, remainConsumeTime, hourPrice, availableDiscountFee, oneTimeLimitation, oneDayLimitation, maxOneDayDiscountFee } = this.orderDetail.parkingRule;
+      const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice;
       // console.log('hourPrice + this.remainPrice',this.remainPrice)
       // 单日上限
       // if ( oneDayLimitation && this.remainPrice >= maxOneDayDiscountFee ) {
@@ -99,19 +97,20 @@ export default {
       //
       // }
       // 单次上限限制
-      if ( oneTimeLimitation ) {
-        if( this.remainPrice <= maxOneTimeDiscountFee ) {
-          if ( this.isMember ) {
-            this.isMember = !this.isMember
+      if (oneTimeLimitation) {
+        if (this.remainPrice <= maxOneTimeDiscountFee) {
+          if (this.isMember) {
+            this.isMember = !this.isMember;
+          }
+          if (this.isReduces) {
+            this.isReduces = false;
+            console.log(109);
           }
-          if ( this.isReduces ) {
-            this.isReduces = false
-          }  
         } else {
-          this.isMember = this.checkedList.indexOf('member') < 0
-          this.isReduces = this.checkedList.indexOf('reduces') < 0
+          this.isMember = this.checkedList.indexOf('member') < 0;
+          this.isReduces = this.checkedList.indexOf('reduces') < 0;
         }
-      } 
+      }
     },
     checkedList() {
       // const {hourPrice} = this.orderDetail.parkingRule;
@@ -120,79 +119,86 @@ export default {
       // } else {
       //   this.remainPrice = this.remainPrice - this.reduceHours * hourPrice
       // }
-    }
+    },
   },
   methods: {
     pageInit() {
-      this.remainPrice = this.usingTotalDiscount
-      if ( this.orderDetail?.parkingRule?.enableConsumeSplit ) {
-        this.enableConsumeSplit = this.orderDetail.parkingRule.enableConsumeSplit
+      this.remainPrice = this.usingTotalDiscount;
+      if (this.orderDetail?.parkingRule?.enableConsumeSplit) {
+        this.enableConsumeSplit = this.orderDetail.parkingRule.enableConsumeSplit;
       }
-      this.checkedList = []
-      const {memberGrade = [],consume = [],memberLevelDiscount} = this.orderDetail.discountInfo;
-      const {maxConsumeTime} = this.orderDetail.parkingRule
-      this.memberGrade = {...memberGrade[0]}
-      this.consume = {...consume[0]}
-      if ( JSON.stringify(this.memberGrade) !== '{}' && this.memberGrade.hasOwnProperty('selected') ? this.memberGrade.selected : this.memberGrade.defaultSelected ) {
-        this.checkedList.push('member')
-        this.isMember = false
+      this.checkedList = [];
+      const { memberGrade = [], consume = [], memberLevelDiscount } = this.orderDetail.discountInfo;
+      const { maxConsumeTime } = this.orderDetail.parkingRule;
+      this.memberGrade = { ...memberGrade[0] };
+      this.consume = { ...consume[0] };
+      if (JSON.stringify(this.memberGrade) !== '{}' && this.memberGrade && this.memberGrade.hasOwnProperty('selected') ? this.memberGrade.selected : this.memberGrade.defaultSelected) {
+        this.checkedList.push('member');
+        this.isMember = false;
+      } else {
+        this.isMember = true;
       }
-      if ( JSON.stringify(this.consume) !== '{}' && this.consume.hasOwnProperty('selected') ? this.consume.selected : this.consume.defaultSelected ) {
-        this.checkedList.push('reduces')
-        this.isReduces = false
+      // console.log(140, this.consume, this.consume.hasOwnProperty('selected'), JSON.stringify(this.consume) !== '{}' && this.consume.hasOwnProperty('selected') ? this.consume.selected : this.consume.defaultSelected, this.consume.defaultSelected)
+      // console.log(143, JSON.stringify(this.consume) !== '{}' && this.consume.hasOwnProperty('selected') ? this.consume.selected !== undefined : this.consume.defaultSelected !== undefined);
+      if (JSON.stringify(this.consume) !== '{}' && this.consume.hasOwnProperty('selected') ? this.consume.selected !== undefined : this.consume.defaultSelected !== undefined) {
+        this.checkedList.push('reduces');
+        this.isReduces = false;
         // 如果存在拆分逻辑的话
         // this.consume.
+      } else {
+        console.log(150);
+        this.isReduces = true;
       }
-      this.reduceHours = this.consume.hasOwnProperty('discountFee') ? this.consume.discountFee / this.orderDetail.parkingRule.hourPrice : this.consume.defaultDiscountTime
-      if ( maxConsumeTime ) {
-        this.maxReduceDiscount = maxConsumeTime
+      this.reduceHours = this.consume.hasOwnProperty('discountFee') ? this.consume.discountFee / this.orderDetail.parkingRule.hourPrice : this.consume.defaultDiscountTime;
+      if (maxConsumeTime) {
+        this.maxReduceDiscount = maxConsumeTime;
       }
-      this.oldCheckedList = [...this.checkedList]
+      this.oldCheckedList = [...this.checkedList];
     },
     setIsMemberDiscountDisabled() {
-      this.todayReduceDiscountMessage = '当日'
+      this.todayReduceDiscountMessage = '当日';
     },
     checkboxChange() {},
-    onReduceHoursChange( type ) {
-      if ( this.checkedList.indexOf('reduces') < 0 ) {
+    onReduceHoursChange(type) {
+      if (this.checkedList.indexOf('reduces') < 0) {
         return;
       }
-      const {maxOneDayCoupons,maxonedaydiscountFee,maxOneTimeDiscountTime,remainConsumeTime,hourPrice,availableDiscountFee,oneTimeLimitation,oneDayLimitation,maxOneDayDiscountFee} = this.orderDetail.parkingRule;
+      const { maxOneDayCoupons, maxonedaydiscountFee, maxOneTimeDiscountTime, remainConsumeTime, hourPrice, availableDiscountFee, oneTimeLimitation, oneDayLimitation, maxOneDayDiscountFee } = this.orderDetail.parkingRule;
       // console.log(133,this.reduceHours)
-      if ( type === 'plus') {
-        this.remainPrice = this.remainPrice + hourPrice
-        this.reduceHours = this.reduceHours + 1
-        const [isCrossMessage = false,maxReduceDiscount = this.maxReduceDiscount] = this.crossMessage()
-        if ( isCrossMessage ) {
-          this.remainPrice = this.remainPrice - hourPrice
-          this.reduceHours = this.reduceHours - 1
+      if (type === 'plus' && this.reduceHours < this.maxReduceDiscount) {
+        this.remainPrice = this.remainPrice + hourPrice;
+        this.reduceHours = this.reduceHours + 1;
+        const [isCrossMessage = false, maxReduceDiscount = this.maxReduceDiscount] = this.crossMessage();
+        if (isCrossMessage) {
+          this.remainPrice = this.remainPrice - hourPrice;
+          this.reduceHours = this.reduceHours - 1;
         }
-        return
+        return;
       }
-      if ( type === 'minus' ) {
-        this.reduceHours = this.reduceHours - 1
-        this.remainPrice = this.remainPrice - hourPrice
-        return
+      if (type === 'minus') {
+        this.reduceHours = this.reduceHours - 1;
+        this.remainPrice = this.remainPrice - hourPrice;
+        return;
       }
     },
     memberClick() {
-      const {maxConsumeTime} = this.orderDetail.parkingRule;
-      if ( this.checkedList.indexOf('member') > -1 ) {
-        this.remainPrice = this.memberGrade.discountFee + this.remainPrice
-      } else if ( !this.isMember ) {
-        this.remainPrice = this.remainPrice - this.memberGrade.discountFee
-        this.maxReduceDiscount = maxConsumeTime
+      const { maxConsumeTime } = this.orderDetail.parkingRule;
+      if (this.checkedList.indexOf('member') > -1) {
+        this.remainPrice = this.memberGrade.discountFee + this.remainPrice;
+      } else if (!this.isMember) {
+        this.remainPrice = this.remainPrice - this.memberGrade.discountFee;
+        this.maxReduceDiscount = maxConsumeTime;
       }
-      const [isCrossMessage = false,maxReduceDiscount = this.maxReduceDiscount] = this.crossMessage()
-      if ( isCrossMessage ) {
-        this.checkedList = this.checkedList.filter(elm => elm !== 'member')
-        this.remainPrice = this.remainPrice - this.memberGrade.discountFee
-        this.isMember = false
+      const [isCrossMessage = false, maxReduceDiscount = this.maxReduceDiscount] = this.crossMessage();
+      if (isCrossMessage) {
+        this.checkedList = this.checkedList.filter((elm) => elm !== 'member');
+        this.remainPrice = this.remainPrice - this.memberGrade.discountFee;
+        this.isMember = false;
       }
     },
     reducesClick() {
-      const {maxOneTimeDiscountTime,hourPrice,oneTimeLimitation,maxConsumeTime,oneDayLimitation,maxOneDayDiscountFee} = this.orderDetail.parkingRule;
-      const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice
+      const { maxOneTimeDiscountTime, hourPrice, oneTimeLimitation, maxConsumeTime, oneDayLimitation, maxOneDayDiscountFee } = this.orderDetail.parkingRule;
+      const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice;
       /*if ( oneTimeLimitation && this.remainPrice >= maxOneTimeDiscountFee ) {
         this.checkedList = this.checkedList.filter(elm => elm !== 'reduces')
         Toast({
@@ -201,98 +207,96 @@ export default {
         });
         return false
       }*/
-      const reduceHours = ( maxOneTimeDiscountFee - this.remainPrice ) / hourPrice
-      if ( this.checkedList.indexOf('reduces') > -1 ) {
-        this.remainPrice =  hourPrice + this.remainPrice
-        this.maxReduceDiscount = maxConsumeTime
+      const reduceHours = (maxOneTimeDiscountFee - this.remainPrice) / hourPrice;
+      if (this.checkedList.indexOf('reduces') > -1) {
+        this.remainPrice = hourPrice + this.remainPrice;
+        this.maxReduceDiscount = maxConsumeTime;
       } else {
-        this.remainPrice = this.remainPrice - hourPrice
-        this.maxReduceDiscount = maxConsumeTime
-        this.reduceHours = maxConsumeTime
+        this.remainPrice = this.remainPrice - hourPrice;
+        this.maxReduceDiscount = maxConsumeTime;
+        this.reduceHours = 0;
       }
-      const [isCrossMessage = false,maxReduceDiscount = 0] = this.crossMessage()
-      if ( isCrossMessage ) {
+      const [isCrossMessage = false, maxReduceDiscount = 0] = this.crossMessage();
+      if (isCrossMessage) {
         // console.log(215, maxReduceDiscount)
         // console.log(207, this.reduceHours)
         // this.maxReduceDiscount = maxReduceDiscount ? 0 : maxReduceDiscount * -1
         // console.log(217, this.maxReduceDiscount)
-        this.remainPrice = this.remainPrice - maxReduceDiscount * hourPrice
+        this.remainPrice = this.remainPrice - maxReduceDiscount * hourPrice;
         //
         // this.reduceHours = this.maxReduceDiscount
       }
     },
     // 超限提示
     crossMessage() {
-      const {maxOneTimeDiscountTime,hourPrice,oneTimeLimitation,oneDayLimitation,maxOneDayDiscountFee} = this.orderDetail.parkingRule;
-      const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice
+      const { maxOneTimeDiscountTime, hourPrice, oneTimeLimitation, oneDayLimitation, maxOneDayDiscountFee } = this.orderDetail.parkingRule;
+      const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice;
       // 单日上限
-      if ( oneDayLimitation && this.remainPrice >= maxOneDayDiscountFee ) {
+      if (oneDayLimitation && this.remainPrice >= maxOneDayDiscountFee) {
         Toast({
-          message: `每日最高可抵扣${ maxOneDayDiscountFee }元`,
+          message: `每日最高可抵扣${maxOneDayDiscountFee}元`,
           icon: 'none',
         });
-        return [true,( maxOneDayDiscountFee - (this.reduceHours - 1) * hourPrice ) / hourPrice]
+        return [true, (maxOneDayDiscountFee - (this.reduceHours - 1) * hourPrice) / hourPrice];
       }
       // 单次上限限制
-      console.log(234, this.remainPrice, maxOneTimeDiscountFee,);
-      if ( oneTimeLimitation && this.remainPrice >= maxOneTimeDiscountFee ) {
+      if (oneTimeLimitation && this.remainPrice > maxOneTimeDiscountFee) {
         Toast({
-          message: `超出抵扣上限,每次最高可抵扣${ maxOneTimeDiscountTime }小时`,
+          message: `超出抵扣上限,每次最高可抵扣${maxOneTimeDiscountTime}小时`,
           icon: 'none',
         });
         // return [true,( maxOneTimeDiscountFee - (this.reduceHours - 1) * hourPrice ) / hourPrice]
-        return [true,  ( this.remainPrice - maxOneTimeDiscountFee) / hourPrice]
+        return [true, (this.remainPrice - maxOneTimeDiscountFee) / hourPrice];
       }
-      return [false,0]
+      return [false, 0];
     },
     // 验证当前的选项是否可选择
-    isCheck( callback ) {
-      if ( !this?.orderDetail?.parkingRule ) {
-        return
+    isCheck(callback) {
+      if (!this?.orderDetail?.parkingRule) {
+        return;
       }
       // const {parkInfo,parkingRule,discountInfo} = this.orderDetail
-      const {maxOneTimeDiscountTime,maxOneDayDiscountFee,oneTimeLimitation,oneDayLimitation,hourPrice,remainConsumeTime} = this.orderDetail.parkingRule
+      const { maxOneTimeDiscountTime, maxOneDayDiscountFee, oneTimeLimitation, oneDayLimitation, hourPrice, remainConsumeTime } = this.orderDetail.parkingRule;
       // 浦东
-      if ( this.parkMallCode === 1 ) {
-        const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice
-        const remainConsumeTimeFee = remainConsumeTime * hourPrice
+      if (this.parkMallCode === 1) {
+        const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice;
+        const remainConsumeTimeFee = remainConsumeTime * hourPrice;
 
-        // TODO: 统计纸质优惠券的总金额, usingTotalDiscount - 纸质优惠券的总金额,才是用户当前订单使用的优惠总数 
-        this.isMember = !( this.usingTotalDiscount - this.paperDiscountFee < ( oneTimeLimitation ? maxOneTimeDiscountFee : maxOneDayDiscountFee ) && this.memberLevelDiscount )
-        this.isReduces = !( this.usingTotalDiscount - this.paperDiscountFee < ( oneTimeLimitation ? maxOneTimeDiscountFee : maxOneDayDiscountFee ) && this.enableConsume )
+        // TODO: 统计纸质优惠券的总金额, usingTotalDiscount - 纸质优惠券的总金额,才是用户当前订单使用的优惠总数
+        this.isMember = !(this.usingTotalDiscount - this.paperDiscountFee < (oneTimeLimitation ? maxOneTimeDiscountFee : maxOneDayDiscountFee) && this.memberLevelDiscount);
+        this.isReduces = !(this.usingTotalDiscount - this.paperDiscountFee < (oneTimeLimitation ? maxOneTimeDiscountFee : maxOneDayDiscountFee) && this.enableConsume);
       }
-      if ( callback ) callback()
+      if (callback) callback();
     },
-    reducesChange( value ) {
+    reducesChange(value) {
       // console.log(149,value)
     },
     async confirm() {
-      let orderDetail = cloneDeep(this.orderDetail)
+      let orderDetail = cloneDeep(this.orderDetail);
       // 如果初次进来操作的跟原来的不一样则重新计算优惠
-      if ( this.checkedList.length !== this.checkedTotal || true ) {
-        ['member','reduces'].forEach(key => {
-          if ( key === 'member' ) {
+      if (this.checkedList.length !== this.checkedTotal || true) {
+        ['member', 'reduces'].forEach((key) => {
+          if (key === 'member') {
             this.memberGrade = {
               ...this.memberGrade,
-              selected: this.checkedList.indexOf(key) > -1
-            }
-            orderDetail.discountInfo.memberGrade = [this.memberGrade]
+              selected: this.checkedList.indexOf(key) > -1,
+            };
+            orderDetail.discountInfo.memberGrade = [this.memberGrade];
           }
-          if ( key === 'reduces' ) {
+          if (key === 'reduces') {
             this.consume = {
               ...this.consume,
               discountTime: this.reduceHours,
               discountFee: this.reduceHours * this.orderDetail.parkingRule.hourPrice,
-              selected: this.checkedList.indexOf(key) > -1
-            }
-            orderDetail.discountInfo.consume = [this.consume]
+              selected: this.checkedList.indexOf(key) > -1,
+            };
+            orderDetail.discountInfo.consume = [this.consume];
           }
-        })
-        await this.$store.dispatch('order/saveDiscounts',{orderDetail,callback: () => this.$router.back()})
+        });
+        await this.$store.dispatch('order/saveDiscounts', { orderDetail, callback: () => this.$router.back() });
       } else {
         this.$router.back();
       }
     },
   },
-
 };

+ 23 - 36
src/pages/parkingFee/parkingFeeDiscounts.vue

@@ -7,7 +7,7 @@
             <div class="title">会员等级减免</div>
             <div class="content">{{ memberGrade.memberGradeText || '' }}减免{{ memberGrade.discountTime || 0 }}小时。可优惠{{ memberGrade.discountFee || 0 }}元</div>
           </div>
-          <van-checkbox color="#fff" name="member" checked-color="var(--k-color-primary)" :disabled="isMember" @click="memberClick"/>
+          <van-checkbox color="#fff" name="member" checked-color="var(--k-color-primary)" :disabled="isMember" @click="memberClick" />
           <!-- :checked="isCheck('member')" -->
           <div class="member-discount-info" v-if="isMemberDiscountDisabled">当日已使用</div>
         </div>
@@ -18,25 +18,15 @@
             <div class="content" v-if="orderDetail.parkInfo.parkMallCode !== 1">
               {{ todayReduceDiscountMessage }}
             </div>
-            <van-stepper 
-              v-if="enableConsumeSplit || true" 
-              :min="0"
-              name="reduces"
-              :disabled="isReduces"
-              :max="maxReduceDiscount"
-              :value="reduceHours" 
-              @plus="onReduceHoursChange('plus')"
-              @minus="onReduceHoursChange('minus')"
-              async-change 
-            />
-<!--            reduceHours: {{ reduceHours }}; maxReduceDiscount:{{ maxReduceDiscount }}-->
-<!--            <uni-number-box
-              v-if="enableConsumeSplit || true"
-              :min="1"
-              :max="maxReduceDiscount"
-              v-model="reduceHours"
-              @input="reducesChange"
-            ></uni-number-box>-->
+            <van-stepper v-if="enableConsumeSplit || true" :min="0" name="reduces" :disabled="isReduces" :max="maxReduceDiscount" :value="reduceHours" @plus="onReduceHoursChange('plus')" @minus="onReduceHoursChange('minus')" async-change />
+            <!--            reduceHours: {{ reduceHours }}; maxReduceDiscount:{{ maxReduceDiscount }}-->
+            <!--            <uni-number-box
+                          v-if="enableConsumeSplit || true"
+                          :min="1"
+                          :max="maxReduceDiscount"
+                          v-model="reduceHours"
+                          @input="reducesChange"
+                        ></uni-number-box>-->
           </div>
           <van-checkbox name="reduces" color="#fff" checked-color="var(--k-color-primary)" :disabled="isReduces" @click="reducesClick" />
         </div>
@@ -47,39 +37,31 @@
         <div class="flewx-content">
           <div class="fee-box">
             <div>合计:</div>
-            <div class="actualPayFee">{{
-                actualPayFee | currency
-              }}
-            </div>
-            <div :class="['van-hairline--surround','usingTotalDiscount', usingTotalDiscount > 0 && 'usingTotalDiscount-red']"
-            >已优惠{{ remainPrice | currency }}元
-            </div
-            >
+            <div class="actualPayFee">{{ actualPayFee | currency }}</div>
+            <div :class="['van-hairline--surround', 'usingTotalDiscount', usingTotalDiscount > 0 && 'usingTotalDiscount-red']">已优惠{{ remainPrice | currency }}元</div>
             <!-- <van-count-down :time="3 * 60 * 1000" /> -->
           </div>
         </div>
         <div class="btn-box">
-          <k-button style="width: 100%;max-width: 240px" title="确定" disabledColor="#D1D2D9" @click="confirm"/>
+          <k-button style="width: 100%; max-width: 240px" title="确定" disabledColor="#D1D2D9" @click="confirm" />
         </div>
-
       </div>
       <!-- 开启底部安全区适配 -->
       <van-number-keyboard safe-area-inset-bottom />
     </div>
-    
   </div>
 </template>
 
 <script>
 import parkingFeeDiscountsJs from './mixins/parkingFeeDiscounts';
-import baseMixins from './mixins/base'
+import baseMixins from './mixins/base';
+
 export default {
   mixins: [baseMixins, parkingFeeDiscountsJs],
 };
 </script>
 
 <style lang="less" scoped>
-
 .scroll-Y {
   width: 100%;
   display: flex;
@@ -145,6 +127,7 @@ export default {
   right: 0;
   left: 0;
   background-color: #fff;
+
   .control-box {
     width: 100%;
     box-sizing: border-box;
@@ -156,8 +139,10 @@ export default {
     //padding-bottom: env(safe-area-inset-bottom);
     padding: 30px 24px 30px 30px;
     justify-content: space-between;
+
     .flewx-content {
       font-size: 28px;
+
       .fee-box {
         display: flex;
         align-items: center;
@@ -178,8 +163,9 @@ export default {
         //line-height: 22px;
         margin-left: 7px;
         //border: 1px solid var(--k-color-red-01);
-        background-color: #F4F7FF;
+        background-color: #f4f7ff;
         border-radius: 2px;
+
         &::after {
           border-color: #999999;
         }
@@ -190,6 +176,7 @@ export default {
         &.usingTotalDiscount-red {
           color: var(--k-color-red-01);
           background-color: var(--k-color-red-06);
+
           &::after {
             border-color: var(--k-color-red-01);
           }
@@ -206,6 +193,7 @@ export default {
         font-weight: 400;
         font-size: 26px;
         margin-top: 5px;
+
         .van-count-down {
           font-size: 30px;
           color: var(--k-color-red-01);
@@ -213,10 +201,10 @@ export default {
 
         .desc {
           font-size: 30px;
-
         }
       }
     }
+
     .btn-box {
       display: flex;
       justify-content: flex-end;
@@ -247,7 +235,6 @@ export default {
   margin-right: 0;
 }
 
-
 /deep/ .van-stepper__minus {
   border: 1px solid #e5e5e5;
   border-right: 0;

+ 1 - 1
src/utils/index.js

@@ -204,7 +204,7 @@ export function initEnv() {
 export function requestInit() {
   let baseURL = window.profileApi + '/temporary-parking/v1';
   if (window.location.href.indexOf('parking.') < 0) {
-    // baseURL = '/msApi';
+    baseURL = '/msApi';
   }
   window.requestms = createAxiosByinterceptors({
     // baseURL: `https://dev-kip-service-internal.kerryonvip.com/`,

+ 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.20.51.70:8080', // 代理地址,这里设置的地址会代替axios中设置的baseURL
+        target: 'http://172.20.50.166:8080', // 代理地址,这里设置的地址会代替axios中设置的baseURL
         changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
         //ws: true, // proxy websockets
         //pathRewrite方法重写url