Explorar el Código

Merge pull request #573 from tron/revert-572-revert-571-release-3.15.0

Revert "Revert "fix(KIP-16484): 北京积分上限判断逻辑调整""
John-Hong hace 11 meses
padre
commit
3a8e46f3e2
Se han modificado 1 ficheros con 4 adiciones y 2 borrados
  1. 4 2
      src/store/order/points.js

+ 4 - 2
src/store/order/points.js

@@ -189,9 +189,11 @@ export default {
     if(!msg && type === 'add' && parkMallCode === 3) {
       const{ maxDiscountFee = 0, unitAmount =0 } = points
       const userMaxDiscountFee = availableDiscountFee > maxDiscountFee ? maxDiscountFee : availableDiscountFee
-      const isMax = (newMemberPoints.totalAvailable - newMemberPoints.available) + (points.totalAvailable - points.available) >= points.totalAvailable && points.totalAvailable && (points.totalAvailable || points.available)
+      const newMemberPointsAvailable = (newMemberPoints?.discountFee || 0) / hourPrice * newMemberPoints.pointsPerUnit
+      const pointsAvailable = (points?.discountFee || 0) / hourPrice * points.pointsPerUnit
+      const isMax = newMemberPointsAvailable + pointsAvailable >= points.totalAvailable && points.totalAvailable && (points.totalAvailable || points.available)
       if ( maxDiscountFee && state.pointsTime >= userMaxDiscountFee/unitAmount || isMax) {
-        msg = `超出抵扣上限,每日最高可抵扣${ maxDiscountFee/unitAmount  }小时`
+        msg = `超出抵扣上限,每日最高可抵扣${ maxDiscountFee / unitAmount  }小时`
       }
     }
     if ( msg ) {