john il y a 2 ans
Parent
commit
fc47573bd5

+ 12 - 7
src/pages/parkingFee/mixins/parkingFeeDiscounts.js

@@ -63,16 +63,17 @@ export default {
         this.enableConsumeSplit = this.orderDetail.parkingRule.enableConsumeSplit
       }
 
-
       this.checkedList = []
       const {memberGrade = [],consume = [],memberLevelDiscount} = this.orderDetail.discountInfo;
       this.memberGrade = {...memberGrade[0]}
       this.consume = {...consume[0]}
-      if ( JSON.stringify(this.memberGrade) !== '{}' && this.memberGrade.hasOwnProperty('selected') ? this.memberGrade.selected : this.memberGrade.defaultSelected && !this.isMember ) {
+      if ( JSON.stringify(this.memberGrade) !== '{}' && this.memberGrade.hasOwnProperty('selected') ? this.memberGrade.selected : this.memberGrade.defaultSelected) {
         this.checkedList.push('member')
+        this.isMember = false
       }
-      if ( JSON.stringify(this.consume) !== '{}' && this.consume.hasOwnProperty('selected') ? this.consume.selected : this.consume.defaultSelected && !this.isReduces ) {
-        consume[0].defaultSelected && this.checkedList.push('reduces')
+      if ( JSON.stringify(this.consume) !== '{}' && this.consume.hasOwnProperty('selected') ? this.consume.selected : this.consume.defaultSelected) {
+        this.checkedList.push('reduces')
+        this.isReduces = false
         // 如果存在拆分逻辑的话
         // this.consume.
       }
@@ -87,7 +88,7 @@ export default {
     setIsMemberDiscountDisabled() {
       this.todayReduceDiscountMessage = '当日'
     },
-    confirm() {
+    async confirm() {
       let orderDetail = cloneDeep(this.orderDetail)
       // 如果初次进来操作的跟原来的不一样则重新计算优惠
       if ( this.checkedList.length !== this.checkedTotal ) {
@@ -111,7 +112,8 @@ export default {
             orderDetail.discountInfo.consume = [this.consume]
           }
         })
-        this.$store.dispatch('order/saveDiscounts',{orderDetail,callback: () => this.$router.back()})
+        console.log(orderDetail.discountInfo.consume);
+        await this.$store.dispatch('order/saveDiscounts',{orderDetail,callback: () => this.$router.back()})
       } else {
         this.$router.back();
       }
@@ -128,7 +130,10 @@ export default {
         const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice
         const remainConsumeTimeFee = remainConsumeTime * hourPrice
         console.log(133,this.usingTotalDiscount,remainConsumeTimeFee,maxOneTimeDiscountFee)
-        console.log('this.isMember',this.usingTotalDiscount,remainConsumeTimeFee,maxOneTimeDiscountFee,this.memberLevelDiscount)
+        console.log('this.isMember',{
+          usingTotalDiscount: this.usingTotalDiscount,remainConsumeTimeFee,maxOneTimeDiscountFee,memberLevelDiscount: this.memberLevelDiscount
+        })
+
         // TODO: 统计纸质优惠券的总金额, usingTotalDiscount - 纸质优惠券的总金额,才是用户当前订单使用的优惠总数 
         this.isMember = !( this.usingTotalDiscount - this.paperDiscountFee < ( oneTimeLimitation ? maxOneTimeDiscountFee : maxOneDayDiscountFee ) && this.memberLevelDiscount )
         this.isReduces = !( this.usingTotalDiscount - this.paperDiscountFee < ( oneTimeLimitation ? maxOneTimeDiscountFee : maxOneDayDiscountFee ) && this.enableConsume )

+ 6 - 6
src/pages/parkingFee/parkingFeeDetail.vue

@@ -130,7 +130,7 @@
         </div>
         <div class="popue_box_index">
           <div>抵扣{{ orderDetail.parkInfo.parkMallCode === 5 ? '金额' : '时长' }}</div>
-          <div class="popue_box_index" style="width: 325px">
+          <div class="popue_box_index" style="width: 335px">
             <div class="popue_box_index4_xs van-hairline--surround">
               <div class="popue_box_index4_xs_index1" @click="$store.dispatch('order/pointsMath',{type: 'minus', callback: pointsMathCallback})">
                 -
@@ -386,9 +386,9 @@ export default {
     color: #fff;
     border-radius: 60px;
     text-align: center;
-    color: #064c8a;
+    color: var(--k-color-primary-01, #064c8a);
     font-weight: 700;
-    border: 1px solid #064c8a;
+    border: 1px solid var(--k-color-primary-01, #064c8a);
   }
 
   .blue_popue_box_index4_by {
@@ -413,8 +413,8 @@ export default {
     border-radius: 60px;
     text-align: center;
     // background-image: linear-gradient(to right, #7e4fa1, #433c7f);
-    background-color: #064c8a;
-    border: 1px solid #064c8a;
+    background-color: var(--k-color-primary-01, #064c8a);
+    border: 1px solid var(--k-color-primary-01, #064c8a);
   }
 }
 
@@ -517,7 +517,7 @@ export default {
     line-height: 70px;
     color: #fff;
     // background-image: linear-gradient(to right, #7e4fa1, #433c7f);
-    background: #064c8a;
+    background: var(--k-color-primary-01, #064c8a);
     box-shadow: 2px 3px 5px #888888;
     //position: absolute;
     //right: 16px;

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

@@ -36,8 +36,8 @@ export default {
         // console.log('无牌车扫码出场', endlessLoop);
         // 场内缴费,调 check-out 接口,
         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 ) {
           callback && callback({
             unlicensed,

+ 9 - 0
src/store/order/utils.js

@@ -7,6 +7,9 @@ export function setSelected( types,orderDetail ) {
         // 如果是会员等级减免
         if ( orderDetail.discountInfo?.memberGrade?.length ) {
           const [memberGrade] = orderDetail.discountInfo?.memberGrade;
+          if ( !memberGrade?.discountFee ) {
+            memberGrade.discountFee = (memberGrade.hasOwnProperty('defaultDiscountTime')? memberGrade.defaultDiscountTime : memberGrade.discountTime ) * orderDetail.parkingRule.hourPrice
+          }
           orderDetail.discountInfo.memberGrade = [{
             ...memberGrade,
             selected: memberGrade.hasOwnProperty('selected') ? memberGrade.selected : memberGrade?.defaultSelected || false
@@ -17,6 +20,9 @@ export function setSelected( types,orderDetail ) {
         // 如果是消费减免
         if ( orderDetail.discountInfo?.consume?.length ) {
           const [consume] = orderDetail.discountInfo?.consume;
+          if ( !consume?.discountFee ) {
+            consume.discountFee = (consume.hasOwnProperty('defaultDiscountTime')? consume.defaultDiscountTime : consume.discountTime ) * orderDetail.parkingRule.hourPrice
+          }
           orderDetail.discountInfo.consume = [{
             ...consume,
             selected: consume.hasOwnProperty('selected') ? consume.selected : consume?.defaultSelected || false
@@ -27,6 +33,9 @@ export function setSelected( types,orderDetail ) {
         // 如果是积分减免
         if ( orderDetail.discountInfo?.points?.length ) {
           const [points] = orderDetail.discountInfo?.points;
+          if ( !points?.discountFee ) {
+            points.discountFee = (points.hasOwnProperty('defaultDiscountTime')? points.defaultDiscountTime : points.discountTime ) * orderDetail.parkingRule.hourPrice
+          }
           orderDetail.discountInfo.points = [{
             ...points,
             selected: points.hasOwnProperty('selected') ? points.selected : points?.defaultSelected || false

+ 1 - 1
vue.config.js

@@ -124,7 +124,7 @@ module.exports = {
       '/msApi': {
         // target: 'http://172.21.201.251:8080',
         // target: 'http://172.21.203.156:8080',
-        target: 'http://172.21.203.109:8080',
+        target: 'http://172.20.50.207:8080',
         // target: 'http://172.21.202.133:8080',
         // 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