Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jz_Travel
Project
Project
Details
Activity
Releases
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
zhengke
jz_Travel
Commits
b6a59fea
Commit
b6a59fea
authored
May 12, 2025
by
youjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
详情倒计时
parent
2e3cc651
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
orderdetails.vue
pages/hotel/orderdetails.vue
+11
-6
No files found.
pages/hotel/orderdetails.vue
View file @
b6a59fea
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
{{
orderStatus
.
text
}}
{{
orderStatus
.
text
}}
</text>
</text>
</view>
</view>
<view
class=
"RemainderBox"
v-if=
"remainingSeconds
&&orderData.directOrder.OrderStatus==1
"
>
<view
class=
"RemainderBox"
v-if=
"remainingSeconds"
>
<text>
剩余:
</text>
<text>
剩余:
</text>
<text>
{{
formattedTime
}}
</text>
<text>
{{
formattedTime
}}
</text>
</view>
</view>
...
@@ -314,11 +314,14 @@
...
@@ -314,11 +314,14 @@
},
},
computed
:
{
computed
:
{
formattedTime
()
{
formattedTime
()
{
const
minutes
=
Math
.
floor
(
this
.
remainingSeconds
/
60
/
1000
)
const
minutes
=
Math
.
floor
(
this
.
remainingSeconds
/
60
)
const
seconds
=
this
.
remainingSeconds
%
60
%
1000
const
seconds
=
this
.
remainingSeconds
%
60
return
`
${
minutes
.
toString
().
padStart
(
2
,
'0'
)}
:
${
seconds
.
toString
().
padStart
(
2
,
'0'
)}
`
return
`
${
minutes
.
toString
().
padStart
(
2
,
'0'
)}
:
${
seconds
.
toString
().
padStart
(
2
,
'0'
)}
`
}
}
},
},
beforeDestroy
()
{
this
.
clearInterval
()
},
created
()
{
created
()
{
this
.
Up
=
uni
.
getStorageSync
(
"mall_UserInfo"
)
?
this
.
Up
=
uni
.
getStorageSync
(
"mall_UserInfo"
)
?
uni
.
getStorageSync
(
"mall_UserInfo"
).
UserPageType
:
uni
.
getStorageSync
(
"mall_UserInfo"
).
UserPageType
:
...
@@ -532,9 +535,10 @@
...
@@ -532,9 +535,10 @@
this
.
orderData
.
directOrder
.
CreateTime
=
this
.
$utils
.
formatDates
(
new
Date
(
tempData
.
directOrder
.
CreateTime
),
'yyyy-MM-dd hh:mm:ss'
)
this
.
orderData
.
directOrder
.
CreateTime
=
this
.
$utils
.
formatDates
(
new
Date
(
tempData
.
directOrder
.
CreateTime
),
'yyyy-MM-dd hh:mm:ss'
)
// 支付倒计时
// 支付倒计时
if
(
t
empData
.
directOrder
.
OrderStatus
==
1
)
{
if
(
t
his
.
orderData
.
directOrder
.
CreateTime
&&
tempData
.
directOrder
.
OrderStatus
==
1
)
{
const
now
=
Date
.
now
();
const
now
=
Date
.
now
();
const
customStr
=
this
.
orderData
.
directOrder
.
CreateTime
//'2025-05-12 10:17:00'
// const customStr = '2025-05-12 14:33:47'
const
customStr
=
this
.
orderData
.
directOrder
.
CreateTime
const
[
date
,
time
]
=
customStr
.
split
(
' '
)
const
[
date
,
time
]
=
customStr
.
split
(
' '
)
const
[
year
,
month
,
day
]
=
date
.
split
(
'-'
)
const
[
year
,
month
,
day
]
=
date
.
split
(
'-'
)
const
[
hours
,
minutes
,
seconds
]
=
time
.
split
(
':'
)
const
[
hours
,
minutes
,
seconds
]
=
time
.
split
(
':'
)
...
@@ -542,7 +546,8 @@
...
@@ -542,7 +546,8 @@
this
.
orderTime
=
parsedDate
.
getTime
()
this
.
orderTime
=
parsedDate
.
getTime
()
const
diff
=
this
.
orderTime
+
5
*
60
*
1000
-
now
;
// 5分钟倒计时
const
diff
=
this
.
orderTime
+
5
*
60
*
1000
-
now
;
// 5分钟倒计时
this
.
remainingSeconds
=
Math
.
max
(
diff
,
0
);
// 确保不出现负数
let
remainingSeconds
=
Math
.
max
(
diff
,
0
);
// 确保不出现负数
this
.
remainingSeconds
=
Math
.
floor
(
remainingSeconds
/
1000
)
// 启动倒计时
// 启动倒计时
if
(
this
.
remainingSeconds
)
this
.
startCountdown
()
if
(
this
.
remainingSeconds
)
this
.
startCountdown
()
else
this
.
handleTimeout
()
else
this
.
handleTimeout
()
...
...
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