瀏覽代碼

fix(SCRM-7511): 积分优惠加减时,不能出现负数

john 9 月之前
父節點
當前提交
1fe6bc568c
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      src/store/order/points.js

+ 3 - 0
src/store/order/points.js

@@ -234,6 +234,9 @@ export default {
     }
     if ( type === 'minus' && state.pointsTime > 0 ) {
       const pointsTime = state.pointsTime - (isAmount ? state.unitAmount : state.unitHour);
+      if(pointsTime < 0) {
+        return
+      }
       const usingTotalDiscount = state.usingTotalDiscount - (isAmount ? state.unitAmount : state.unitHour * hourPrice); // 重新计算已经使用的优惠逻辑
       // 如果是深圳车场
       commit('setAvailable',state.available + state.pointsPerUnit);