Commit 712675d8 authored by Damon's avatar Damon

feat: 顺序答题做完后逻辑处理

parent 29a29fc2
...@@ -242,6 +242,13 @@ export default { ...@@ -242,6 +242,13 @@ export default {
this.type = 1 this.type = 1
break; break;
} }
if(this.source === 1){ // 顺序答题,如果答满则清空数据
const check = this.questionList.every(v => v.id)
if (check) {
this.$u.vuex('questionList', [])
}
}
this.init() this.init()
}, },
...@@ -430,8 +437,15 @@ export default { ...@@ -430,8 +437,15 @@ export default {
source: this.source source: this.source
} }
this.$u.api.answer([params]).then(res => { this.$u.api.answer([params]).then(res => {
if (this.source === 2 && res === 10) { if (this.source === 1) {
if (this.daily.status) this.dailyComplete() if (res === this.total) {
return uni.showToast({
title: '你已经回答了全部试题',
icon: 'none',
})
}
} else if (this.source === 2) {
if (this.daily.status && res === 10) this.dailyComplete()
} }
}) })
}, },
......
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