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

修改优惠

parent 97a362a1
...@@ -73,6 +73,21 @@ ...@@ -73,6 +73,21 @@
money: 0, 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() { mounted() {
this.mc = this.$uiConfig.mainColor; this.mc = this.$uiConfig.mainColor;
this.currentChosen = this.current; this.currentChosen = this.current;
......
...@@ -147,7 +147,7 @@ ...@@ -147,7 +147,7 @@
</view> </view>
</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> @close="closeCouponHandler"></coupon>
<u-picker mode="selector" v-model="saleVisable" @confirm="setSaleHandle" :default-selector="[0]" :range="sales" range-key="EmName"></u-picker> <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> <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 @@ ...@@ -202,7 +202,7 @@
}, },
showCoupon: false, showCoupon: false,
couponList: [], couponList: [],
useCouponId: 0, useCouponId: [],
currentCoupon: { currentCoupon: {
discountMoney: 0 discountMoney: 0
}, },
...@@ -371,7 +371,7 @@ ...@@ -371,7 +371,7 @@
OrderSource:5, OrderSource:5,
Unit_Price:this.flight.B2BPrice, Unit_Price:this.flight.B2BPrice,
TC_Price:this.flight.B2BPrice, TC_Price:this.flight.B2BPrice,
CouponAllotIds:this.useCouponId.toString(), CouponAllotIds:this.useCouponId.join(','),
ManNum:this.crCount, ManNum:this.crCount,
ChirdNum:this.etCount, ChirdNum:this.etCount,
ChirdNeedBedNum:this.etCount, ChirdNeedBedNum:this.etCount,
...@@ -394,20 +394,23 @@ ...@@ -394,20 +394,23 @@
guestChangeHandle(val) { guestChangeHandle(val) {
this.guest = val ? val : [] this.guest = val ? val : []
}, },
closeCouponHandler(e) { closeCouponHandler(e) {
this.useCouponId = []
this.currentCoupon.discountMoney = 0
if (e != -1) { if (e != -1) {
this.useCouponId = e; this.useCouponId = e;
if (this.useCouponId) { if (this.useCouponId.length>0) {
this.currentCoupon = this.couponList.find(x => x.id == this.useCouponId) const cp = this.couponList.filter(x=>this.useCouponId.indexOf(x.id)!=-1)
if (this.currentCoupon.couponsType == 1) {
this.currentCoupon.discountMoney = this.currentCoupon.denomination if(cp.length>0){
} else { cp.forEach(x=>{
this.currentCoupon.discountMoney = (parseFloat(this.price) * (1 - parseFloat(this.currentCoupon if (x.couponsType == 1) {
.denomination / 10))) this.currentCoupon.discountMoney += x.denomination
.toFixed(2) } else {
this.currentCoupon.discountMoney += parseFloat((parseFloat(this.price) * (1 - parseFloat(x.denomination / 10))).toFixed(2))
}
})
} }
} else {
this.currentCoupon.discountMoney = 0
} }
} }
this.showCoupon = false; 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