Commit 607ebae9 by zhangzhen

获取时间戳优化

parent e0c4b5db
......@@ -509,8 +509,7 @@
this.onSetStartHours()
}
},
onLoad(option) {
// this.$refs.popupMessage.open();
onLoad(option) {
uni.showLoading({
title: "加载中"
})
......@@ -547,7 +546,7 @@
},
onSetSelectTime(){
if(this.dateIndex === 0){
let h = new Date().getHours()
let h = Number(moment().format("HH"))
this.hourList = this.hourList.filter(item=> Number(item)>=h).map(item=> {
let i = Number(item)
return i>=10? i: `0${i}`
......@@ -561,7 +560,7 @@
},
onSetStartHours(){
if(this.dateIndex === 0){
this.startHours = new Date().getHours();
this.startHours = Number(moment().format("HH"));
}else{
this.startHours = 0
}
......@@ -1010,8 +1009,8 @@
selectNum += 1
t = i
} else if(val.status ==1 && selectNum > 0 ){
let start = new Date(startDate).getTime()
let end = new Date(val.startHoldTime).getTime()
let start = moment(startDate).valueOf()
let end = moment(val.startHoldTime).valueOf()
if(end-start >this.duration*60*60*1000){
todaySelectStatus = true;
} else {
......@@ -1026,9 +1025,9 @@
t = i
}else if(selectNum>0 && !val.status){
// 计算时长
let start = new Date(startDate).getTime()
let start = moment(startDate).valueOf()
endDate = endDate? moment(endDate).add(1,'h').format("YYYY-MM-DD HH:mm:ss") : moment(startDate).add(1,'h').format("YYYY-MM-DD HH:mm:ss")
let end = new Date(endDate).getTime()
let end = moment(endDate).valueOf()
if(end-start > this.duration*60*60*1000){
todaySelectStatus = true;
......@@ -1460,8 +1459,8 @@
selectNum += 1
t = i
} else if(val.status ==1 && selectNum > 0 ){
let start = new Date(startDate).getTime()
let end = new Date(val.startHoldTime).getTime()
let start = moment(startDate).valueOf()
let end = moment(val.startHoldTime).valueOf()
if(end-start >this.duration*60*60*1000){
todaySelectStatus = true;
} else {
......@@ -1476,9 +1475,9 @@
t = i
}else if(selectNum>0 && !val.status){
// 计算时长
let start = new Date(startDate).getTime()
let start = moment(startDate).valueOf()
endDate = endDate? moment(endDate).add(1,'h').format("YYYY-MM-DD HH:mm:ss") : moment(startDate).add(1,'h').format("YYYY-MM-DD HH:mm:ss")
let end = new Date(endDate).getTime()
let end = moment(endDate).valueOf()
if(end-start > this.duration*60*60*1000){
todaySelectStatus = true;
} else {
......
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