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
1f839e1b
Commit
1f839e1b
authored
Jul 30, 2021
by
Damon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: 答题数据不存到storage,只存已答数量
parent
216aa567
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
answer.vue
src/pages/learn/answer.vue
+4
-1
index.js
src/store/index.js
+3
-2
No files found.
src/pages/learn/answer.vue
View file @
1f839e1b
...
@@ -274,6 +274,7 @@ export default {
...
@@ -274,6 +274,7 @@ export default {
:
false
:
false
if
(
check
)
{
if
(
check
)
{
this
.
$u
.
vuex
(
`lastIndex.
${
this
.
questionWarehouseId
}
`
,
0
)
this
.
$u
.
vuex
(
`lastIndex.
${
this
.
questionWarehouseId
}
`
,
0
)
this
.
$u
.
vuex
(
`answerCount.
${
this
.
questionWarehouseId
}
`
,
0
)
this
.
$u
.
vuex
(
`questionList.
${
this
.
questionWarehouseId
}
`
,
[])
this
.
$u
.
vuex
(
`questionList.
${
this
.
questionWarehouseId
}
`
,
[])
}
}
}
else
if
(
this
.
source
===
4
)
{
}
else
if
(
this
.
source
===
4
)
{
...
@@ -473,6 +474,7 @@ export default {
...
@@ -473,6 +474,7 @@ export default {
`questionList.
${
this
.
questionWarehouseId
}
`
,
`questionList.
${
this
.
questionWarehouseId
}
`
,
this
.
questionList
[
this
.
questionWarehouseId
]
this
.
questionList
[
this
.
questionWarehouseId
]
)
)
this
.
$u
.
vuex
(
`lastIndex.
${
this
.
questionWarehouseId
}
`
,
this
.
currentIndex
)
this
.
$u
.
vuex
(
`lastIndex.
${
this
.
questionWarehouseId
}
`
,
this
.
currentIndex
)
// 统计是否达满所有试题
// 统计是否达满所有试题
...
@@ -484,6 +486,7 @@ export default {
...
@@ -484,6 +486,7 @@ export default {
0
0
)
)
this
.
$u
.
vuex
(
`answerCount.
${
this
.
questionWarehouseId
}
`
,
this
.
count
)
if
(
this
.
count
===
this
.
total
)
{
if
(
this
.
count
===
this
.
total
)
{
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
return
this
.
$u
.
toast
(
'您已经答完全部试题'
)
return
this
.
$u
.
toast
(
'您已经答完全部试题'
)
...
...
src/store/index.js
View file @
1f839e1b
...
@@ -15,11 +15,11 @@ let saveStateKeys = [
...
@@ -15,11 +15,11 @@ let saveStateKeys = [
'vuex_token'
,
'vuex_token'
,
'openId'
,
'openId'
,
'searchHistory'
,
'searchHistory'
,
'questionList'
,
'lastIndex'
,
'lastIndex'
,
'tipStatus'
,
'tipStatus'
,
'questionWarehouseId'
,
'questionWarehouseId'
,
'relationId'
,
// 绑卡用
'relationId'
,
// 绑卡用
'answerCount'
]
]
// 保存变量到本地存储中
// 保存变量到本地存储中
...
@@ -45,7 +45,7 @@ const store = new Vuex.Store({
...
@@ -45,7 +45,7 @@ const store = new Vuex.Store({
openId
:
lifeData
.
openId
?
lifeData
.
openId
:
''
,
openId
:
lifeData
.
openId
?
lifeData
.
openId
:
''
,
relationId
:
lifeData
.
relationId
?
lifeData
.
relationId
:
''
,
// 绑卡用
relationId
:
lifeData
.
relationId
?
lifeData
.
relationId
:
''
,
// 绑卡用
searchHistory
:
lifeData
.
searchHistory
?
lifeData
.
searchHistory
:
[],
// 搜索历史记录
searchHistory
:
lifeData
.
searchHistory
?
lifeData
.
searchHistory
:
[],
// 搜索历史记录
questionList
:
lifeData
.
questionList
?
lifeData
.
questionList
:
{},
// 练习列表
answerCount
:
lifeData
.
answerCount
?
lifeData
.
answerCount
:
{},
// 已回答题数
lastIndex
:
lifeData
.
lastIndex
?
lifeData
.
lastIndex
:
{},
// 上次做到第几题
lastIndex
:
lifeData
.
lastIndex
?
lifeData
.
lastIndex
:
{},
// 上次做到第几题
tipStatus
:
lifeData
.
tipStatus
?
lifeData
.
tipStatus
:
false
,
// 滑动提示
tipStatus
:
lifeData
.
tipStatus
?
lifeData
.
tipStatus
:
false
,
// 滑动提示
questionWarehouseId
:
lifeData
.
questionWarehouseId
questionWarehouseId
:
lifeData
.
questionWarehouseId
...
@@ -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'
,
questionList
:
{},
// 练习列表
beginTime
:
null
// 考试开始时间
beginTime
:
null
// 考试开始时间
},
},
mutations
:
{
mutations
:
{
...
...
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