fix: 修复播放视频时不记录时间的问题

在请求 studyContent 的时候,手动接收里面的数值
This commit is contained in:
2025-09-07 22:05:10 +08:00
committed by joshen
parent 7fbbb9ba3d
commit 18363b4734

View File

@@ -1180,6 +1180,9 @@ export default {
}
}
// 切换课程之后 studyItemId 没有及时清理, 导致 chrome 系列的浏览器
// 切换课程之后不会重新计算观看时间位置
this.curContent.studyItemId = ''
},
followUser(tea) {
//实现关注处理
@@ -1720,8 +1723,7 @@ export default {
}
},
onPlayerPlaying(e) {
console.log("=======courseStudy");
if (e.detail.currentTime > 2 && this.trueFalse && this.curContent.status < 9) {
if (!this.curContent.studyItemId || (e.detail.currentTime > 2 && this.trueFalse && this.curContent.status < 9)) {
let params = {
studyId: this.studyId,//学习id,
courseId: this.courseId,//课程id,
@@ -1732,7 +1734,14 @@ export default {
status: 2,
contentTotal: this.totalContent
}
apiCourseStudy.studyContent(params)
apiCourseStudy.studyContent(params).then(res => {
if (res.status == 200) {
this.curContent.status = 9;//完成
this.curContent.studyItemId = res.result;//学习记录id
} else {
console.log('记录学习失败:' + res.message + '' + res.error);
}
})
this.trueFalse = false
}
//console.log("当前播放11",itme);