Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_wechat
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pseer
gxpt_wechat
Commits
607ebae9
Commit
607ebae9
authored
Feb 07, 2024
by
zhangzhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取时间戳优化
parent
e0c4b5db
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
12 deletions
+11
-12
order.vue
pages/order/order.vue
+11
-12
No files found.
pages/order/order.vue
View file @
607ebae9
...
@@ -509,8 +509,7 @@
...
@@ -509,8 +509,7 @@
this
.
onSetStartHours
()
this
.
onSetStartHours
()
}
}
},
},
onLoad
(
option
)
{
onLoad
(
option
)
{
// this.$refs.popupMessage.open();
uni
.
showLoading
({
uni
.
showLoading
({
title
:
"加载中"
title
:
"加载中"
})
})
...
@@ -547,7 +546,7 @@
...
@@ -547,7 +546,7 @@
},
},
onSetSelectTime
(){
onSetSelectTime
(){
if
(
this
.
dateIndex
===
0
){
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
=>
{
this
.
hourList
=
this
.
hourList
.
filter
(
item
=>
Number
(
item
)
>=
h
).
map
(
item
=>
{
let
i
=
Number
(
item
)
let
i
=
Number
(
item
)
return
i
>=
10
?
i
:
`0
${
i
}
`
return
i
>=
10
?
i
:
`0
${
i
}
`
...
@@ -561,7 +560,7 @@
...
@@ -561,7 +560,7 @@
},
},
onSetStartHours
(){
onSetStartHours
(){
if
(
this
.
dateIndex
===
0
){
if
(
this
.
dateIndex
===
0
){
this
.
startHours
=
new
Date
().
getHours
(
);
this
.
startHours
=
Number
(
moment
().
format
(
"HH"
)
);
}
else
{
}
else
{
this
.
startHours
=
0
this
.
startHours
=
0
}
}
...
@@ -1010,8 +1009,8 @@
...
@@ -1010,8 +1009,8 @@
selectNum
+=
1
selectNum
+=
1
t
=
i
t
=
i
}
else
if
(
val
.
status
==
1
&&
selectNum
>
0
){
}
else
if
(
val
.
status
==
1
&&
selectNum
>
0
){
let
start
=
new
Date
(
startDate
).
getTime
()
let
start
=
moment
(
startDate
).
valueOf
()
let
end
=
new
Date
(
val
.
startHoldTime
).
getTime
()
let
end
=
moment
(
val
.
startHoldTime
).
valueOf
()
if
(
end
-
start
>
this
.
duration
*
60
*
60
*
1000
){
if
(
end
-
start
>
this
.
duration
*
60
*
60
*
1000
){
todaySelectStatus
=
true
;
todaySelectStatus
=
true
;
}
else
{
}
else
{
...
@@ -1026,9 +1025,9 @@
...
@@ -1026,9 +1025,9 @@
t
=
i
t
=
i
}
else
if
(
selectNum
>
0
&&
!
val
.
status
){
}
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"
)
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
){
if
(
end
-
start
>
this
.
duration
*
60
*
60
*
1000
){
todaySelectStatus
=
true
;
todaySelectStatus
=
true
;
...
@@ -1460,8 +1459,8 @@
...
@@ -1460,8 +1459,8 @@
selectNum
+=
1
selectNum
+=
1
t
=
i
t
=
i
}
else
if
(
val
.
status
==
1
&&
selectNum
>
0
){
}
else
if
(
val
.
status
==
1
&&
selectNum
>
0
){
let
start
=
new
Date
(
startDate
).
getTime
()
let
start
=
moment
(
startDate
).
valueOf
()
let
end
=
new
Date
(
val
.
startHoldTime
).
getTime
()
let
end
=
moment
(
val
.
startHoldTime
).
valueOf
()
if
(
end
-
start
>
this
.
duration
*
60
*
60
*
1000
){
if
(
end
-
start
>
this
.
duration
*
60
*
60
*
1000
){
todaySelectStatus
=
true
;
todaySelectStatus
=
true
;
}
else
{
}
else
{
...
@@ -1476,9 +1475,9 @@
...
@@ -1476,9 +1475,9 @@
t
=
i
t
=
i
}
else
if
(
selectNum
>
0
&&
!
val
.
status
){
}
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"
)
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
){
if
(
end
-
start
>
this
.
duration
*
60
*
60
*
1000
){
todaySelectStatus
=
true
;
todaySelectStatus
=
true
;
}
else
{
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment