Commit da563577 authored by Damon's avatar Damon

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

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