Commit 3ff4b65b authored by 罗超's avatar 罗超

修改优惠

parent 97a362a1
......@@ -73,6 +73,21 @@
money: 0,
};
},
watch: {
price: {
deep: true,
immediate: true,
handler: function(newVal, oldVal) {
this.ts.forEach((x)=>{
console.log(!x.err || x.err=='订单金额不满足')
if(!x.err || x.err=='订单金额不满足'){
x.err = x.useCondition>this.price?'订单金额不满足':null
}
})
this.OverlayCalculation()
},
},
},
mounted() {
this.mc = this.$uiConfig.mainColor;
this.currentChosen = this.current;
......
......@@ -147,7 +147,7 @@
</view>
</view>
<coupon v-if="couponList.length > 0 && showCoupon" :price="1" :list="couponList" :current="useCouponId"
<coupon v-if="couponList.length > 0 && showCoupon" :price="price" :list="couponList" :current="useCouponId"
@close="closeCouponHandler"></coupon>
<u-picker mode="selector" v-model="saleVisable" @confirm="setSaleHandle" :default-selector="[0]" :range="sales" range-key="EmName"></u-picker>
<u-modal :border-radius="16" @confirm="nativageToOrderHandle" title="订单提醒" content="订单创建成功,请您在6小时内完成付款,否则将会被取消." @cancel="navigatorToHomeHandle" v-model="successVisible" confirm-text='查看订单' cancel-text='返回首页' confirm-color='#DEBF7B' cancel-color='#080A09' :show-cancel-button="true"></u-modal>
......@@ -202,7 +202,7 @@
},
showCoupon: false,
couponList: [],
useCouponId: 0,
useCouponId: [],
currentCoupon: {
discountMoney: 0
},
......@@ -371,7 +371,7 @@
OrderSource:5,
Unit_Price:this.flight.B2BPrice,
TC_Price:this.flight.B2BPrice,
CouponAllotIds:this.useCouponId.toString(),
CouponAllotIds:this.useCouponId.join(','),
ManNum:this.crCount,
ChirdNum:this.etCount,
ChirdNeedBedNum:this.etCount,
......@@ -395,19 +395,22 @@
this.guest = val ? val : []
},
closeCouponHandler(e) {
this.useCouponId = []
this.currentCoupon.discountMoney = 0
if (e != -1) {
this.useCouponId = e;
if (this.useCouponId) {
this.currentCoupon = this.couponList.find(x => x.id == this.useCouponId)
if (this.currentCoupon.couponsType == 1) {
this.currentCoupon.discountMoney = this.currentCoupon.denomination
if (this.useCouponId.length>0) {
const cp = this.couponList.filter(x=>this.useCouponId.indexOf(x.id)!=-1)
if(cp.length>0){
cp.forEach(x=>{
if (x.couponsType == 1) {
this.currentCoupon.discountMoney += x.denomination
} else {
this.currentCoupon.discountMoney = (parseFloat(this.price) * (1 - parseFloat(this.currentCoupon
.denomination / 10)))
.toFixed(2)
this.currentCoupon.discountMoney += parseFloat((parseFloat(this.price) * (1 - parseFloat(x.denomination / 10))).toFixed(2))
}
})
}
} else {
this.currentCoupon.discountMoney = 0
}
}
this.showCoupon = false;
......
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