Commit 19ea526a by zhangzhen

bug优化

parent 705bdff0
......@@ -339,18 +339,23 @@
day: this.orderInfo.endDate,
orderType:2
}).then(res=>{
if(res.data.code != 200){
uni.showToast({
icon:"none",
title:"服务出错,稍后再试"
})
return
}
//订单结束时间
let orderEndDate = `${this.orderInfo.endDate} ${this.orderInfo.endTime}:00`;
// 续单开始时间戳,订单未结束使用订单实际结束时间,订单结束使用当前时间
let startDateStemp = this.orderInfo.status == 2? moment().valueOf(): moment(orderEndDate).valueOf();
// 获取当前小时和分钟
let hm = moment(startDateStemp).format("HH:mm").split(":").map(item=>Number(item))
let startDateStemp = this.orderInfo.status == 2? moment(moment().format("YYYY-MM-DD HH:mm:00")).valueOf(): moment(orderEndDate).valueOf();
//订单开始时间
let orderStartTime = 0;
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){
res.data.data.forEach(item=>{
if(continueStatus) return;
......@@ -359,17 +364,19 @@
uni.navigateTo({
url:`/pages/order/order?roomId=${this.orderInfo.roomId}&orderNo=${this.orderInfo.orderNo}`
})
continueStatus = true;
}else{
let d = moment(item.startHoldTime).valueOf()
if(d - orderStartTime >= 3600*1000){
uni.navigateTo({
url:`/pages/order/order?roomId=${this.orderInfo.roomId}&orderNo=${this.orderInfo.orderNo}`
})
continueStatus = true;
return
}else{
uni.showToast({
icon:"none",
title:"此订单已无可续单时段2"
title:"此订单已无可续单时段"
})
continueStatus = true;
return
......@@ -388,7 +395,6 @@
})
}
return;
let h = this.orderInfo.endTime.split(":").map(item=>Number(item))
if(res.data.code == 200){
let val = res.data.data[h[0]+1];
......
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