|
@@ -295,12 +295,23 @@ export default {
|
|
const remainingLimitToIncrease = Math.abs(this.remainPrice - this.availableDiscountFee || 0) / hourPrice;
|
|
const remainingLimitToIncrease = Math.abs(this.remainPrice - this.availableDiscountFee || 0) / hourPrice;
|
|
// 如果是浦东的话, 重新计算优惠
|
|
// 如果是浦东的话, 重新计算优惠
|
|
if (this.parkMallCode === 1) {
|
|
if (this.parkMallCode === 1) {
|
|
- /*if(this.checkedList.indexOf('reduces') < 0) {
|
|
|
|
- this.maxReduceDiscount = this.maxReduceDiscount > maxDiscountTime ? maxDiscountTime: this.maxReduceDiscount
|
|
|
|
|
|
+ // 如果超过限制就置灰
|
|
|
|
+ const maxOneTimeDiscountTimeFee = maxOneTimeDiscountTime * hourPrice
|
|
|
|
+ const isSelected = this.consume.hasOwnProperty('selected') ? this.consume.selected : this.consume.defaultSelected;
|
|
|
|
+ const isCheckedListSelected = this.checkedList.indexOf('consume') > -1;
|
|
|
|
+ if(maxOneTimeDiscountTimeFee > this.remainPrice) {
|
|
|
|
+ this.maxReduceDiscount = (maxOneTimeDiscountTimeFee - this.remainPrice) / hourPrice + (isSelected ? this.reduceHours : 0)
|
|
|
|
+ !isSelected && (this.reduceHours = this.maxReduceDiscount)
|
|
return
|
|
return
|
|
- }*/
|
|
|
|
- this.maxReduceDiscount = this.remainPrice / hourPrice < remainConsumeTime ? remainConsumeTime : this.maxReduceDiscount
|
|
|
|
- return;
|
|
|
|
|
|
+ }
|
|
|
|
+ if(maxOneTimeDiscountTimeFee == this.remainPrice && !isSelected && isCheckedListSelected) {
|
|
|
|
+ this.maxReduceDiscount = 0
|
|
|
|
+ this.reduceHours = this.maxReduceDiscount
|
|
|
|
+ return
|
|
|
|
+ } else {
|
|
|
|
+ this.maxReduceDiscount = this.reduceHours
|
|
|
|
+ }
|
|
|
|
+ return
|
|
}
|
|
}
|
|
if (!remainingLimitToIncrease) {
|
|
if (!remainingLimitToIncrease) {
|
|
// if(!this.consume.selected) {
|
|
// if(!this.consume.selected) {
|
|
@@ -364,14 +375,31 @@ export default {
|
|
// debugger
|
|
// debugger
|
|
const { maxConsumeTime, remainConsumeTime, availableDiscountFee, hourPrice } = this.orderDetail.parkingRule;
|
|
const { maxConsumeTime, remainConsumeTime, availableDiscountFee, hourPrice } = this.orderDetail.parkingRule;
|
|
if (this.checkedList.indexOf('member') > -1) {
|
|
if (this.checkedList.indexOf('member') > -1) {
|
|
|
|
+ /* 浦东 */
|
|
|
|
+ if(this.parkMallCode === 1) {
|
|
|
|
+ const [isCrossMessage = false, maxReduceDiscount = this.maxReduceDiscount] = this.crossMessage();
|
|
|
|
+ if (!isCrossMessage) {
|
|
|
|
+ this.remainPrice = this.memberGrade.discountFee + this.remainPrice;
|
|
|
|
+ } else {
|
|
|
|
+ this.checkedList = this.checkedList.filter((elm) => elm !== 'member');
|
|
|
|
+ // this.remainPrice = this.remainPrice - this.memberGrade.discountFee
|
|
|
|
+ this.isMember = false;
|
|
|
|
+ }
|
|
|
|
+ this.maxReduceDiscountInit();
|
|
|
|
+ return
|
|
|
|
+ }
|
|
this.remainPrice = this.memberGrade.discountFee + this.remainPrice;
|
|
this.remainPrice = this.memberGrade.discountFee + this.remainPrice;
|
|
- // console.log(331, this.remainPrice);
|
|
|
|
// 沈阳
|
|
// 沈阳
|
|
if (this.parkMallCode === 4 || this.parkMallCode === 6) {
|
|
if (this.parkMallCode === 4 || this.parkMallCode === 6) {
|
|
- // console.log(322);
|
|
|
|
this.maxReduceDiscountInit();
|
|
this.maxReduceDiscountInit();
|
|
}
|
|
}
|
|
} else if (!this.isMember) {
|
|
} else if (!this.isMember) {
|
|
|
|
+ // 浦东单独处理
|
|
|
|
+ if(this.parkMallCode === 1) {
|
|
|
|
+ this.remainPrice = this.remainPrice - this.memberGrade.discountFee;
|
|
|
|
+ this.maxReduceDiscountInit();
|
|
|
|
+ return
|
|
|
|
+ }
|
|
this.remainPrice = this.remainPrice - this.memberGrade.discountFee;
|
|
this.remainPrice = this.remainPrice - this.memberGrade.discountFee;
|
|
// 如果不是沈阳,重新计算优惠
|
|
// 如果不是沈阳,重新计算优惠
|
|
if (this.parkMallCode !== 4 && this.parkMallCode !== 6) {
|
|
if (this.parkMallCode !== 4 && this.parkMallCode !== 6) {
|
|
@@ -396,9 +424,17 @@ export default {
|
|
const { maxOneTimeDiscountTime, hourPrice, oneTimeLimitation, maxConsumeTime, remainConsumeTime, oneDayLimitation, maxOneDayDiscountFee, availableDiscountFee } = this.orderDetail.parkingRule;
|
|
const { maxOneTimeDiscountTime, hourPrice, oneTimeLimitation, maxConsumeTime, remainConsumeTime, oneDayLimitation, maxOneDayDiscountFee, availableDiscountFee } = this.orderDetail.parkingRule;
|
|
const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice;
|
|
const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice;
|
|
if (this.checkedList.indexOf('reduces') > -1) {
|
|
if (this.checkedList.indexOf('reduces') > -1) {
|
|
- // this.remainPrice = hourPrice + this.remainPrice;
|
|
|
|
- // 如果不是沈阳,重新计算计算最大上限
|
|
|
|
- if (this.parkMallCode !== 4 && this.parkMallCode !== 6) {
|
|
|
|
|
|
+ if(this.parkMallCode === 1) {
|
|
|
|
+ const [isCrossMessage = false, maxReduceDiscount = this.maxReduceDiscount] = this.crossMessage();
|
|
|
|
+ if(isCrossMessage) {
|
|
|
|
+ this.checkedList = this.checkedList.filter((elm) => elm !== 'reduces');
|
|
|
|
+ // this.remainPrice = this.remainPrice - this.memberGrade.discountFee
|
|
|
|
+ // this.isReduces = false;
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (this.parkMallCode !== 4 && this.parkMallCode !== 6) {
|
|
|
|
+ // 如果不是沈阳,重新计算计算最大上限
|
|
this.remainPrice = hourPrice + this.remainPrice;
|
|
this.remainPrice = hourPrice + this.remainPrice;
|
|
this.maxReduceDiscount = remainConsumeTime > maxOneTimeDiscountFee / hourPrice ? maxOneTimeDiscountFee / hourPrice : remainConsumeTime;
|
|
this.maxReduceDiscount = remainConsumeTime > maxOneTimeDiscountFee / hourPrice ? maxOneTimeDiscountFee / hourPrice : remainConsumeTime;
|
|
}
|
|
}
|