Commit 3763ca0b by zhangzhen

细节优化

parent 7a29e875
......@@ -449,9 +449,17 @@
dateObj: {},
preOrderNo: '',
roomStatusEnum: {},
roomTypeEnum: {}
roomTypeEnum: {},
setStartTime: {
status:false,
startTime:'',
duration:0
}
};
},
onShow() {
this.onGetUseCoupon();
},
onLoad(option) {
uni.showLoading({
title: "加载中"
......@@ -530,12 +538,44 @@
day: this.dateList[this.dateIndex].readDate
}).then(res => {
uni.hideLoading()
if (this.orderType === 1) {
if (this.index == 1){
this.duration = Number(this.packageMode[this.modeIndex].duration);
}else{
this.duration = Number(this.distanceMode[this.distanceIndex].duration);
}
}
this.dateIntervalList = res.data.data.map((item, index) => {
// 设置可预定的开始时间
if(item.status==1 && moment(item.endHoldTime).format("mm")<59){
this.setStartTime.startTime = moment(item.endHoldTime).format("HH:mm");
this.setStartTime.status = true;
}
if(item.status === 0 && !this.setStartTime.status){
this.setStartTime.startTime = `${index}:00`;
this.setStartTime.status = true;
}
if(item.status === 0 && this.setStartTime.status){
this.setStartTime.duration+=1;
}
if(item.status==1 && this.setStartTime.duration>0 && this.setStartTime.duration < this.duration ){
this.setStartTime.status = false;
this.setStartTime.duration = 0;
} else if(item.status==1 && this.setStartTime.duration >= this.duration && moment(this.setStartTime.startTime).format("mm") < moment(item.startHoldTime).format("mm")){
this.startTime = this.setStartTime.startTime;
} else if(item.status === 0 && this.setStartTime.duration >= this.duration){
this.startTime = this.setStartTime.startTime;
}
return {
...item,
hour: index > 0 && index - 24 == 0 ? '次日' : index > 24 ? index - 24 : index
}
})
})
this.onSetEndTime()
})
},
......
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