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
3227703d
Commit
3227703d
authored
Jul 16, 2021
by
Damon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 已选答案回显
parent
5263292f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
18 deletions
+14
-18
index.vue
src/components/answer-sheet/index.vue
+3
-3
index.vue
src/components/swiper-limited-load/index.vue
+6
-13
answer.vue
src/pages/learn/answer.vue
+5
-2
No files found.
src/components/answer-sheet/index.vue
View file @
3227703d
...
@@ -68,8 +68,8 @@ export default {
...
@@ -68,8 +68,8 @@ export default {
handler
:
function
(
newValue
,
oldValue
)
{
handler
:
function
(
newValue
,
oldValue
)
{
if
(
newValue
.
length
>
0
)
{
if
(
newValue
.
length
>
0
)
{
this
.
lists
=
newValue
.
map
((
v
)
=>
{
this
.
lists
=
newValue
.
map
((
v
)
=>
{
v
.
checked
=
false
if
(
!
v
.
checked
)
v
.
checked
=
false
v
.
confirm
=
false
if
(
!
v
.
confirm
)
v
.
confirm
=
false
return
v
return
v
})
})
}
}
...
@@ -119,7 +119,7 @@ export default {
...
@@ -119,7 +119,7 @@ export default {
},
},
submitAnswer
()
{
submitAnswer
()
{
this
.
submitStatus
=
true
this
.
submitStatus
=
true
this
.
$emit
(
'change'
,
this
.
answer
)
this
.
$emit
(
'change'
,
this
.
answer
,
this
.
lists
)
},
},
},
},
}
}
...
...
src/components/swiper-limited-load/index.vue
View file @
3227703d
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
></answer-sheet>
></answer-sheet>
</view>
</view>
<view
class=
"explain"
v-if=
"type === 1"
>
<view
class=
"explain"
v-if=
"type === 1"
>
<answer-explanation
v-show=
"model === 2 || 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>
</swiper-item>
</swiper-item>
...
@@ -37,6 +37,7 @@ const END = 2
...
@@ -37,6 +37,7 @@ const END = 2
const
SWIPER_LENGTH
=
3
const
SWIPER_LENGTH
=
3
const
NO_PREV_PAGE
=
-
1
const
NO_PREV_PAGE
=
-
1
const
NO_NEXT_PAGE
=
-
2
const
NO_NEXT_PAGE
=
-
2
const
app
=
getApp
()
export
default
{
export
default
{
name
:
'swiper-limited-load'
,
name
:
'swiper-limited-load'
,
...
@@ -85,8 +86,6 @@ export default {
...
@@ -85,8 +86,6 @@ export default {
swiperCurrent
:
0
,
swiperCurrent
:
0
,
// 当前swiper渲染的items
// 当前swiper渲染的items
swiperList
:
[],
swiperList
:
[],
// 错题显示解释
errShow
:
false
}
}
},
},
watch
:
{
watch
:
{
...
@@ -122,18 +121,15 @@ export default {
...
@@ -122,18 +121,15 @@ export default {
this
.
swiperIndex
=
current
this
.
swiperIndex
=
current
this
.
swiperCurrent
=
current
this
.
swiperCurrent
=
current
},
},
answerChange
(
e
)
{
answerChange
(
status
,
lists
)
{
// this.swiperCurrent = this.swiperCurrent + 1
// this.swiperCurrent = this.swiperCurrent + 1
this
.
$emit
(
"answerChange"
,
e
)
this
.
$emit
(
"answerChange"
,
status
,
lists
,
this
.
list
[
this
.
swiperIndex
].
index
)
this
.
errShow
=
e
===
'fail'
console
.
log
(
"e"
,
e
)
},
},
clear
()
{
clear
()
{
this
.
list
=
[]
this
.
list
=
[]
this
.
swiperList
=
[]
this
.
swiperList
=
[]
},
},
swiperChange
:
function
(
e
)
{
swiperChange
:
function
(
e
)
{
this
.
errShow
=
false
let
current
=
e
.
detail
.
current
let
current
=
e
.
detail
.
current
let
lastIndex
=
this
.
swiperIndex
let
lastIndex
=
this
.
swiperIndex
let
currentItem
=
this
.
swiperList
[
current
]
let
currentItem
=
this
.
swiperList
[
current
]
...
@@ -220,10 +216,7 @@ export default {
...
@@ -220,10 +216,7 @@ export default {
getNextSwiperNeedItem
:
function
(
currentItem
,
list
)
{
getNextSwiperNeedItem
:
function
(
currentItem
,
list
)
{
if
(
currentItem
==
null
)
return
null
;
if
(
currentItem
==
null
)
return
null
;
let
listNeedIndex
=
currentItem
.
index
+
1
let
listNeedIndex
=
currentItem
.
index
+
1
let
realIndex
=
list
.
findIndex
(
function
(
item
){
let
realIndex
=
list
.
findIndex
(
item
=>
item
.
index
==
listNeedIndex
)
return
item
.
index
==
listNeedIndex
})
if
(
realIndex
==
-
1
)
return
null
if
(
realIndex
==
-
1
)
return
null
let
total
=
this
.
total
!=
0
?
this
.
total
:
list
.
length
let
total
=
this
.
total
!=
0
?
this
.
total
:
list
.
length
let
item
=
listNeedIndex
==
total
?
null
:
list
[
realIndex
]
let
item
=
listNeedIndex
==
total
?
null
:
list
[
realIndex
]
...
...
src/pages/learn/answer.vue
View file @
3227703d
...
@@ -205,8 +205,11 @@ export default {
...
@@ -205,8 +205,11 @@ export default {
console
.
log
(
"收藏"
)
console
.
log
(
"收藏"
)
},
},
// 作答完毕
// 作答完毕
answerChange
(
e
)
{
answerChange
(
status
,
lists
,
index
)
{
console
.
log
(
'e'
,
e
)
this
.
$set
(
this
.
list
[
index
],
'answerList'
,
lists
)
this
.
$set
(
this
.
list
[
index
],
'errShow'
,
status
===
'fail'
)
app
.
globalData
.
questionList
=
this
.
list
console
.
log
(
"this.list"
,
app
.
globalData
.
questionList
)
},
},
// 交卷
// 交卷
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