Commit a828c9de authored by youjie's avatar youjie

包车优惠券

parent c4c4c4b0
...@@ -696,6 +696,7 @@ ...@@ -696,6 +696,7 @@
this.useCouponIds = [] this.useCouponIds = []
} }
this.showCoupon = false; this.showCoupon = false;
this.CalTotalPrice();
}, },
calcMaxCouponHandle() { calcMaxCouponHandle() {
if (this.couponList && this.couponList.length > 0) { if (this.couponList && this.couponList.length > 0) {
...@@ -703,14 +704,14 @@ ...@@ -703,14 +704,14 @@
let discount = 0 let discount = 0
const money = this.price const money = this.price
this.couponList.forEach(x => { this.couponList.forEach(x => {
if (x.couponsType == 1 && x.denomination > discount && (this.orderMsg.AdultPeopleNum >= x if (x.couponsType == 1 && x.denomination > discount && (this.orderMsg.PeopleNum >= x
.orderGuestNum || !x.orderGuestNum)) { .orderGuestNum || !x.orderGuestNum)) {
discount = x.denomination discount = x.denomination
maxCouponId = x.id maxCouponId = x.id
} }
if (x.couponsType == 2) { if (x.couponsType == 2) {
let disMoney = money * (1 - x.denomination) let disMoney = money * (1 - x.denomination)
if (discount < disMoney && (this.orderMsg.AdultPeopleNum >= x.orderGuestNum || !x if (discount < disMoney && (this.orderMsg.PeopleNum >= x.orderGuestNum || !x
.orderGuestNum)) { .orderGuestNum)) {
discount = disMoney discount = disMoney
maxCouponId = x.id maxCouponId = x.id
...@@ -794,8 +795,8 @@ ...@@ -794,8 +795,8 @@
} else { } else {
this.orderMsg.Num++; this.orderMsg.Num++;
} }
this.getUserCouponList() if(this.currentCoupon.discountMoney>0) this.calcMaxCouponHandle();
// this.CalTotalPrice(); else this.CalTotalPrice();
}, },
formatDate(str) { formatDate(str) {
let temp = str.split("-"); let temp = str.split("-");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment