From 29cc77255ad0ff3b134cfbb51c6bedbaae3ed259 Mon Sep 17 00:00:00 2001 From: huangzhe <3451701311@qq.com> Date: Sun, 7 Sep 2025 22:05:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=92=AD=E6=94=BE?= =?UTF-8?q?=E8=A7=86=E9=A2=91=E6=97=B6=E4=B8=8D=E8=AE=B0=E5=BD=95=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在请求 studyContent 的时候,手动接收里面的数值 --- pages/study/courseStudy.vue | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pages/study/courseStudy.vue b/pages/study/courseStudy.vue index e298721..8075327 100644 --- a/pages/study/courseStudy.vue +++ b/pages/study/courseStudy.vue @@ -1120,6 +1120,9 @@ export default { } } + // 切换课程之后 studyItemId 没有及时清理, 导致 chrome 系列的浏览器 + // 切换课程之后不会重新计算观看时间位置 + this.curContent.studyItemId = '' }, followUser(tea) { //实现关注处理 @@ -1661,8 +1664,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, @@ -1673,7 +1675,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);