Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
study
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
Damon
study
Commits
4f8c07d8
Commit
4f8c07d8
authored
Jul 28, 2021
by
Damon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 【ID1001364】【小程序-题库-模拟考试】:考试过程中,将小程序切到后台,过几分钟后再切回来,【倒计时】才过了几秒
parent
8b9a0d18
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
158 additions
and
103 deletions
+158
-103
answer.vue
src/pages/learn/answer.vue
+140
-103
utils.js
src/pages/learn/utils.js
+17
-0
index.js
src/store/index.js
+1
-0
No files found.
src/pages/learn/answer.vue
View file @
4f8c07d8
This diff is collapsed.
Click to expand it.
src/pages/learn/utils.js
View file @
4f8c07d8
...
@@ -139,8 +139,25 @@ function initAnswerCardList(total, vm) {
...
@@ -139,8 +139,25 @@ function initAnswerCardList(total, vm) {
}
}
}
}
const
diffTime
=
function
diffTime
(
startDate
,
endDate
)
{
let
diff
=
endDate
.
getTime
()
-
startDate
//.getTime();//时间差的毫秒数
//计算出相差天数
let
days
=
Math
.
floor
(
diff
/
(
24
*
3600
*
1000
))
//计算出小时数
let
leave1
=
diff
%
(
24
*
3600
*
1000
)
//计算天数后剩余的毫秒数
let
hours
=
Math
.
floor
(
leave1
/
(
3600
*
1000
))
//计算相差分钟数
let
leave2
=
leave1
%
(
3600
*
1000
)
//计算小时数后剩余的毫秒数
let
minutes
=
Math
.
floor
(
leave2
/
(
60
*
1000
))
//计算相差秒数
let
leave3
=
leave2
%
(
60
*
1000
)
//计算分钟数后剩余的毫秒数
let
seconds
=
Math
.
round
(
leave3
/
1000
)
return
seconds
}
module
.
exports
=
{
module
.
exports
=
{
TOTAL
:
TOTAL
,
TOTAL
:
TOTAL
,
diffTime
:
diffTime
,
request
:
request
,
request
:
request
,
requestMulti
:
requestMulti
,
requestMulti
:
requestMulti
,
getInitcurrentPage
:
getInitcurrentPage
,
getInitcurrentPage
:
getInitcurrentPage
,
...
...
src/store/index.js
View file @
4f8c07d8
...
@@ -53,6 +53,7 @@ const store = new Vuex.Store({
...
@@ -53,6 +53,7 @@ const store = new Vuex.Store({
:
'1414854649273384960'
,
// 科目ID
:
'1414854649273384960'
,
// 科目ID
// 如果vuex_version无需保存到本地永久存储,无需lifeData.vuex_version方式
// 如果vuex_version无需保存到本地永久存储,无需lifeData.vuex_version方式
vuex_version
:
'1.0.0'
,
vuex_version
:
'1.0.0'
,
beginTime
:
null
// 考试开始时间
},
},
mutations
:
{
mutations
:
{
$uStore
(
state
,
payload
)
{
$uStore
(
state
,
payload
)
{
...
...
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