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
9f414a5a
Commit
9f414a5a
authored
Jul 24, 2021
by
Damon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 收藏
parent
568dc59e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
answer.vue
src/pages/learn/answer.vue
+3
-3
detail.vue
src/pages/search/detail.vue
+1
-1
No files found.
src/pages/learn/answer.vue
View file @
9f414a5a
...
@@ -244,7 +244,7 @@ export default {
...
@@ -244,7 +244,7 @@ export default {
}
}
if
(
this
.
source
===
1
){
// 顺序答题,如果答满则清空数据
if
(
this
.
source
===
1
){
// 顺序答题,如果答满则清空数据
const
check
=
this
.
questionList
.
every
(
v
=>
v
.
id
)
const
check
=
this
.
questionList
.
every
(
v
=>
v
.
submitStatus
)
if
(
check
)
{
if
(
check
)
{
this
.
$u
.
vuex
(
'lastIndex'
,
0
)
this
.
$u
.
vuex
(
'lastIndex'
,
0
)
this
.
$u
.
vuex
(
'questionList'
,
[])
this
.
$u
.
vuex
(
'questionList'
,
[])
...
@@ -419,7 +419,7 @@ export default {
...
@@ -419,7 +419,7 @@ export default {
// 统计是否达满所有试题
// 统计是否达满所有试题
const
count
=
this
.
questionList
.
reduce
((
accumulator
,
currentValue
)
=>
{
const
count
=
this
.
questionList
.
reduce
((
accumulator
,
currentValue
)
=>
{
if
(
currentValue
.
id
)
accumulator
++
if
(
currentValue
.
submitStatus
)
accumulator
++
return
accumulator
return
accumulator
},
0
)
},
0
)
...
@@ -525,7 +525,7 @@ export default {
...
@@ -525,7 +525,7 @@ export default {
const
info
=
this
.
list
.
find
(
v
=>
v
.
index
===
this
.
currentIndex
)
const
info
=
this
.
list
.
find
(
v
=>
v
.
index
===
this
.
currentIndex
)
const
action
=
status
?
'removeCollection'
:
'joinCollection'
const
action
=
status
?
'removeCollection'
:
'joinCollection'
this
.
$u
.
api
[
action
]({
questionId
:
info
.
id
}).
then
(
res
=>
{
this
.
$u
.
api
[
action
]({
questionId
:
info
.
id
}).
then
(
res
=>
{
if
(
res
.
data
)
{
if
(
res
)
{
info
.
collectionFlag
=
!
status
info
.
collectionFlag
=
!
status
if
(
this
.
source
===
1
)
{
//更新缓存数据
if
(
this
.
source
===
1
)
{
//更新缓存数据
this
.
questionList
[
this
.
currentIndex
]
=
info
this
.
questionList
[
this
.
currentIndex
]
=
info
...
...
src/pages/search/detail.vue
View file @
9f414a5a
...
@@ -187,7 +187,7 @@ export default {
...
@@ -187,7 +187,7 @@ export default {
collection
(
item
)
{
collection
(
item
)
{
const
action
=
item
.
collectionFlag
?
'removeCollection'
:
'joinCollection'
const
action
=
item
.
collectionFlag
?
'removeCollection'
:
'joinCollection'
this
.
$u
.
api
[
action
]({
questionId
:
item
.
id
}).
then
(
res
=>
{
this
.
$u
.
api
[
action
]({
questionId
:
item
.
id
}).
then
(
res
=>
{
if
(
res
.
data
)
item
.
collectionFlag
=
!
item
.
collectionFlag
if
(
res
)
item
.
collectionFlag
=
!
item
.
collectionFlag
})
})
},
},
arrowUp
(
index
)
{
arrowUp
(
index
)
{
...
...
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