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
019222e8
Commit
019222e8
authored
Jul 17, 2021
by
Damon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: 答题状态回显
parent
d0bc0751
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
6 deletions
+25
-6
index.vue
src/components/swiper-limited-load/index.vue
+2
-1
answer.vue
src/pages/learn/answer.vue
+23
-5
No files found.
src/components/swiper-limited-load/index.vue
View file @
019222e8
...
@@ -122,8 +122,9 @@ export default {
...
@@ -122,8 +122,9 @@ export default {
this
.
swiperCurrent
=
current
this
.
swiperCurrent
=
current
},
},
answerChange
(
status
,
lists
)
{
answerChange
(
status
,
lists
)
{
// this.swiperCurrent = this.swiperCurrent + 1
this
.
$set
(
this
.
swiperList
[
this
.
swiperIndex
],
'errShow'
,
status
===
'fail'
)
this
.
$emit
(
"answerChange"
,
status
,
lists
,
this
.
list
[
this
.
swiperIndex
].
index
)
this
.
$emit
(
"answerChange"
,
status
,
lists
,
this
.
list
[
this
.
swiperIndex
].
index
)
if
(
status
===
'pass'
)
this
.
swiperCurrent
=
this
.
swiperCurrent
+
1
},
},
clear
()
{
clear
()
{
this
.
list
=
[]
this
.
list
=
[]
...
...
src/pages/learn/answer.vue
View file @
019222e8
...
@@ -160,6 +160,25 @@ export default {
...
@@ -160,6 +160,25 @@ export default {
index
:
2
,
index
:
2
,
rightKey
:
[
'B'
,
'C'
],
rightKey
:
[
'B'
,
'C'
],
},
},
{
type
:
2
,
title
:
'测试标题测试标题测试标题测试标题'
,
answerList
:
[
{
sort
:
'A'
,
text
:
'是'
,
},
{
sort
:
'B'
,
text
:
'否'
,
},
],
answer
:
'B'
,
explain
:
'测试内容测试内容测试内容测试内容测试内容测试内容'
,
index
:
3
,
rightKey
:
[
'B'
],
},
]
]
this
.
requestQuestionInfo
(
lists
)
this
.
requestQuestionInfo
(
lists
)
...
@@ -168,15 +187,14 @@ export default {
...
@@ -168,15 +187,14 @@ export default {
requestQuestionInfo
(
lists
)
{
requestQuestionInfo
(
lists
)
{
// 初始化setData后,需要调用swiper组件的init方法
// 初始化setData后,需要调用swiper组件的init方法
this
.
list
=
lists
this
.
list
=
lists
setTimeout
(()
=>
{
this
.
$nextTick
(()
=>
{
// 比如上次答到了第20题
// 比如上次答到了第20题
this
.
$refs
.
swiper
.
init
(
0
)
this
.
$refs
.
swiper
.
init
(
0
)
// 初始化后再把动画弄出来,否则初始的current不是0,界面会自动跳动到当前位置,体验不太好
// 初始化后再把动画弄出来,否则初始的current不是0,界面会自动跳动到当前位置,体验不太好
this
.
swiperDuration
=
'250'
this
.
swiperDuration
=
'250'
// 全局记一下list, 答题卡页暂时就直接用了
// 全局记一下list, 答题卡页暂时就直接用了
app
.
globalData
.
questionList
=
lists
app
.
globalData
.
questionList
=
lists
}
,
1000
)
})
},
},
swiperChange
(
e
)
{
swiperChange
(
e
)
{
let
current
=
e
.
current
let
current
=
e
.
current
...
@@ -206,8 +224,8 @@ export default {
...
@@ -206,8 +224,8 @@ export default {
},
},
// 作答完毕
// 作答完毕
answerChange
(
status
,
lists
,
index
)
{
answerChange
(
status
,
lists
,
index
)
{
this
.
$set
(
this
.
list
[
i
ndex
],
'answerList'
,
lists
)
this
.
$set
(
this
.
list
[
this
.
currentI
ndex
],
'answerList'
,
lists
)
this
.
$set
(
this
.
list
[
i
ndex
],
'errShow'
,
status
===
'fail'
)
this
.
$set
(
this
.
list
[
this
.
currentI
ndex
],
'errShow'
,
status
===
'fail'
)
app
.
globalData
.
questionList
=
this
.
list
app
.
globalData
.
questionList
=
this
.
list
console
.
log
(
"this.list"
,
app
.
globalData
.
questionList
)
console
.
log
(
"this.list"
,
app
.
globalData
.
questionList
)
},
},
...
...
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