feat: 课程学习逻辑优化

This commit is contained in:
cgd_mac 2022-02-23 14:41:39 +08:00
parent 255e4d9433
commit ca71b6e205
2 changed files with 7 additions and 4 deletions

View File

@ -82,6 +82,7 @@ export default {
const data = res.data
if (res.correctness) {
this.$message.success('恭喜你,回答正确!')
this.$emit('success')
this.visible = false
} else {
if (this.chance === 1) {

View File

@ -42,7 +42,7 @@
</a-tabs>
</div>
<!-- 课中考试 -->
<ExamDialog ref="examDialog" :curVideo="curVideo"></ExamDialog>
<ExamDialog ref="examDialog" :curVideo="curVideo" @success="answerSuccess"></ExamDialog>
</a-card>
</template>
@ -148,9 +148,9 @@ export default {
_this.curVideo = item
vid.src(item.videoAddress)
vid.play()
_this.openCourseExam() //
// _this.openCourseExam() //
}
if (this.oldTime > 0) {
if (this.oldTime > 0 && _this.curVideo.status !== 1) {
this.$confirm({
title: '确定要切换学习视频吗?',
content: '一但切换学习视频,您现在正在学习的视频学时将清0,确定要切换吗?',
@ -170,7 +170,6 @@ export default {
},
//
onPlayerEnded () {
console.log('播放完毕')
this.openCourseExam()
},
//
@ -203,6 +202,9 @@ export default {
this.maxTime = oldTime
}
}
},
answerSuccess () {
this.curVideo.status = 1
}
}
}