Commit 9468ff19 by zhangzhen

细节优化

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