Commit 9468ff19 by zhangzhen

细节优化

parent c69f70df
......@@ -106,7 +106,7 @@
title:"券码核验中"
})
couponChecked({
code:this.code,
code:this.code.split(" ").join(""),
openShopUuid:this.openShopUuid
}).then(res=>{
console.log(res,909090)
......
......@@ -188,7 +188,7 @@
<text class="text-black text-left">{{useCouponList[selectCouponIndex].couponType==2? '团购券':'优惠券'}}</text>
<view class="flex-row" @tap="onNavToSelectCoupon">
<text class="" :class="useCouponList.length?'text-pink':'text-gray'">
{{selectCouponIndex === -1 ? '请选择' : useCouponList.length && selectCouponIndex>=0? useCouponList[selectCouponIndex].name: '暂无可用'}}</text>
{{ useCouponList.length && selectCouponIndex>=0? useCouponList[selectCouponIndex].name: useCouponList.length? '请选择':'暂无可用'}}</text>
<text class="cuIcon-right " :class="useCouponList.length?'text-pink':'text-gray'"></text>
</view>
</view>
......@@ -196,7 +196,7 @@
<text class="text-black text-left">预约优惠</text>
<view class="flex-row">
<!-- <text class="text-pink text-sm text-bold" style="margin-bottom: 3upx;">{{computePriceInfo.couponFee>0?'-':''}}</text> -->
<text class="text-pink text-lg text-bold">{{computePriceInfo.couponFee}}</text>
<text class="text-pink text-lg text-bold">{{computePriceInfo.couponFee||0}}</text>
<text></text>
</view>
</view>
......@@ -435,7 +435,7 @@
editDuration: [],
checkedCouponInfo: '',
useDateStatus: true,
selectCouponIndex: 0,
selectCouponIndex: -1,
useCouponList: [], //可使用的优惠券
computePriceInfo: {
couponFee: '',
......@@ -840,11 +840,13 @@
orderType: this.orderType,
packageId:this.packageMode[this.modeIndex].id
}).then(res => {
if (res.data.code == 200) {
if (res.data && res.data.data.length) {
this.useCouponList = res.data.data.filter(item => item.isAvailable === 0).sort((a,
b) => b.subPrice - a.subPrice);
if(this.useCouponList.length){
this.selectCouponIndex = 0;
}
}
} else if (res.data.code == 401) {
this.$refs.loginPop.open();
......@@ -873,6 +875,8 @@
roomId: that.roomInfo.id,
orderMode: that.orderTypeList[that.index].type,
preStartDate: that.dateObj.startDate,
orderType: that.orderType,
packageId:that.packageMode[that.modeIndex].id,
preEndDate: that.dateObj.endDate,
selectId: that.selectCouponIndex >= 0 ? that.useCouponList[that.selectCouponIndex].id :''
})
......@@ -939,6 +943,7 @@
onChangeMode(i) {
if (this.modeIndex === i) return;
this.modeIndex = i;
this.selectCouponIndex = -1;
this.duration = Number(this.packageMode[this.modeIndex].duration);
let val = this.intervalList.findIndex(item=>item.status === 2)
let len = this.intervalList.filter(item=> item.status ===2).length;
......@@ -996,11 +1001,13 @@
}
if (this.distanceIndex === i) return;
this.distanceIndex = i
this.selectCouponIndex = -1
this.onSetEndTime()
},
onDurationChange2(i) {
if (this.distanceIndex === i) return;
this.distanceIndex = i
this.selectCouponIndex = -1
this.onSetEndTime()
},
onDateChange(k) {
......@@ -1039,6 +1046,7 @@
}
this.dateIndex = k
this.selectCouponIndex = -1
this.setStartTime = {
status:false,
startTime:'',
......
......@@ -102,7 +102,6 @@
this.eventChannel.on('sendData', (data) => {
this.selectId = data.selectId || ''
console.log(this.selectId,909090)
this.onLoading(data);
})
},
......
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