Sfoglia il codice sorgente

Merge pull request #612 from John-Hong/release-3.19.0

fix(SCRM-7511): 积分优惠加减时,不能出现负数
John-Hong 9 mesi fa
parent
commit
7f01fb88db
1 ha cambiato i file con 3 aggiunte e 0 eliminazioni
  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);