提交 fba9a89f authored 作者: matian's avatar matian

bug fixes

上级 8905d3ee
...@@ -23,8 +23,9 @@ export default { ...@@ -23,8 +23,9 @@ export default {
this.$message.error('暂无权限') this.$message.error('暂无权限')
return return
} }
if (new Date(this.$store.state.user.student_info.expiration_time).getTime() < new Date().getTime()) { if (new Date(this.$store.state.user.student_info.expiration_time).getTime() <= new Date().getTime()) {
this.$message.warning('您的课程已到期,请完成续费后再学习和考试') this.$message.warning('您的课程已到期,请完成续费后再学习和考试')
return false
} else { } else {
this.$router.push({ name: 'courseLearnItem', query: { id: data.course_id } }) this.$router.push({ name: 'courseLearnItem', query: { id: data.course_id } })
} }
......
...@@ -132,108 +132,111 @@ export default { ...@@ -132,108 +132,111 @@ export default {
}, },
// 重新考试 // 重新考试
reStartExam(data) { reStartExam(data) {
if (new Date(this.$store.state.user.student_info.expiration_time).getTime() < new Date().getTime()) { if (new Date(this.$store.state.user.student_info.expiration_time).getTime() <= new Date().getTime()) {
this.$message.warning('您的课程已到期,请完成续费后再学习和考试') this.$message.warning('您的课程已到期,请完成续费后再学习和考试')
return return false
} else {
this.dialogVisible = true
this.curExamId = data.id
this.curExamTitle = data.paper_title
} }
this.dialogVisible = true
this.curExamId = data.id
this.curExamTitle = data.paper_title
}, },
startExam(data) { startExam(data) {
if (new Date(this.$store.state.user.student_info.expiration_time).getTime() < new Date().getTime()) { if (new Date(this.$store.state.user.student_info.expiration_time).getTime() <= new Date().getTime()) {
this.$message.warning('您的课程已到期,请完成续费后再学习和考试') this.$message.warning('您的课程已到期,请完成续费后再学习和考试')
return
}
const num = parseInt(data.status)
const leaveTimes = data.leave_times || 0
if (leaveTimes >= 4) {
this.$alert('离开考试页面已超过限定次数,考试结束', {
confirmButtonText: '查看结果',
callback: action => {
if (action === 'confirm') {
this.$router.push({
path: '/exam/exam/result',
query: {
exam_id: data.id,
title: data.paper_title,
is_create: 1
}
})
}
}
})
return false return false
} } else {
switch (num) { const num = parseInt(data.status)
case 100: const leaveTimes = data.leave_times || 0
this.$message({ if (leaveTimes >= 4) {
message: '请完成视频课程学习后再参加考试' this.$alert('离开考试页面已超过限定次数,考试结束', {
}) confirmButtonText: '查看结果',
break
case 101:
this.dialogVisible = true
this.curExamId = data.id
this.curExamTitle = data.paper_title
break
case 102:
api.getExamList().then(res => {
const findTimes = res.data.find(id => id.id === data.id).remaining_times_s
if (findTimes < 5) {
this.$alert('考试时间已到,系统已自动提交试卷', {
confirmButtonText: '查看结果',
callback: action => {
if (action === 'confirm') {
this.$router.push({
path: '/exam/exam/result',
query: {
exam_id: data.id,
title: data.paper_title,
is_create: 1
}
})
}
}
})
} else {
this.$router.push({
path: '/exam/exam/exam',
query: {
id: data.id,
is_create: 1,
title: data.paper_title
}
})
}
})
break
case 103:
this.$router.push({
path: '/exam/exam/result',
query: {
exam_id: data.id,
title: data.paper_title
}
})
break
case 104:
this.$alert('重考申请还未通过,无法进行考试', {
confirmButtonText: '重新提交申请',
callback: action => { callback: action => {
console.log(action, 'action')
if (action === 'confirm') { if (action === 'confirm') {
api.sbumitRetake({ examination_id: data.id }).then(response => { this.$router.push({
if (response.code === 0) { path: '/exam/exam/result',
this.$message({ query: {
type: 'success', exam_id: data.id,
message: '提交成功' title: data.paper_title,
}) is_create: 1
} }
}) })
} }
} }
}) })
break return false
}
switch (num) {
case 100:
this.$message({
message: '请完成视频课程学习后再参加考试'
})
break
case 101:
this.dialogVisible = true
this.curExamId = data.id
this.curExamTitle = data.paper_title
break
case 102:
api.getExamList().then(res => {
const findTimes = res.data.find(id => id.id === data.id).remaining_times_s
if (findTimes < 5) {
this.$alert('考试时间已到,系统已自动提交试卷', {
confirmButtonText: '查看结果',
callback: action => {
if (action === 'confirm') {
this.$router.push({
path: '/exam/exam/result',
query: {
exam_id: data.id,
title: data.paper_title,
is_create: 1
}
})
}
}
})
} else {
this.$router.push({
path: '/exam/exam/exam',
query: {
id: data.id,
is_create: 1,
title: data.paper_title
}
})
}
})
break
case 103:
this.$router.push({
path: '/exam/exam/result',
query: {
exam_id: data.id,
title: data.paper_title
}
})
break
case 104:
this.$alert('重考申请还未通过,无法进行考试', {
confirmButtonText: '重新提交申请',
callback: action => {
console.log(action, 'action')
if (action === 'confirm') {
api.sbumitRetake({ examination_id: data.id }).then(response => {
if (response.code === 0) {
this.$message({
type: 'success',
message: '提交成功'
})
}
})
}
}
})
break
}
} }
} }
}, },
......
...@@ -7,23 +7,8 @@ ...@@ -7,23 +7,8 @@
{{ data.sheet.created_time }} {{ data.sheet.created_time }}
</span> </span>
</div> </div>
<div v-if="expirationMonth === 3" style="position: relative">
<el-empty description="您已考试通过,请扫描下方二维码获取证书"></el-empty>
<img
src="https://webapp-pub.ezijing.com/project/fd/u171.png"
alt=""
style="
position: absolute;
top: 350px;
left: 50%;
transform: translate(-50%, -50%);
width: 200px;
height: 200px;
"
/>
</div>
<div class="chart-box"> <div class="chart-box">
<div class="chart-item" v-if="expirationMonth === 12 && Object.keys(datas.data).length"> <div class="chart-item" v-if="Object.keys(datas.data).length">
<div class="chart-title">成绩</div> <div class="chart-title">成绩</div>
<chart :accuracy="score" :accuracScore="totalScore"> <chart :accuracy="score" :accuracScore="totalScore">
<template v-slot:tips> <template v-slot:tips>
...@@ -32,7 +17,7 @@ ...@@ -32,7 +17,7 @@
</chart> </chart>
</div> </div>
</div> </div>
<p class="new__text" v-if="expirationMonth === 12">{{ resultText }}</p> <p class="new__text" >{{ resultText }}</p>
</div> </div>
</div> </div>
</template> </template>
...@@ -64,7 +49,7 @@ export default { ...@@ -64,7 +49,7 @@ export default {
computed: { computed: {
resultText() { resultText() {
return this.score >= 80 return this.score >= 80
? '恭喜考试通过,您已获得金融数据合规管理证书,请前往我的证书页面查看' ? '恭喜您考试通过,申领证书请前往我的证书页面'
: this.datas.times > 1 ? '系统将向管理员发送重考申请,您可同步开始课程重修,重修完成且审批通过后方可继续考试' : '考试未通过,请重新完成视频课程学习后再次参加考试' : this.datas.times > 1 ? '系统将向管理员发送重考申请,您可同步开始课程重修,重修完成且审批通过后方可继续考试' : '考试未通过,请重新完成视频课程学习后再次参加考试'
}, },
examId() { examId() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论