Commit 23a0f6ed by zhangzhen

细节优化

parent 487e1a9b
......@@ -211,7 +211,7 @@
if(res.data.data.status ===2){
let nowTime = moment().valueOf();
let endTime = moment(res.data.data.endDate).valueOf();
if(nowTime-endTime< 15*60*1000){
if(nowTime-endTime< 150*60*1000){
this.continStatus = true;
}
}
......@@ -339,6 +339,51 @@
day: this.orderInfo.endDate,
orderType:2
}).then(res=>{
//订单结束时间
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 orderStartTime = 0;
if(res.data.code ==200 && res.data.data && res.data.data.length){
res.data.data.forEach(item=>{
if(orderStartTime){
if(item.status == 0){
uni.navigateTo({
url:`/pages/order/order?roomId=${this.orderInfo.roomId}&orderNo=${this.orderInfo.orderNo}`
})
}else{
let d = moment(item.startHoldTime).valueOf()
if(d - startDateStemp >= 3600*1000){
uni.navigateTo({
url:`/pages/order/order?roomId=${this.orderInfo.roomId}&orderNo=${this.orderInfo.orderNo}`
})
}else{
uni.showToast({
icon:"none",
title:"此订单已无可续单时段"
})
}
}
}else{
let d = 0;
if(item.status == 0){
d = moment(item.timeHour).valueOf()
}else{
d = moment(item.endHoldTime).valueOf()
}
if(d > startDateStemp){
orderStartTime = d;
console.log(moment(orderStartTime).format("YYYY-MM-DD HH:mm:ss"),"续单可开始的时间")
}
}
})
}
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