Commit 705bdff0 by zhangzhen

细节优化

parent 103a5540
...@@ -349,6 +349,8 @@ ...@@ -349,6 +349,8 @@
let orderStartTime = 0; let orderStartTime = 0;
let continueStatus = false; let continueStatus = false;
console.log(moment(startDateStemp).format("YYYY-MM-DD HH:mm:ss"),"ding单结束的时间")
if(res.data.code ==200 && res.data.data && res.data.data.length){ if(res.data.code ==200 && res.data.data && res.data.data.length){
res.data.data.forEach(item=>{ res.data.data.forEach(item=>{
if(continueStatus) return; if(continueStatus) return;
...@@ -359,7 +361,7 @@ ...@@ -359,7 +361,7 @@
}) })
}else{ }else{
let d = moment(item.startHoldTime).valueOf() let d = moment(item.startHoldTime).valueOf()
if(d - startDateStemp >= 3600*1000){ if(d - orderStartTime >= 3600*1000){
uni.navigateTo({ uni.navigateTo({
url:`/pages/order/order?roomId=${this.orderInfo.roomId}&orderNo=${this.orderInfo.orderNo}` url:`/pages/order/order?roomId=${this.orderInfo.roomId}&orderNo=${this.orderInfo.orderNo}`
}) })
...@@ -367,35 +369,19 @@ ...@@ -367,35 +369,19 @@
}else{ }else{
uni.showToast({ uni.showToast({
icon:"none", icon:"none",
title:"此订单已无可续单时段" title:"此订单已无可续单时段2"
}) })
continueStatus = true; continueStatus = true;
return return
} }
} }
}else{ }else{
if(item.status == 0){ if(item.status == 1) {
let d = moment(item.timeHour).valueOf()
if(d > startDateStemp){
orderStartTime = d;
console.log(moment(orderStartTime).format("YYYY-MM-DD HH:mm:ss"),"续单可开始的时间")
}
}else{
let d = moment(item.endHoldTime).valueOf(); let d = moment(item.endHoldTime).valueOf();
let s = moment(item.startHoldTime).valueOf() if( d >= startDateStemp ){
if(startDateStemp>d){ orderStartTime = d;
orderStartTime = d;
console.log(moment(orderStartTime).format("YYYY-MM-DD HH:mm:ss"),"续单可开始的时间2") console.log(moment(orderStartTime).format("YYYY-MM-DD HH:mm:ss"),"续单可开始的时间2")
} }
if(startDateStemp > s && startDateStemp< d){
uni.showToast({
icon:"none",
title:"此订单已无可续单时段"
});
continueStatus = true;
return
}
} }
} }
......
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