|
@@ -233,7 +233,7 @@ export default {
|
|
|
const { memberGrade = [{}], consume = [], memberLevelDiscount, points = [{}] } = this.orderDetail.discountInfo;
|
|
|
const { maxConsumeTime, remainConsumeTime, hourPrice } = this.orderDetail.parkingRule;
|
|
|
// 如果积分存在的话,则移除积分的优惠
|
|
|
- if (JSON.stringify(points) !== {}) {
|
|
|
+ if (points.length && JSON.stringify(points[0]) !== "{}") {
|
|
|
this.remainPrice = this.parkMallCode !== 1 ? this.usingTotalDiscount - points[0].discountFee : this.usingTotalDiscount;
|
|
|
}
|
|
|
this.memberGrade = { ...memberGrade[0] };
|
|
@@ -371,8 +371,17 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
},
|
|
|
- memberClick() {
|
|
|
- // debugger
|
|
|
+ async memberClick() {
|
|
|
+ await waitByTime(200)
|
|
|
+ // 没有优惠时不做多余的事情
|
|
|
+ if(JSON.stringify(this.memberGrade) === '{}') {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(!this.actualPayFee) {
|
|
|
+ Toast('当前无需追加优惠')
|
|
|
+ this.checkedList = this.checkedList.filter(elm => elm !== 'member')
|
|
|
+ return;
|
|
|
+ }
|
|
|
const { maxConsumeTime, remainConsumeTime, availableDiscountFee, hourPrice } = this.orderDetail.parkingRule;
|
|
|
if (this.checkedList.indexOf('member') > -1) {
|
|
|
/* 浦东 */
|
|
@@ -402,7 +411,7 @@ export default {
|
|
|
}
|
|
|
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;
|
|
|
}
|
|
|
// 如果不是沈阳,重新计算优惠
|
|
@@ -420,7 +429,21 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- reducesClick() {
|
|
|
+ async reducesClick() {
|
|
|
+ await waitByTime(200)
|
|
|
+ if(!this.actualPayFee) {
|
|
|
+ Toast('当前无需追加优惠')
|
|
|
+ this.checkedList = this.checkedList.filter(elm => elm !== 'reduces')
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 没有优惠时不做多余的事情
|
|
|
+ if(JSON.stringify(this.consume) === '{}') {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 浦东
|
|
|
+ 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) {
|
|
@@ -504,14 +527,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,
|