|
@@ -304,11 +304,12 @@ export default {
|
|
|
* 当前消费减免用户可用优惠上限:Z
|
|
|
* 消费减免真实可用优惠: D > Z ? Z : D
|
|
|
* */
|
|
|
- const isSelected = this.consume.hasOwnProperty('selected') ? this.consume.selected : this.consume.defaultSelected;
|
|
|
- const reduceHours = isSelected ? this.reduceHours : 0
|
|
|
- const otherFee = remainConsumeTime - this.remainPrice - reduceHours
|
|
|
+ const isSelected = this.checkedList.indexOf('reduces') > -1;
|
|
|
+ // const reduceHours = isSelected ? this.reduceHours : 0
|
|
|
+ const remainHour = this.remainPrice / hourPrice
|
|
|
// 当前订单的总可用余额: remainConsumeTime
|
|
|
const couponCodesLength = couponCodes?.split('#')?.length || 0; // 上限
|
|
|
+ // const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice;
|
|
|
// 实际上限
|
|
|
// remainConsumeTime - this.reduceHours 剩余优惠
|
|
|
// couponCodesLength - this.reduceHours 剩余上限
|
|
@@ -316,7 +317,8 @@ export default {
|
|
|
// this.maxReduceDiscount = remainConsumeTime - this.reduceHours <= couponCodesLength - this.reduceHours
|
|
|
// 转化公式之后
|
|
|
// this.maxReduceDiscount = remainConsumeTime > couponCodesLength ? couponCodesLength : remainConsumeTime
|
|
|
- this.maxReduceDiscount = couponCodesLength > defaultDiscountTime ? defaultDiscountTime : couponCodesLength;
|
|
|
+ // console.log(319, this.remainPrice >= maxOneTimeDiscountFee)
|
|
|
+ this.maxReduceDiscount = couponCodesLength > defaultDiscountTime ? defaultDiscountTime> remainHour > defaultDiscountTime ? defaultDiscountTime : remainHour : remainHour > couponCodesLength?couponCodesLength:remainHour;
|
|
|
// this.reduceHours = this.maxReduceDiscount
|
|
|
!isSelected && (this.reduceHours = this.maxReduceDiscount)
|
|
|
return
|