Commit 4eb65ec5 by zhangzhen

细节优化

parent 42078746
...@@ -348,8 +348,10 @@ ...@@ -348,8 +348,10 @@
//订单开始时间 //订单开始时间
let orderStartTime = 0; let orderStartTime = 0;
let continueStatus = false;
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(orderStartTime){ if(orderStartTime){
if(item.status == 0){ if(item.status == 0){
uni.navigateTo({ uni.navigateTo({
...@@ -367,20 +369,35 @@ ...@@ -367,20 +369,35 @@
icon:"none", icon:"none",
title:"此订单已无可续单时段" title:"此订单已无可续单时段"
}) })
continueStatus = true;
return return
} }
} }
}else{ }else{
let d = 0;
if(item.status == 0){ if(item.status == 0){
d = moment(item.timeHour).valueOf() let d = moment(item.timeHour).valueOf()
}else{
d = moment(item.endHoldTime).add(1,'m').valueOf()
}
if(d > startDateStemp){ if(d > startDateStemp){
orderStartTime = d; orderStartTime = d;
console.log(moment(orderStartTime).format("YYYY-MM-DD HH:mm:ss"),"续单可开始的时间") console.log(moment(orderStartTime).format("YYYY-MM-DD HH:mm:ss"),"续单可开始的时间")
} }
}else{
let d = moment(item.endHoldTime).valueOf();
let s = moment(item.startHoldTime).valueOf()
if(startDateStemp>d){
orderStartTime = d;
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