提交 0791ec45 authored 作者: lihuihui's avatar lihuihui

答题优化

上级 d32daafc
......@@ -237,7 +237,14 @@ export default {
on: {
init() {
setTimeout(() => {
_this.$route.query.id !== undefined && _this.cardChange(_this.$route.query.id)
if (_this.$route.query.id !== undefined && _this.$route.query.id !== -1 && _this.$route.query.id !== 1) {
_this.questionsData.questions.map(i => {
const data = i.question_list.find(item => { return item.id === _this.$route.query.id })
if (data) {
_this.cardChange({ id: _this.$route.query.id, num: parseInt(data.num / 10) })
}
})
}
_this.setCurrentCollect()
_this.scrollDom()
_this.getIsSign()
......@@ -458,7 +465,7 @@ export default {
return false
}
this.examEnd()
this.initData(0)
this.initData()
},
getIsSign() {
const currentSlides = this.swiper.slides[this.swiper.activeIndex]
......@@ -744,6 +751,7 @@ export default {
Toast.clear()
const times = this.$route.query.id === undefined ? res.sheet.remainingTime ? res.sheet.remainingTime : res.sheet.duration : res.sheet.duration
parseInt(this.$route.query.id) === -1 ? this.errorQuestion(res) : this.questionsData = res
console.log(this.questionsData)
this.questionCount = res.sheet.question_count
window.localStorage.userId = res.user_id
this.remainingTime = this.secondToDate(times)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论