feat: 课程学习逻辑优化
This commit is contained in:
parent
255e4d9433
commit
ca71b6e205
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue