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
6e125020
Commit
6e125020
authored
Jul 17, 2021
by
Damon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: 作答完毕逻辑处理
parent
019222e8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
11 deletions
+19
-11
index.vue
src/components/answer-sheet/index.vue
+2
-0
index.vue
src/components/swiper-limited-load/index.vue
+3
-4
answer.vue
src/pages/learn/answer.vue
+14
-7
No files found.
src/components/answer-sheet/index.vue
View file @
6e125020
...
@@ -59,7 +59,9 @@ export default {
...
@@ -59,7 +59,9 @@ export default {
data
()
{
data
()
{
return
{
return
{
lists
:
[],
lists
:
[],
// 已提交答案
submitStatus
:
false
,
submitStatus
:
false
,
// 答案对错
answer
:
''
,
answer
:
''
,
}
}
},
},
...
...
src/components/swiper-limited-load/index.vue
View file @
6e125020
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
@
change=
"answerChange"
@
change=
"answerChange"
></answer-sheet>
></answer-sheet>
</view>
</view>
<view
class=
"explain"
v-if=
"type === 1"
>
<view
class=
"explain"
>
<answer-explanation
v-show=
"model === 2 || item.errShow"
:answer=
"item.answer"
:explain=
"item.explain"
></answer-explanation>
<answer-explanation
v-show=
"model === 2 || item.errShow"
:answer=
"item.answer"
:explain=
"item.explain"
></answer-explanation>
</view>
</view>
</view>
</view>
...
@@ -122,9 +122,8 @@ export default {
...
@@ -122,9 +122,8 @@ export default {
this
.
swiperCurrent
=
current
this
.
swiperCurrent
=
current
},
},
answerChange
(
status
,
lists
)
{
answerChange
(
status
,
lists
)
{
this
.
$set
(
this
.
swiperList
[
this
.
swiperIndex
],
'errShow'
,
status
===
'fail'
)
this
.
$set
(
this
.
swiperList
[
this
.
swiperIndex
],
'errShow'
,
this
.
type
===
2
?
true
:
status
===
'fail'
)
this
.
$emit
(
"answerChange"
,
status
,
lists
,
this
.
list
[
this
.
swiperIndex
].
index
)
this
.
$emit
(
"answerChange"
,
status
,
lists
)
if
(
status
===
'pass'
)
this
.
swiperCurrent
=
this
.
swiperCurrent
+
1
},
},
clear
()
{
clear
()
{
this
.
list
=
[]
this
.
list
=
[]
...
...
src/pages/learn/answer.vue
View file @
6e125020
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
title=
"答题"
title=
"答题"
title-bold
title-bold
></u-navbar>
></u-navbar>
<view
class=
"head"
>
<view
class=
"head"
v-if=
"type !== 3"
>
<view
class=
"u-flex tab"
v-if=
"type === 1"
>
<view
class=
"u-flex tab"
v-if=
"type === 1"
>
<view
:class=
"['tab-list',
{'active': model === 1}]" @click="changeModel(1)">答题模式
</view>
<view
:class=
"['tab-list',
{'active': model === 1}]" @click="changeModel(1)">答题模式
</view>
<view
:class=
"['tab-list',
{'active': model === 2}]" @click="changeModel(2)">学习模式
</view>
<view
:class=
"['tab-list',
{'active': model === 2}]" @click="changeModel(2)">学习模式
</view>
...
@@ -39,11 +39,11 @@
...
@@ -39,11 +39,11 @@
</view>
</view>
</view>
</view>
<view
class=
"u-flex"
>
<view
class=
"u-flex"
>
<view
class=
"c-list"
v-if=
"type === 1"
@
click=
"collection"
>
<view
class=
"c-list"
v-if=
"type === 1
|| type === 3
"
@
click=
"collection"
>
<u-icon
name=
"star"
color=
"#5A6073"
size=
"40"
></u-icon>
<u-icon
name=
"star"
color=
"#5A6073"
size=
"40"
></u-icon>
<text>
收藏
</text>
<text>
收藏
</text>
</view>
</view>
<view
class=
"c-list"
v-
else
@
click=
"handPapers"
>
<view
class=
"c-list"
v-
if=
"type === 2"
@
click=
"handPapers"
>
<u-icon
name=
"file-text"
color=
"#5A6073"
size=
"40"
></u-icon>
<u-icon
name=
"file-text"
color=
"#5A6073"
size=
"40"
></u-icon>
<text>
交卷
</text>
<text>
交卷
</text>
</view>
</view>
...
@@ -80,7 +80,7 @@ export default {
...
@@ -80,7 +80,7 @@ export default {
return
{
return
{
visible
:
false
,
visible
:
false
,
show
:
false
,
show
:
false
,
// 1 练习 2 考试
// 1 练习 2 考试
3 每日一练
type
:
1
,
type
:
1
,
// 1 答题模式 2 学习模式
// 1 答题模式 2 学习模式
model
:
1
,
model
:
1
,
...
@@ -223,11 +223,18 @@ export default {
...
@@ -223,11 +223,18 @@ export default {
console
.
log
(
"收藏"
)
console
.
log
(
"收藏"
)
},
},
// 作答完毕
// 作答完毕
answerChange
(
status
,
lists
,
index
)
{
answerChange
(
status
,
lists
)
{
// 保存答题状态
this
.
$set
(
this
.
list
[
this
.
currentIndex
],
'answerList'
,
lists
)
this
.
$set
(
this
.
list
[
this
.
currentIndex
],
'answerList'
,
lists
)
this
.
$set
(
this
.
list
[
this
.
currentIndex
],
'errShow'
,
status
===
'fail'
)
this
.
$set
(
this
.
list
[
this
.
currentIndex
],
'errShow'
,
this
.
type
===
2
?
true
:
status
===
'fail'
)
app
.
globalData
.
questionList
=
this
.
list
app
.
globalData
.
questionList
=
this
.
list
console
.
log
(
"this.list"
,
app
.
globalData
.
questionList
)
// 如果回答错误或者是考试模式,自动进入下一题
if
(
status
===
'pass'
||
this
.
type
===
2
)
{
if
(
this
.
currentIndex
+
1
>
this
.
list
.
length
-
1
)
{
return
}
this
.
current
=
this
.
currentIndex
+
1
}
},
},
// 交卷
// 交卷
handPapers
()
{
handPapers
()
{
...
...
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