Commit 73bd7e75 authored by youjie's avatar youjie

优惠券满足条件

parent 9488eb50
......@@ -117,8 +117,16 @@
})
this.OverlayCalculation()
this.checkOrderCoupon()
this.reorder()
},
methods: {
reorder(){
this.ts.sort((a,b) => {
const aerr = (a.err?a.err:'').length
const berr = (b.err?b.err:'').length
return aerr-berr
})
},
checkOrderCoupon(){
if (this.currentPrice && this.currentPrice.teamType==1) {
//totalSeat:总机位 isSubstitution:1 (可候补) leaderNum:领队
......@@ -132,11 +140,7 @@
this.ts.forEach(x => {
if(x.couponsUseScope==10) x.err = errorMsg
})
this.ts.sort((a,b) => {
const aerr = (a.err?a.err:'').length
const berr = (b.err?b.err:'').length
return aerr-berr
})
this.reorder()
}
this.ts.forEach((x)=>{
if(!x.err && x.useCondition>this.price){
......@@ -220,11 +224,7 @@
}
}
})
this.ts.sort((a,b) => {
const aerr = (a.err?a.err:'').length
const berr = (b.err?b.err:'').length
return aerr-berr
})
this.reorder()
}
},
};
......
......@@ -863,9 +863,9 @@
calcPzCouponHandler(){
this.couponList.forEach((x)=>{
if(x.expansionModel.denomination>0){
if(this.pzCoupon && this.pzCoupon.expansionModel.denomination<x.expansionModel.denomination)
if(this.pzCoupon && this.pzCoupon.expansionModel.denomination<x.expansionModel.denomination&&(this.total>=x.orderGuestNum||!x.orderGuestNum))
this.pzCoupon=x
else if(!this.pzCoupon)
else if(!this.pzCoupon&&(this.total>=x.orderGuestNum||!x.orderGuestNum))
this.pzCoupon=x
x.realDenomination = x.denomination
......
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