Commit 0b549540 by zhangzhen

细节优化

parent efb6c708
......@@ -103,7 +103,6 @@
},
onGetOrderByAvailable(i){
getOrderByAvailable().then(res=>{
console.log(res)
if(res.data.code === 200){
if(res.data.data&&res.data.data.length===1){
this.orderInfo = res.data.data[0];
......
......@@ -599,7 +599,9 @@
// 判断房间有没有绑定套餐
if (this.roomInfo.packList && this.roomInfo.packList.length) {
this.packageMode = this.roomInfo.packList
this.index = 1;
if(this.orderType === 1){
this.index = 1;
}
this.modeIndex = 0;
} else {
this.index = 0;
......@@ -655,78 +657,6 @@
this.onSetEndTime()
}else{
this.onCheckDate();
return
this.dateIntervalList.forEach((item,index) =>{
if(item.status==1 && this.setStartTime.duration < this.duration && moment(item.endHoldTime).format("mm")<59 ){
this.setStartTime.startTime = moment(item.endHoldTime).format("HH:mm");
this.setStartTime.startDate = moment(item.endHoldTime).format("YYYYMMDD");
if(index >= 24){
this.setStartTime.days = 2;
this.days = 2;
}
this.setStartTime.duration = 0;
this.setStartTime.status = true;
}if(item.status==1 && this.setStartTime.duration < this.duration && moment(item.startHoldTime).format("mm") > 0){
this.setStartTime.startTime = moment(item.endHoldTime).format("HH:mm");
this.setStartTime.startDate = moment(item.endHoldTime).format("YYYYMMDD");
if(index>=24){
this.setStartTime.days = 2
this.days = 2;
}
this.setStartTime.duration = 0;
this.setStartTime.status = true;
} else if(item.status==1 && this.setStartTime.duration < this.duration && moment(item.endHoldTime).format("mm") >=59 ){
this.setStartTime.duration = 0;
this.setStartTime.status = false;
}else if(item.status==1 && this.setStartTime.status && this.setStartTime.duration === this.duration && moment(this.setStartTime.startTime).format("mm") < moment(item.startHoldTime).format("mm")){
this.startTime = this.setStartTime.startTime;
this.setStartTime.duration+=1;
if(index>=24){
this.setStartTime.days = 2
this.days = 2;
}
}else if(item.status==1 && this.setStartTime.status && this.setStartTime.duration === this.duration && moment(this.setStartTime.startTime).format("mm") >= moment(item.startHoldTime).format("mm")){
this.setStartTime.duration = 0;
this.setStartTime.status = false;
} else if(item.status === 0 && this.setStartTime.duration === 0 && !this.setStartTime.status){
this.setStartTime.duration += 1;
this.setStartTime.startTime = `${index>=10?index:'0'+index}:00`;
if(index>=24){
let ii = index-24
this.setStartTime.startTime = `${ii>=10?ii:'0'+ii}:00`;
this.setStartTime.days = 2
this.days = 2;
}
this.setStartTime.status = true;
}else if(item.status === 0 && this.setStartTime.duration >= 0 && this.setStartTime.duration < this.duration && this.setStartTime.status){
this.setStartTime.duration += 1;
} else if(item.status === 0 && this.setStartTime.duration == this.duration && this.setStartTime.status){
//到这里就结束了
this.startTime = this.setStartTime.startTime;
this.setStartTime.duration+=1;
}
if(index >= this.dateIntervalList.length-1){
if(!this.addM && this.dateIntervalList[0].status){
this.addM = true
// 开始时间加一分钟
let arr = this.startTime.split(":");
let m = Number(arr[1])+1
let h = Number(arr[0])
if(m>=60){
h+=1
m-=60
}
if(h>=24){
h -=24
this.setStartTime.days = 2
this.days = 2;
}
this.startTime = `${h>=10?h:'0'+h}:${m>=10?m:'0'+m}`
}
this.onSetEndTime()
}
})
}
})
},
......@@ -1484,15 +1414,6 @@
let startArr = startTime.split(":")
let endArr = endTime.split(":")
// if(this.setStartTime.days==2 || this.days ==2){
// obj.startDate =`${moment(this.dateList[this.dateIndex].readDate).add(1,"days").format("YYYY-MM-DD")} ${startTime}:00`
// this.setStartTime.days = 1;
// this.days = 1
// }else{
// obj.startDate = `${this.dateList[this.dateIndex].readDate} ${startTime}:00`
// }
obj.startDate = `${this.dateList[this.dateIndex].readDate} ${startTime}:01`
if ((this.orderType == 1 && Number(endArr[0]) <= Number(startArr[0]))) {
......
......@@ -122,7 +122,7 @@
</view>
</view>
<view v-if="orderInfo.status ===0 && orderInfo.isRefund && !shareOrder" class="cancle-btn-box">
<view v-if="orderInfo.isRefund && !shareOrder" class="cancle-btn-box">
<button class="cu-btn bg-pink round block lg" @tap="onOrderRefund">立即退单</button>
</view>
</view>
......
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