Commit da563577 authored by Damon's avatar Damon

fix: 【ID1001404】【小程序-首页-答题模式】:全部试题回答完后,toast提示太快且答题数量没有归0

parent 3f1b73f8
......@@ -174,7 +174,7 @@ export default {
current: 0,
// 仅仅记录swiper的位置
currentIndex: 0,
swiperDuration: '800',
swiperDuration: '500',
// 分页数据
currentPage: 1,
pageSize: 100,
......@@ -187,6 +187,8 @@ export default {
passPoint: 60,
// 考试题数
totalPoint: 100,
// 已做题数
count: 0
}
},
computed: {
......@@ -351,6 +353,11 @@ export default {
return
}
}
if(this.source === 1 && this.count === this.total) {
this.$u.vuex(`questionList.${this.questionWarehouseId}`, [])
}
this.$u.route({
type: 'back',
})
......@@ -473,7 +480,7 @@ export default {
this.$u.vuex(`lastIndex.${this.questionWarehouseId}`, this.currentIndex)
// 统计是否达满所有试题
const count = this.questionList[this.questionWarehouseId].reduce(
this.count = this.questionList[this.questionWarehouseId].reduce(
(accumulator, currentValue) => {
if (currentValue.submitStatus) accumulator++
return accumulator
......@@ -481,8 +488,10 @@ export default {
0
)
if (count === this.total) {
return this.$u.toast('您已经答完全部试题')
if (this.count === this.total) {
this.$nextTick(() => {
return this.$u.toast('您已经答完全部试题')
})
}
}
......
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