john hace 2 años
padre
commit
709e0de70b

+ 3 - 2
src/api/mockData/checkout.qh10.response.json

@@ -15,14 +15,15 @@
     "memberLevelDiscount": false,
     "points": [
       {
-        "available": 4410,
+        "available": 0,
+        "totalAvailable": 1000,
         "maxDiscountFee": 20,
         "pointsPerUnit": 50,
         "unitAmount": 5,
         "newMember": false,
         "label": "已选择兑换20元",
         "discountFee": 20,
-        "unlimitUsePoints": "LIMIT"
+        "unlimitUsePoints": "UN_LIMIT"
       }
     ],
     "coupons": [

+ 22 - 14
src/pages/parkingFee/mixins/base.js

@@ -13,20 +13,28 @@ export default {
       source: (state) => state.source,
     }),
   },
-  mounted() {
-    const com = ['purpleCom', 'blueCom', 'greenCom', 'officeBlueCom', 'purpleCom'];
-    if ( this.custTypeId < 3 || !this.custTypeId) {
-      this.componentName = 'baseParkingFeeCom';
-      this.theme = 'theme-mall'
-    } else {
-      this.componentName = com[this.custTypeId];
-      this.theme = 'theme-office'
+  watch:{
+    source() {
+      this.themeInit()
     }
-    if ( this.source === 'KIP' ) {
-      this.theme = 'theme-office'
-    }
-    // TODO: 根据lbsId动态切换
-    // this.theme = 'theme-pudong'
-    // this.theme = 'theme-jingan'
   },
+  methods:{
+    themeInit() {
+      const com = ['purpleCom', 'blueCom', 'greenCom', 'officeBlueCom', 'purpleCom'];
+      if ( this.custTypeId < 3 || !this.custTypeId) {
+        this.componentName = 'baseParkingFeeCom';
+        this.theme = 'theme-mall'
+      } else {
+        this.componentName = com[this.custTypeId];
+        this.theme = 'theme-office'
+      }
+      if ( this.source === 'KIP' ) {
+        this.theme = 'theme-office'
+      }
+      // TODO: 根据lbsId动态切换
+      // this.theme = 'theme-pudong'
+      // this.theme = 'theme-jingan'
+      
+    }
+  }
 }

+ 3 - 1
src/pages/parkingFee/mixins/parkingFeeDetail.js

@@ -47,7 +47,9 @@ export default {
         },
       });
     }, 500)
-    this.pageInit();
+    setTimeout(() => {
+      this.pageInit();
+    }, 300)
   },
   
   computed: {

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

@@ -30,8 +30,8 @@
         </div>
         <!-- 中控 -->
         <div class="parkingFee-bottom">
-          <div style="height: 40px; background-color: #FBFCFF;" v-if="source !== 'CRM' || true"></div>
-          <div :class="['parkingFee-tab', tabbarActive === '无牌缴费' && 'unlicensed-box-bottom']" v-if="supportUnlicensed && source === 'CRM' || true">
+          <div style="height: 40px; background-color: #FBFCFF;" v-if="source !== 'CRM'"></div>
+          <div :class="['parkingFee-tab', tabbarActive === '无牌缴费' && 'unlicensed-box-bottom']" v-if="supportUnlicensed && source === 'CRM'">
             <div :class="['bar', tabbarActive === '手动缴费' && 'active']" @click="tabbarActiveEvent('手动缴费')">手动缴费</div>
             <div :class="['bar', tabbarActive === '无牌缴费' && 'active']" @click="tabbarActiveEvent('无牌缴费')">无牌缴费</div>
           </div>

+ 22 - 10
src/store/order/points.js

@@ -45,7 +45,7 @@ export default {
     if ( parkMallCode === 5 ) {
       pointsTime = discountFee || 0
     } else  {
-      pointsTime = discountFee ?  discountFee/ unitAmount: 0
+      pointsTime = discountFee ?  discountFee / unitAmount: 0
     }
     commit('setPointsTime',pointsTime);
     commit('setPointsPerUnit',pointsPerUnit);
@@ -140,10 +140,9 @@ export default {
       const remainConsumeTimeFee = remainConsumeTime * hourPrice
       // 计算单日剩余 remainConsumeTime
       // 当前使用优惠 state.usingTotalDiscount
-      // 判断符合上限 
-
+      // 判断符合上限
       // 浦东积分上限判断
-      if ( parkMallCode === 1 && type === 'add' && state.usingTotalDiscount <= maxOneTimeDiscountFee ) {
+      if ( parkMallCode === 1 && type === 'add' && state.usingTotalDiscount >= maxOneTimeDiscountFee ) {
         msg = `超出抵扣上限,每次最高可抵扣${ maxOneTimeDiscountTime }小时`
       }
     }
@@ -155,7 +154,7 @@ export default {
       // 当前使用优惠 state.usingTotalDiscount
       // 判断符合上限
       // 浦东积分上限判断: 减去纸质优惠券的金额
-      if ( parkMallCode === 1 && type === 'add' && state.usingTotalDiscount - state.paperDiscountFee <= maxOneTimeDiscountFee ) {
+      if ( parkMallCode === 1 && type === 'add' && state.usingTotalDiscount - state.paperDiscountFee >= maxOneTimeDiscountFee * hourPrice ) {
         msg = `超出抵扣上限,每次最高可抵扣${ maxOneTimeDiscountTime }小时`
       }
     }
@@ -173,7 +172,7 @@ export default {
       let pointsTime = 0;
       pointsTime = state.pointsTime + (parkMallCode === 5 ? state.unitAmount : state.unitHour);
       const available = state.available - state.pointsPerUnit;
-      const usingTotalDiscount = state.usingTotalDiscount + state.unitAmount; // 重新计算已经使用的优惠逻辑
+      const usingTotalDiscount = state.usingTotalDiscount + (state?.unitHour ? state.unitHour * hourPrice : state.unitAmount); // 重新计算已经使用的优惠逻辑
       if ( available > -1 ) {
         // 如果是深圳车场
         commit('setAvailable',available);
@@ -183,7 +182,7 @@ export default {
     }
     if ( type === 'minus' && state.pointsTime > 0 ) {
       const pointsTime = state.pointsTime - (parkMallCode === 5 ? state.unitAmount : state.unitHour);
-      const usingTotalDiscount = state.usingTotalDiscount - state.unitAmount; // 重新计算已经使用的优惠逻辑
+      const usingTotalDiscount = state.usingTotalDiscount - (state?.unitHour ? state.unitHour * hourPrice : state.unitAmount); // 重新计算已经使用的优惠逻辑
       // 如果是深圳车场
       commit('setAvailable',state.available + state.pointsPerUnit);
       commit('setPointsTime',pointsTime);
@@ -193,14 +192,23 @@ export default {
   cancelPointsMath( {commit,dispatch,state},callback ) {
     const {
       discountInfo: {points},
+      parkInfo: {parkMallCode},
       parkingRule,
     } = state.orderDetail;
+    const [{pointsPerHour,available,discountFee}] = points;
+    const {maxPointsTime,enablePoints,unitAmount} = parkingRule;
     if ( !points ) {
       callback && callback();
       return
     }
-    const [{pointsPerHour,available,discountFee}] = points;
-    const {maxPointsTime,enablePoints} = parkingRule;
+    let pointsTime = 0
+    // 深圳
+    if ( parkMallCode === 5 ) {
+      pointsTime = discountFee || 0
+    } else  {
+      pointsTime = discountFee ?  discountFee / unitAmount: 0
+    }
+    
     commit('setAvailable',available);
     commit('setPointsTime',discountFee || 0);
     callback && callback();
@@ -208,6 +216,10 @@ export default {
   async savePointsMath( {commit,dispatch,state},callback ) {
     try {
       let orderDetail = {...state.orderDetail};
+
+      const {parkInfo,parkingRule} = state.orderDetail
+      const {maxOneTimeDiscountTime,oneTimeLimitation,oneDayLimitation,hourPrice,remainConsumeTime} = parkingRule
+      const {parkMallCode} = parkInfo
       // 如果是重复提交,则不做重新计算
       if ( orderDetail.discountInfo.points[0].available === state.available ) {
         callback && callback();
@@ -217,7 +229,7 @@ export default {
       setSelected(['memberGrade','consume','paperCoupons','coupons'],orderDetail)
       // 计算积分修改之后的金额,返回给后端
       // orderDetail.discountInfo.points[0].discountFee = state.pointsTime * orderDetail.discountInfo.points[0].unitAmount;
-      orderDetail.discountInfo.points[0].discountFee = state.pointsTime;
+      orderDetail.discountInfo.points[0].discountFee = parkMallCode === 5 ? state.pointsTime : state.pointsTime * orderDetail.discountInfo.points[0].unitAmount;
       orderDetail.discountInfo.points[0].available = state.available;
       orderDetail.discountInfo.points[0].selected = true;
       /* 其他优惠统计 */

+ 6 - 6
src/utils/index.js

@@ -173,12 +173,12 @@ export function initEnv() {
   const href = window.location.href;
   console.log('当前页面的url地址  ',href);
   if ( /dev-|8080/.test(href) ) {
-    window.env = 'qa';
-    window.profileApi = 'https://qa-apim.kerryplus.com/c/api';
-    window.api = 'qaApi';
-    // window.env = 'dev';
-    // window.profileApi = 'https://dev-gateway-kip.kerryonvip.com/api';
-    // window.api = 'devApi';
+    // window.env = 'qa';
+    // window.profileApi = 'https://qa-apim.kerryplus.com/c/api';
+    // window.api = 'qaApi';
+    window.env = 'dev';
+    window.profileApi = 'https://dev-gateway-kip.kerryonvip.com/api';
+    window.api = 'devApi';
     // window.env = 'prod';
     // window.profileApi = 'https://sl-apim.kerryplus.com/c/api';
     // window.api = 'api';

+ 2 - 2
vue.config.js

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