|
@@ -112,7 +112,7 @@ export default {
|
|
|
// }
|
|
|
// 消费减免(拆分部分)提示文本
|
|
|
reduceSplitMessage() {
|
|
|
- // console.log(106, this.reduceHours);
|
|
|
+// console.log(106, this.reduceHours);
|
|
|
if (!this.enableConsumeNonSplit) {
|
|
|
return `选择${this.reduceHours}小时,`;
|
|
|
}
|
|
@@ -257,7 +257,8 @@ export default {
|
|
|
this.reduceHours = this.consume.hasOwnProperty('discountFee') ? this.consume.discountFee / this.orderDetail.parkingRule.hourPrice : this.consume.defaultDiscountTime;
|
|
|
if (JSON.stringify(this.consume) !== '{}') {
|
|
|
const isSelected = this.consume.hasOwnProperty('selected') ? this.consume.selected : this.consume.defaultSelected;
|
|
|
- this.maxReduceDiscount = this.consume.hasOwnProperty('discountFee') ? this.consume.discountFee / hourPrice : this.consume.defaultDiscountTime;
|
|
|
+ this.maxReduceDiscount = this.consume.hasOwnProperty('discountFee') ? this.consume.discountFee / hourPrice : Math.min(this.consume.defaultDiscountTime, this.consume.maxDiscountTime);
|
|
|
+ this.reduceHours = this.consume.hasOwnProperty('discountFee') ? this.consume.discountFee / this.orderDetail.parkingRule.hourPrice : Math.min(this.consume.defaultDiscountTime, this.consume.maxDiscountTime);
|
|
|
// const remainingLimitToIncrease = Math.abs(this.remainPrice - this.availableDiscountFee) / hourPrice
|
|
|
// if (remainingLimitToIncrease) {
|
|
|
// this.maxReduceDiscountInit();
|
|
@@ -297,7 +298,7 @@ export default {
|
|
|
|
|
|
const remainingLimitToIncrease = Math.abs(this.remainPrice - this.availableDiscountFee || 0) / hourPrice;
|
|
|
// 如果是浦东的话, 重新计算优惠
|
|
|
- if (this.parkMallCode === 1) {
|
|
|
+ if (this.parkMallCode === 1 || this.parkMallCode === 0) {
|
|
|
/*
|
|
|
* 消费减免真实可用优惠的计算逻辑
|
|
|
* 消费减免可能选择的情况: X
|
|
@@ -411,6 +412,10 @@ export default {
|
|
|
},
|
|
|
async memberClick() {
|
|
|
await waitByTime(200)
|
|
|
+ // 没有优惠时不做多余的事情
|
|
|
+ if(JSON.stringify(this.memberGrade) === '{}') {
|
|
|
+ return;
|
|
|
+ }
|
|
|
if(!this.actualPayFee) {
|
|
|
Toast('当前无需追加优惠')
|
|
|
this.checkedList = this.checkedList.filter(elm => elm !== 'member')
|
|
@@ -419,7 +424,7 @@ export default {
|
|
|
const { maxConsumeTime, remainConsumeTime, availableDiscountFee, hourPrice } = this.orderDetail.parkingRule;
|
|
|
if (this.checkedList.indexOf('member') > -1) {
|
|
|
/* 浦东 */
|
|
|
- if(this.parkMallCode === 1) {
|
|
|
+ if(this.parkMallCode === 1 || this.parkMallCode === 0) {
|
|
|
const [isCrossMessage = false, maxReduceDiscount = this.maxReduceDiscount] = this.crossMessage();
|
|
|
if (!isCrossMessage) {
|
|
|
this.remainPrice = this.memberGrade.discountFee + this.remainPrice;
|
|
@@ -438,14 +443,14 @@ export default {
|
|
|
}
|
|
|
} else if (!this.isMember) {
|
|
|
// 浦东单独处理
|
|
|
- if(this.parkMallCode === 1) {
|
|
|
+ if(this.parkMallCode === 1 && this.parkMallCode === 0) {
|
|
|
this.remainPrice = this.remainPrice - this.memberGrade.discountFee;
|
|
|
this.maxReduceDiscountInit();
|
|
|
return
|
|
|
}
|
|
|
this.remainPrice = this.remainPrice - this.memberGrade.discountFee;
|
|
|
// 如果不是沈阳,重新计算优惠
|
|
|
- if (this.parkMallCode !== 4 && this.parkMallCode !== 6) {
|
|
|
+ if (this.parkMallCode !== 4 && this.parkMallCode !== 6 && JSON.stringify(this.consume) !== '{}') {
|
|
|
this.maxReduceDiscount = remainConsumeTime;
|
|
|
}
|
|
|
// 如果不是沈阳,重新计算优惠
|
|
@@ -470,14 +475,18 @@ export default {
|
|
|
this.checkedList = this.checkedList.filter(elm => elm !== 'reduces')
|
|
|
return;
|
|
|
}
|
|
|
+ // 没有优惠时不做多余的事情
|
|
|
+ if(JSON.stringify(this.consume) === '{}') {
|
|
|
+ return;
|
|
|
+ }
|
|
|
// 浦东
|
|
|
- if(this.parkMallCode === 1 && (this.isReduces || !this.maxReduceDiscount) ) {
|
|
|
+ if((this.parkMallCode === 1 || this.parkMallCode === 0) && (this.isReduces || !this.maxReduceDiscount) ) {
|
|
|
return;
|
|
|
}
|
|
|
const { maxOneTimeDiscountTime, hourPrice, oneTimeLimitation, maxConsumeTime, remainConsumeTime, oneDayLimitation, maxOneDayDiscountFee, availableDiscountFee } = this.orderDetail.parkingRule;
|
|
|
const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice;
|
|
|
if (this.checkedList.indexOf('reduces') > -1) {
|
|
|
- if(this.parkMallCode === 1) {
|
|
|
+ if(this.parkMallCode === 1 || this.parkMallCode === 0) {
|
|
|
const [isCrossMessage = false, maxReduceDiscount = this.maxReduceDiscount] = this.crossMessage();
|
|
|
if(isCrossMessage) {
|
|
|
this.checkedList = this.checkedList.filter((elm) => elm !== 'reduces');
|
|
@@ -556,7 +565,7 @@ export default {
|
|
|
// const {parkInfo,parkingRule,discountInfo} = this.orderDetail
|
|
|
const { maxOneTimeDiscountTime, maxOneDayDiscountFee, oneTimeLimitation, oneDayLimitation, hourPrice, remainConsumeTime } = this.orderDetail.parkingRule;
|
|
|
// 浦东
|
|
|
- if (this.parkMallCode === 1) {
|
|
|
+ if (this.parkMallCode === 1 || this.parkMallCode === 0) {
|
|
|
const maxOneTimeDiscountFee = maxOneTimeDiscountTime * hourPrice;
|
|
|
const remainConsumeTimeFee = remainConsumeTime * hourPrice;
|
|
|
|
|
@@ -574,14 +583,14 @@ export default {
|
|
|
// 如果初次进来操作的跟原来的不一样则重新计算优惠
|
|
|
if (this.checkedList.length !== this.checkedTotal || true) {
|
|
|
['member', 'reduces'].forEach((key) => {
|
|
|
- if (key === 'member') {
|
|
|
+ if (key === 'member' && JSON.stringify(this.memberGrade) !== '{}') {
|
|
|
this.memberGrade = {
|
|
|
...this.memberGrade,
|
|
|
selected: this.checkedList.indexOf(key) > -1,
|
|
|
};
|
|
|
orderDetail.discountInfo.memberGrade = [this.memberGrade];
|
|
|
}
|
|
|
- if (key === 'reduces') {
|
|
|
+ if (key === 'reduces' && JSON.stringify(this.consume) !== '{}') {
|
|
|
this.consume = {
|
|
|
...this.consume,
|
|
|
discountTime: this.reduceHours,
|