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 const data = res.data
if (res.correctness) { if (res.correctness) {
this.$message.success('恭喜你,回答正确!') this.$message.success('恭喜你,回答正确!')
this.$emit('success')
this.visible = false this.visible = false
} else { } else {
if (this.chance === 1) { if (this.chance === 1) {

View File

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