Commit 9d7bf76a by zhangzhen

细节优化

parent 5cae7c58
......@@ -373,44 +373,51 @@
let continueStatus = true;
if(res.data.code ==200 && res.data.data && res.data.data.length){
res.data.data.forEach(item=>{
let start = moment(item.timeHour+':00:00').valueOf();
let end = moment(item.timeHour+':59:59').valueOf();
if( end >= startDateStemp && start <= end ){
if(item.stauts ==1){
if(this.onCheckHourUse(item.startHoldTime,item.endHoldTime)){
continueStatus = false;
console.log("节点1")
}else{
if( startDateStemp > moment(item.startHoldTime).valueOf() && startDateStemp < moment(item.endHoldTime).valueOf()){
continueStatus = false;
console.log("节点2")
}
if( endDateStemp >= moment(item.startHoldTime).valueOf() && endDateStemp <= moment(item.endHoldTime).valueOf()){
new Promise((resolve,reject) => {
res.data.data.forEach((item,i)=>{
console.log(i)
let start = moment(item.timeHour+':00:00').valueOf();
let end = moment(item.timeHour+':59:59').valueOf();
if( end >= startDateStemp && start <= end ){
if(item.stauts ==1){
if(this.onCheckHourUse(item.startHoldTime,item.endHoldTime)){
continueStatus = false;
console.log("节点3")
console.log("节点1")
}else{
if( startDateStemp > moment(item.startHoldTime).valueOf() && startDateStemp < moment(item.endHoldTime).valueOf()){
continueStatus = false;
console.log("节点2")
}
if( endDateStemp >= moment(item.startHoldTime).valueOf() && endDateStemp <= moment(item.endHoldTime).valueOf()){
continueStatus = false;
console.log("节点3")
}
}
}
}
if(i>= res.data.data.length-1){
resolve(continueStatus)
}
})
}).then(continueStatus =>{
console.log(continueStatus,"节点3")
if(continueStatus){
uni.navigateTo({
url:`/pages/order/order?roomId=${this.orderInfo.roomId}&orderNo=${this.orderInfo.orderNo}`
})
}else{
uni.showToast({
icon:"none",
title:"此订单已无可续单时段"
})
}
})
if(continueStatus){
uni.navigateTo({
url:`/pages/order/order?roomId=${this.orderInfo.roomId}&orderNo=${this.orderInfo.orderNo}`
})
}else{
uni.showToast({
icon:"none",
title:"此订单已无可续单时段"
})
}
}
}).catch(err=>{
uni.hideLoading()
......
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