|
@@ -325,7 +325,8 @@ export default {
|
|
|
// console.log('323323323', couponCodesLength, remainHour, defaultDiscountTime, this.reduceHours )
|
|
|
|
|
|
// this.reduceHours = this.maxReduceDiscount
|
|
|
- !isSelected && remainHour - defaultDiscountTime > 0 && (this.reduceHours = 1)
|
|
|
+ !isSelected && remainConsumeTime - remainHour > 0 && defaultDiscountTime && (this.reduceHours = 1)
|
|
|
+ // remainConsumeTime - remainHour > 0 && defaultDiscountTime && (this.reduceHours = 1)
|
|
|
return
|
|
|
// 如果超过限制就置灰
|
|
|
// const maxOneTimeDiscountTimeFee = (couponCodes.split('#').length) * hourPrice
|
|
@@ -469,6 +470,13 @@ export default {
|
|
|
// this.isReduces = false;
|
|
|
return
|
|
|
}
|
|
|
+ // 如果还有剩余优惠的话,给一个默认值
|
|
|
+ const {defaultDiscountTime} = this.consume
|
|
|
+ const remainHour = this.remainPrice / hourPrice
|
|
|
+ if(remainConsumeTime - remainHour > 0 && defaultDiscountTime){
|
|
|
+ this.reduceHours = 1
|
|
|
+ this.remainPrice = this.remainPrice + hourPrice
|
|
|
+ }
|
|
|
return;
|
|
|
}
|
|
|
if (this.parkMallCode !== 4 && this.parkMallCode !== 6) {
|
|
@@ -493,7 +501,7 @@ export default {
|
|
|
},
|
|
|
// 超限提示
|
|
|
crossMessage(type) {
|
|
|
- const { maxOneTimeDiscountTime, hourPrice, oneTimeLimitation, oneDayLimitation, maxOneDayDiscountFee } = this.orderDetail.parkingRule;
|
|
|
+ const { maxOneTimeDiscountTime, hourPrice, oneTimeLimitation, oneDayLimitation, maxOneDayDiscountFee, remainConsumeTime } = this.orderDetail.parkingRule;
|
|
|
const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice;
|
|
|
// console.log(373, this.remainPrice, this.availableDiscountFee);
|
|
|
// 单日上限
|
|
@@ -514,6 +522,15 @@ export default {
|
|
|
// return [true,( maxOneTimeDiscountFee - (this.reduceHours - 1) * hourPrice ) / hourPrice]
|
|
|
return [true, (this.remainPrice - maxOneTimeDiscountFee) / hourPrice];
|
|
|
}
|
|
|
+ // 单次上限限制 浦东
|
|
|
+ const remainHour = this.remainPrice / hourPrice
|
|
|
+ if (oneTimeLimitation && remainConsumeTime - remainHour < 1) {
|
|
|
+ Toast({
|
|
|
+ message: `超出抵扣上限,每次最高可抵扣${maxOneTimeDiscountTime}小时`,
|
|
|
+ icon: 'none',
|
|
|
+ });
|
|
|
+ return [true, (this.remainPrice - maxOneTimeDiscountFee) / hourPrice];
|
|
|
+ }
|
|
|
return [false, 0];
|
|
|
},
|
|
|
// 验证当前的选项是否可选择
|