提交 1d6f230e authored 作者: lihuihui's avatar lihuihui

updata

上级 bdabdbb9
<template> <template>
<div class="mock-box" v-if="pageShow"> <div class="mock-box">
<div class="top-tit"> <div class="top-tit">
<div class="left">考试时间90分钟</div> <div class="left">考试时间90分钟</div>
<div class="right">总分100分</div> <div class="right">总分100分</div>
...@@ -39,6 +39,16 @@ ...@@ -39,6 +39,16 @@
</div> </div>
</div> </div>
</div> </div>
<div class="exam_submit" v-if="isExamPopTo">
<div class="pop">
<div class="tit">能力自测</div>
<div class="txt">考试还未结束确定退出考试?</div>
<div class="btn_box">
<div class="btn" @click="isExamPopTo = false">退出考试</div>
<div class="btn btn2" @click="goAbilityExam(0)">继续考试</div>
</div>
</div>
</div>
</div> </div>
</template> </template>
...@@ -49,11 +59,13 @@ export default { ...@@ -49,11 +59,13 @@ export default {
return { return {
roleChange: 1, roleChange: 1,
isExamPop: false, isExamPop: false,
pageShow: false isExamPopTo: false
} }
}, },
mounted() { mounted() {
this.abilityExam() if (window.localStorage.isExamEnd === 'true' || window.localStorage.isExamEnd === true) {
this.abilityExam()
}
}, },
methods: { methods: {
changeActive(e) { changeActive(e) {
...@@ -65,12 +77,12 @@ export default { ...@@ -65,12 +77,12 @@ export default {
} }
api.getExamStatus(param).then(res => { api.getExamStatus(param).then(res => {
if (res.status === '0' || res.status === '3') { if (res.status === '0' || res.status === '3') {
this.isExamPop = true this.isExamPopTo = true
} }
this.pageShow = true
}) })
}, },
goAbilityExam(n) { goAbilityExam(n) {
window.localStorage.isExamEnd = true
this.$router.push({ this.$router.push({
path: '/mock/answer', path: '/mock/answer',
query: { query: {
...@@ -81,10 +93,19 @@ export default { ...@@ -81,10 +93,19 @@ export default {
}) })
}, },
setRole() { setRole() {
api.setRole({ role: this.roleChange }).then(res => { const param = {
console.log(res.code) type: 2
if (res.code === 0) { }
this.goAbilityExam(1) api.getExamStatus(param).then(res => {
if (res.status === '0' || res.status === '3') {
this.isExamPop = true
} else {
api.setRole({ role: this.roleChange }).then(res => {
console.log(res.code)
if (res.code === 0) {
this.goAbilityExam(1)
}
})
} }
}) })
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论