Commit 9f414a5a authored by Damon's avatar Damon

fix: 收藏

parent 568dc59e
......@@ -244,7 +244,7 @@ export default {
}
if(this.source === 1){ // 顺序答题,如果答满则清空数据
const check = this.questionList.every(v => v.id)
const check = this.questionList.every(v => v.submitStatus)
if (check) {
this.$u.vuex('lastIndex', 0)
this.$u.vuex('questionList', [])
......@@ -419,7 +419,7 @@ export default {
// 统计是否达满所有试题
const count = this.questionList.reduce((accumulator, currentValue) => {
if (currentValue.id) accumulator++
if (currentValue.submitStatus) accumulator++
return accumulator
}, 0)
......@@ -525,7 +525,7 @@ export default {
const info = this.list.find(v => v.index === this.currentIndex)
const action = status ? 'removeCollection' : 'joinCollection'
this.$u.api[action]({questionId: info.id}).then(res => {
if(res.data) {
if(res) {
info.collectionFlag = !status
if (this.source === 1) { //更新缓存数据
this.questionList[this.currentIndex] = info
......
......@@ -187,7 +187,7 @@ export default {
collection(item) {
const action = item.collectionFlag ? 'removeCollection' : 'joinCollection'
this.$u.api[action]({questionId: item.id}).then(res => {
if(res.data) item.collectionFlag = !item.collectionFlag
if(res) item.collectionFlag = !item.collectionFlag
})
},
arrowUp(index) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment