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
4922cbfe
Commit
4922cbfe
authored
Jul 22, 2021
by
Damon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 滑动提示
parent
7744dd92
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
answer.vue
src/pages/learn/answer.vue
+9
-5
index.js
src/store/index.js
+2
-1
No files found.
src/pages/learn/answer.vue
View file @
4922cbfe
...
@@ -218,10 +218,6 @@ export default {
...
@@ -218,10 +218,6 @@ export default {
break
;
break
;
}
}
// 第一次进入,显示提示
if
(
this
.
questionList
.
length
===
0
)
{
this
.
show
=
true
}
this
.
init
()
this
.
init
()
},
},
methods
:
{
methods
:
{
...
@@ -374,7 +370,15 @@ export default {
...
@@ -374,7 +370,15 @@ export default {
item
.
result
=
status
item
.
result
=
status
item
.
errShow
=
this
.
type
===
2
?
true
:
status
===
'fail'
item
.
errShow
=
this
.
type
===
2
?
true
:
status
===
'fail'
item
.
userAnswer
=
userAnswer
item
.
userAnswer
=
userAnswer
// 保存答案
if
(
this
.
model
===
1
)
this
.
saveAnswer
(
item
)
if
(
this
.
model
===
1
)
this
.
saveAnswer
(
item
)
// 滑动提示
if
(
!
this
.
tipStatus
&&
status
===
'fail'
)
{
this
.
$u
.
vuex
(
'tipStatus'
,
true
)
this
.
show
=
true
}
// 更新答题卡
// 更新答题卡
if
(
this
.
type
===
1
){
if
(
this
.
type
===
1
){
this
.
questionList
[
this
.
currentIndex
]
=
item
this
.
questionList
[
this
.
currentIndex
]
=
item
...
@@ -395,7 +399,7 @@ export default {
...
@@ -395,7 +399,7 @@ export default {
// 如果回答错误或者是考试模式,自动进入下一题
// 如果回答错误或者是考试模式,自动进入下一题
if
((
status
===
'pass'
&&
this
.
model
!==
2
)
||
this
.
type
===
2
)
{
if
((
status
===
'pass'
&&
this
.
model
!==
2
)
||
this
.
type
===
2
)
{
if
(
this
.
currentIndex
+
1
>
this
.
total
-
1
)
{
// 最后一题回答后
if
(
this
.
currentIndex
+
1
>
this
.
total
-
1
)
{
// 最后一题回答后
if
(
this
.
type
===
2
)
{
if
(
this
.
type
===
2
)
{
// 统计分数,交卷
this
.
handPapers
(
1
)
this
.
handPapers
(
1
)
this
.
submit
()
this
.
submit
()
}
}
...
...
src/store/index.js
View file @
4922cbfe
...
@@ -12,7 +12,7 @@ try{
...
@@ -12,7 +12,7 @@ try{
}
}
// 需要永久存储,且下次APP启动需要取出的,在state中的变量名
// 需要永久存储,且下次APP启动需要取出的,在state中的变量名
let
saveStateKeys
=
[
'userInfo'
,
'vuex_token'
,
'openId'
,
'searchHistory'
,
'questionList'
,
'lastIndex'
];
let
saveStateKeys
=
[
'userInfo'
,
'vuex_token'
,
'openId'
,
'searchHistory'
,
'questionList'
,
'lastIndex'
,
'tipStatus'
];
// 保存变量到本地存储中
// 保存变量到本地存储中
const
saveLifeData
=
function
(
key
,
value
){
const
saveLifeData
=
function
(
key
,
value
){
...
@@ -38,6 +38,7 @@ const store = new Vuex.Store({
...
@@ -38,6 +38,7 @@ const store = new Vuex.Store({
searchHistory
:
lifeData
.
searchHistory
?
lifeData
.
searchHistory
:
[],
// 搜索历史记录
searchHistory
:
lifeData
.
searchHistory
?
lifeData
.
searchHistory
:
[],
// 搜索历史记录
questionList
:
lifeData
.
questionList
?
lifeData
.
questionList
:
[],
// 练习列表
questionList
:
lifeData
.
questionList
?
lifeData
.
questionList
:
[],
// 练习列表
lastIndex
:
lifeData
.
lastIndex
?
lifeData
.
lastIndex
:
0
,
// 上次做到第几题
lastIndex
:
lifeData
.
lastIndex
?
lifeData
.
lastIndex
:
0
,
// 上次做到第几题
tipStatus
:
lifeData
.
tipStatus
?
lifeData
.
tipStatus
:
false
,
// 滑动提示
// 如果vuex_version无需保存到本地永久存储,无需lifeData.vuex_version方式
// 如果vuex_version无需保存到本地永久存储,无需lifeData.vuex_version方式
vuex_version
:
'1.0.0'
,
vuex_version
:
'1.0.0'
,
},
},
...
...
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