|
@@ -200,12 +200,12 @@ export default {
|
|
this.enableConsumeSplit = this.orderDetail.parkingRule.enableConsumeSplit;
|
|
this.enableConsumeSplit = this.orderDetail.parkingRule.enableConsumeSplit;
|
|
}
|
|
}
|
|
this.checkedList = [];
|
|
this.checkedList = [];
|
|
- const { memberGrade = [{}], consume = [], memberLevelDiscount, points=[{}] } = this.orderDetail.discountInfo;
|
|
|
|
|
|
+ const { memberGrade = [{}], consume = [], memberLevelDiscount, points = [{}] } = this.orderDetail.discountInfo;
|
|
const { maxConsumeTime, remainConsumeTime, hourPrice } = this.orderDetail.parkingRule;
|
|
const { maxConsumeTime, remainConsumeTime, hourPrice } = this.orderDetail.parkingRule;
|
|
// 如果积分存在的话,则移除积分的优惠
|
|
// 如果积分存在的话,则移除积分的优惠
|
|
- if(JSON.stringify(points) !== {}) {
|
|
|
|
|
|
+ if (JSON.stringify(points) !== {}) {
|
|
this.remainPrice = this.usingTotalDiscount - points[0].discountFee;
|
|
this.remainPrice = this.usingTotalDiscount - points[0].discountFee;
|
|
- }
|
|
|
|
|
|
+ }
|
|
this.memberGrade = { ...memberGrade[0] };
|
|
this.memberGrade = { ...memberGrade[0] };
|
|
this.consume = { ...consume[0] };
|
|
this.consume = { ...consume[0] };
|
|
if (JSON.stringify(this.memberGrade) !== '{}' && this.memberGrade && this.memberGrade.hasOwnProperty('selected') ? this.memberGrade.selected : this.memberGrade.defaultSelected) {
|
|
if (JSON.stringify(this.memberGrade) !== '{}' && this.memberGrade && this.memberGrade.hasOwnProperty('selected') ? this.memberGrade.selected : this.memberGrade.defaultSelected) {
|
|
@@ -273,7 +273,14 @@ export default {
|
|
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) {
|
|
this.remainPrice = this.memberGrade.discountFee + this.remainPrice;
|
|
this.remainPrice = this.memberGrade.discountFee + this.remainPrice;
|
|
|
|
+ // 沈阳
|
|
if (this.parkMallCode === 4) {
|
|
if (this.parkMallCode === 4) {
|
|
|
|
+ const [isCrossMessage = false, maxReduceDiscount = this.maxReduceDiscount] = this.crossMessage();
|
|
|
|
+ if (isCrossMessage) {
|
|
|
|
+ this.remainPrice = this.remainPrice - this.memberGrade.discountFee;
|
|
|
|
+ this.checkedList = this.checkedList.filter((elm) => elm !== 'member');
|
|
|
|
+ return
|
|
|
|
+ }
|
|
this.remainPrice = this.remainPrice - this.reduceHours * hourPrice;
|
|
this.remainPrice = this.remainPrice - this.reduceHours * hourPrice;
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
this.maxReduceDiscount = Math.abs(availableDiscountFee - this.remainPrice) / hourPrice
|
|
this.maxReduceDiscount = Math.abs(availableDiscountFee - this.remainPrice) / hourPrice
|
|
@@ -292,29 +299,32 @@ export default {
|
|
if (this.parkMallCode === 4) {
|
|
if (this.parkMallCode === 4) {
|
|
const remainingLimitToIncrease = Math.abs(this.remainPrice - this.availableDiscountFee) / hourPrice
|
|
const remainingLimitToIncrease = Math.abs(this.remainPrice - this.availableDiscountFee) / hourPrice
|
|
const maxReduceDiscount = this.consume.discountFee / hourPrice + remainingLimitToIncrease
|
|
const maxReduceDiscount = this.consume.discountFee / hourPrice + remainingLimitToIncrease
|
|
- this.maxReduceDiscount = maxReduceDiscount < remainConsumeTime ? maxReduceDiscount : remainConsumeTime
|
|
|
|
- // 如果 用户选择的金额与消费减免的上限不一致,则不进行计算
|
|
|
|
- /* if(this.reduceHours === this.maxReduceDiscount) {
|
|
|
|
|
|
+ const isReducesCheck = this.checkedList.indexOf('reduces');
|
|
|
|
+ // console.log(303, isReducesCheck);
|
|
|
|
+ // 用户没有选择消费减免
|
|
|
|
+ if(isReducesCheck < 0) {
|
|
|
|
+ console.log(302, isReducesCheck, maxReduceDiscount, remainingLimitToIncrease);
|
|
|
|
+ } else {
|
|
|
|
+ // 用户选择消费减免
|
|
|
|
+ this.maxReduceDiscount = maxReduceDiscount < remainConsumeTime ? maxReduceDiscount : remainConsumeTime
|
|
this.reduceHours = this.maxReduceDiscount
|
|
this.reduceHours = this.maxReduceDiscount
|
|
this.consume.discountFee = this.reduceHours * hourPrice
|
|
this.consume.discountFee = this.reduceHours * hourPrice
|
|
- this.remainPrice = this.remainPrice + remainingLimitToIncrease * hourPrice
|
|
|
|
- } */
|
|
|
|
- this.reduceHours = this.maxReduceDiscount
|
|
|
|
- this.consume.discountFee = this.reduceHours * hourPrice
|
|
|
|
- this.remainPrice = this.remainPrice + remainingLimitToIncrease * hourPrice
|
|
|
|
-
|
|
|
|
|
|
+ this.remainPrice = this.remainPrice + remainingLimitToIncrease * hourPrice - this.memberGrade.discountFee
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // 如果不是沈阳
|
|
|
|
+ if (this.parkMallCode !== 4) {
|
|
|
|
+ const [isCrossMessage = false, maxReduceDiscount = this.maxReduceDiscount] = this.crossMessage();
|
|
|
|
+ if (isCrossMessage) {
|
|
|
|
+ this.checkedList = this.checkedList.filter((elm) => elm !== 'member');
|
|
|
|
+ this.remainPrice = this.remainPrice - this.memberGrade.discountFee;
|
|
|
|
+ this.isMember = false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
- /* const [isCrossMessage = false, maxReduceDiscount = this.maxReduceDiscount] = this.crossMessage();
|
|
|
|
- if (isCrossMessage) {
|
|
|
|
- this.checkedList = this.checkedList.filter((elm) => elm !== 'member');
|
|
|
|
- this.remainPrice = this.remainPrice - this.memberGrade.discountFee;
|
|
|
|
- this.isMember = false;
|
|
|
|
- } */
|
|
|
|
},
|
|
},
|
|
reducesClick() {
|
|
reducesClick() {
|
|
- const { maxOneTimeDiscountTime, hourPrice, oneTimeLimitation, maxConsumeTime, remainConsumeTime, oneDayLimitation, maxOneDayDiscountFee } = this.orderDetail.parkingRule;
|
|
|
|
|
|
+ const { maxOneTimeDiscountTime, hourPrice, oneTimeLimitation, maxConsumeTime, remainConsumeTime, oneDayLimitation, maxOneDayDiscountFee,availableDiscountFee } = this.orderDetail.parkingRule;
|
|
const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice;
|
|
const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice;
|
|
const reduceHours = (maxOneTimeDiscountFee - this.remainPrice) / hourPrice;
|
|
const reduceHours = (maxOneTimeDiscountFee - this.remainPrice) / hourPrice;
|
|
if (this.checkedList.indexOf('reduces') > -1) {
|
|
if (this.checkedList.indexOf('reduces') > -1) {
|
|
@@ -323,6 +333,22 @@ export default {
|
|
if (this.parkMallCode !== 4) {
|
|
if (this.parkMallCode !== 4) {
|
|
this.maxReduceDiscount = remainConsumeTime > maxOneTimeDiscountFee / hourPrice ? maxOneTimeDiscountFee / hourPrice : remainConsumeTime;
|
|
this.maxReduceDiscount = remainConsumeTime > maxOneTimeDiscountFee / hourPrice ? maxOneTimeDiscountFee / hourPrice : remainConsumeTime;
|
|
}
|
|
}
|
|
|
|
+ // 沈阳
|
|
|
|
+ if (this.parkMallCode === 4) {
|
|
|
|
+ const [isCrossMessage = false, maxReduceDiscount = this.maxReduceDiscount] = this.crossMessage();
|
|
|
|
+ if (isCrossMessage) {
|
|
|
|
+ this.remainPrice = this.remainPrice - this.memberGrade.discountFee;
|
|
|
|
+ this.checkedList = this.checkedList.filter((elm) => elm !== 'member');
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ this.remainPrice = this.remainPrice - this.reduceHours * hourPrice;
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.maxReduceDiscount = Math.abs(availableDiscountFee - this.remainPrice) / hourPrice
|
|
|
|
+ this.reduceHours = this.maxReduceDiscount
|
|
|
|
+ this.consume.discountFee = this.reduceHours * hourPrice
|
|
|
|
+ this.remainPrice = this.remainPrice + this.reduceHours * hourPrice;
|
|
|
|
+ })
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
this.remainPrice = this.remainPrice - hourPrice;
|
|
this.remainPrice = this.remainPrice - hourPrice;
|
|
// 如果不是沈阳,重新计算计算最大上限
|
|
// 如果不是沈阳,重新计算计算最大上限
|
|
@@ -330,10 +356,11 @@ export default {
|
|
this.maxReduceDiscount = remainConsumeTime > maxOneTimeDiscountFee / hourPrice ? maxOneTimeDiscountFee / hourPrice : remainConsumeTime;
|
|
this.maxReduceDiscount = remainConsumeTime > maxOneTimeDiscountFee / hourPrice ? maxOneTimeDiscountFee / hourPrice : remainConsumeTime;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
- const [isCrossMessage = false, maxReduceDiscount = 0] = this.crossMessage();
|
|
|
|
- if (isCrossMessage) {
|
|
|
|
- this.remainPrice = this.remainPrice - maxReduceDiscount * hourPrice;
|
|
|
|
|
|
+ if (this.parkMallCode !== 4) {
|
|
|
|
+ const [isCrossMessage = false, maxReduceDiscount = 0] = this.crossMessage();
|
|
|
|
+ if (isCrossMessage) {
|
|
|
|
+ this.remainPrice = this.remainPrice - maxReduceDiscount * hourPrice;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 超限提示
|
|
// 超限提示
|
|
@@ -341,12 +368,15 @@ export default {
|
|
const { maxOneTimeDiscountTime, hourPrice, oneTimeLimitation, oneDayLimitation, maxOneDayDiscountFee } = this.orderDetail.parkingRule;
|
|
const { maxOneTimeDiscountTime, hourPrice, oneTimeLimitation, oneDayLimitation, maxOneDayDiscountFee } = this.orderDetail.parkingRule;
|
|
const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice;
|
|
const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice;
|
|
// 单日上限
|
|
// 单日上限
|
|
- if (oneDayLimitation && this.remainPrice >= maxOneDayDiscountFee) {
|
|
|
|
- Toast({
|
|
|
|
- message: `每日最高可抵扣${maxOneDayDiscountFee}元`,
|
|
|
|
- icon: 'none',
|
|
|
|
- });
|
|
|
|
- return [true, (maxOneDayDiscountFee - (this.reduceHours - 1) * hourPrice) / hourPrice];
|
|
|
|
|
|
+ if (oneDayLimitation) {
|
|
|
|
+ const sk = this.parkMallCode === 4 ? this.remainPrice > maxOneDayDiscountFee : this.remainPrice >= maxOneDayDiscountFee
|
|
|
|
+ if (sk) {
|
|
|
|
+ Toast({
|
|
|
|
+ message: `每日最高可抵扣${maxOneDayDiscountFee}元`,
|
|
|
|
+ icon: 'none',
|
|
|
|
+ });
|
|
|
|
+ return [true, (maxOneDayDiscountFee - (this.reduceHours - 1) * hourPrice) / hourPrice];
|
|
|
|
+ }
|
|
}
|
|
}
|
|
// 单次上限限制
|
|
// 单次上限限制
|
|
if (oneTimeLimitation && this.remainPrice >= maxOneTimeDiscountFee) {
|
|
if (oneTimeLimitation && this.remainPrice >= maxOneTimeDiscountFee) {
|