Commit 73782b6e authored by Damon's avatar Damon

feat: 体验资格

parent 7062e9cf
...@@ -112,7 +112,9 @@ ...@@ -112,7 +112,9 @@
> >
</dailyPop> </dailyPop>
</view> </view>
<!-- 体验资格结束 -->
<experience-end-pop :visible.sync="experienceEnd" />
</view> </view>
</template> </template>
...@@ -121,7 +123,7 @@ import swiperLimitedLoad from '@/components/swiper-limited-load/index.vue' ...@@ -121,7 +123,7 @@ import swiperLimitedLoad from '@/components/swiper-limited-load/index.vue'
import answerOperationTips from '@/components/answer-operation-tips/index.vue' import answerOperationTips from '@/components/answer-operation-tips/index.vue'
import answerCompletePop from '@/components/answer-complete-pop/index.vue' import answerCompletePop from '@/components/answer-complete-pop/index.vue'
import dailyPop from '@/components/daily-pop/index.vue' import dailyPop from '@/components/daily-pop/index.vue'
import experienceEndPop from '@/components/experience-end-pop/index.vue'
import Utils from './utils.js' import Utils from './utils.js'
const NO_PREV_PAGE = -1 const NO_PREV_PAGE = -1
...@@ -132,7 +134,8 @@ export default { ...@@ -132,7 +134,8 @@ export default {
swiperLimitedLoad, swiperLimitedLoad,
answerOperationTips, answerOperationTips,
answerCompletePop, answerCompletePop,
dailyPop dailyPop,
experienceEndPop
}, },
data() { data() {
return { return {
...@@ -141,6 +144,8 @@ export default { ...@@ -141,6 +144,8 @@ export default {
type: 1, type: 1,
// 1 答题模式 2 学习模式 // 1 答题模式 2 学习模式
model: 1, model: 1,
// 体验资格
experienceEnd: false,
// 每日一练 // 每日一练
daily: { daily: {
status: false, status: false,
...@@ -372,7 +377,7 @@ export default { ...@@ -372,7 +377,7 @@ export default {
item.userAnswer = userAnswer item.userAnswer = userAnswer
// 保存答案 // 保存答案
if(this.model === 1) this.saveAnswer(item) if(this.model === 1) this.saveAnswer(item)
// 滑动提示 // 滑动提示
if (!this.tipStatus && status === 'fail') { if (!this.tipStatus && status === 'fail') {
this.$u.vuex('tipStatus', true) this.$u.vuex('tipStatus', true)
...@@ -384,16 +389,6 @@ export default { ...@@ -384,16 +389,6 @@ export default {
this.questionList[this.currentIndex] = item this.questionList[this.currentIndex] = item
this.$u.vuex('questionList', this.questionList) this.$u.vuex('questionList', this.questionList)
this.$u.vuex('lastIndex', this.currentIndex) this.$u.vuex('lastIndex', this.currentIndex)
// 每日一练数量统计
if (this.daily.status) {
if (this.daily.count < 9) this.daily.count++
if (this.daily.count === 9) {
this.daily.visible = true
this.daily.status = false
return
}
}
} }
// 如果回答错误或者是考试模式,自动进入下一题 // 如果回答错误或者是考试模式,自动进入下一题
...@@ -422,6 +417,11 @@ export default { ...@@ -422,6 +417,11 @@ export default {
} }
this.$u.api.answer([params]) this.$u.api.answer([params])
}, },
// 每日一练达成
dailyComplete() {
this.daily.visible = true
this.daily.status = false
},
// 统计分数 // 统计分数
handPapers(type) { handPapers(type) {
const fail = this.list.filter((v) => v.result === 'fail').length // 错题数 const fail = this.list.filter((v) => v.result === 'fail').length // 错题数
......
...@@ -147,7 +147,8 @@ function request({ currentPage, size, onSuccess, onFailed }, vm) { ...@@ -147,7 +147,8 @@ function request({ currentPage, size, onSuccess, onFailed }, vm) {
answer: info.answer, answer: info.answer,
rightKey: info.answer.split(','), rightKey: info.answer.split(','),
explain: info.analysis, explain: info.analysis,
type: type type: type,
collectionFlag: info.collectionFlag
} }
// 回显已答题目 // 回显已答题目
if (vm.type === 1) { // 练习模式回显 if (vm.type === 1) { // 练习模式回显
......
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