diff --git a/pages/study/courseStudy.vue b/pages/study/courseStudy.vue index b959231..b9dc21b 100644 --- a/pages/study/courseStudy.vue +++ b/pages/study/courseStudy.vue @@ -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);