提交 a911af89 authored 作者: lihuihui's avatar lihuihui

错题,收藏题,总做题逻辑修改

上级 d8cde625
...@@ -15,10 +15,10 @@ ...@@ -15,10 +15,10 @@
<div class="circle active2"></div> <div class="circle active2"></div>
<div class="txt">错误</div> <div class="txt">错误</div>
</li> </li>
<li> <!-- <li>
<div class="circle active3"></div> <div class="circle active3"></div>
<div class="txt">未答</div> <div class="txt">未答</div>
</li> </li> -->
</ul> </ul>
</div> </div>
<div class="question"> <div class="question">
...@@ -33,10 +33,11 @@ ...@@ -33,10 +33,11 @@
</template> </template>
</ul> </ul>
<van-empty description="暂无内容" v-if="dataList.length == 0"/> <van-empty description="暂无内容" v-if="dataList.length == 0"/>
<div class="tips" v-if="$route.query.type == 3">未做试题剩余{{unDo}}题</div>
</div> </div>
</div> </div>
</div> </div>
<div class="clear-btn"> <div class="clear-btn" v-if="this.$route.query.type != 3">
<div class="btn" @click="clearQuestion">清空记录,重新答题</div> <div class="btn" @click="clearQuestion">清空记录,重新答题</div>
</div> </div>
<div class="exam_submit" v-if="isPopShow"> <div class="exam_submit" v-if="isPopShow">
...@@ -63,6 +64,7 @@ export default { ...@@ -63,6 +64,7 @@ export default {
}, },
data() { data() {
return { return {
unDo: 0,
questionType: { questionType: {
1: '单选题', 1: '单选题',
2: '多选题', 2: '多选题',
...@@ -76,12 +78,13 @@ export default { ...@@ -76,12 +78,13 @@ export default {
methods: { methods: {
clearQuestion() { clearQuestion() {
const param = { const param = {
type: this.$route.query.type, type: this.$route.query.type === 3,
question_type: this.$route.query.questionType, question_type: this.$route.query.questionType,
clear: 1 clear: 1
} }
api.cacheQuestion(param).then(res => { api.cacheQuestion(param).then(res => {
Toast('清空成功') Toast('清空成功')
window.localStorage.cachequestion = JSON.stringify([])
this.initData() this.initData()
}) })
}, },
...@@ -103,9 +106,10 @@ export default { ...@@ -103,9 +106,10 @@ export default {
duration: 5000, duration: 5000,
loadingType: 'spinner' loadingType: 'spinner'
}) })
api.getAllQuestion({ type: this.$route.query.type, question_type: this.$route.query.questionType }) api.getAllQuestion({ type: parseInt(this.$route.query.type) === 3 ? 0 : this.$route.query.type, question_type: this.$route.query.questionType })
.then(res => { .then(res => {
this.dataList = res this.dataList = res.list
this.unDo = res.un_do
Toast.clear() Toast.clear()
}) })
.catch(() => { .catch(() => {
......
...@@ -197,6 +197,7 @@ export default { ...@@ -197,6 +197,7 @@ export default {
let num = 1 let num = 1
pageCount.indexOf('.') === -1 ? num = pageCount : num = parseInt(pageCount) + 1 pageCount.indexOf('.') === -1 ? num = pageCount : num = parseInt(pageCount) + 1
window.localStorage.myQuestionDetileId = id window.localStorage.myQuestionDetileId = id
window.localStorage.cachequestion = JSON.stringify([])
this.$router.push({ this.$router.push({
path: '/my/questionsDetails', path: '/my/questionsDetails',
query: { query: {
......
...@@ -6,10 +6,6 @@ ...@@ -6,10 +6,6 @@
<div class="num">{{ question.errorTotal }}</div> <div class="num">{{ question.errorTotal }}</div>
<div class="txt">错题总数</div> <div class="txt">错题总数</div>
</div> </div>
<!-- <div :class="activeClass == '1' ? 'right btn active' : 'right btn'" @click="tab('1')">
<div class="num">{{ question.total }}</div>
<div class="txt">做题总数</div>
</div> -->
</div> </div>
<div class="exam-con"> <div class="exam-con">
<div class="sele" @click="screen.isShow = true"> <div class="sele" @click="screen.isShow = true">
...@@ -207,6 +203,7 @@ export default { ...@@ -207,6 +203,7 @@ export default {
let num = 1 let num = 1
pageCount.indexOf('.') === -1 ? num = pageCount : num = parseInt(pageCount) + 1 pageCount.indexOf('.') === -1 ? num = pageCount : num = parseInt(pageCount) + 1
window.localStorage.myQuestionDetileId = id window.localStorage.myQuestionDetileId = id
window.localStorage.cachequestion = JSON.stringify([])
this.$router.push({ this.$router.push({
path: '/my/questionsDetails', path: '/my/questionsDetails',
query: { query: {
......
...@@ -208,6 +208,7 @@ export default { ...@@ -208,6 +208,7 @@ export default {
let num = 1 let num = 1
pageCount.indexOf('.') === -1 ? num = pageCount : num = parseInt(pageCount) + 1 pageCount.indexOf('.') === -1 ? num = pageCount : num = parseInt(pageCount) + 1
window.localStorage.myQuestionDetileId = id window.localStorage.myQuestionDetileId = id
window.localStorage.cachequestion = JSON.stringify([])
this.$router.push({ this.$router.push({
path: '/my/questionsDetails', path: '/my/questionsDetails',
query: { query: {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论