From 22cb11e4dc22c9550266bb778a3e0901caca264d Mon Sep 17 00:00:00 2001 From: hz <3451701311@qq.com> Date: Wed, 15 Oct 2025 17:31:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=20study=20=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E6=9C=80=E5=A4=A7=E8=B0=83=E7=94=A8=E6=AC=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/study/courseStudy.vue | 51 +++++++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 16 deletions(-) diff --git a/pages/study/courseStudy.vue b/pages/study/courseStudy.vue index 0a3bba7..2199b28 100644 --- a/pages/study/courseStudy.vue +++ b/pages/study/courseStudy.vue @@ -1927,14 +1927,32 @@ export default { status: 2, contentTotal: this.totalContent } - apiCourseStudy.studyContent(params).then(res => { - if (res.status == 200) { - this.curContent.status = 2;//完成 - this.curContent.studyItemId = res.result;//学习记录id - } else { - console.log('记录学习失败:' + res.message + ',' + res.error); - } - }) + + // apiCourseStudy.studyContent(params).then(res => { + // if (res.status == 200) { + // this.curContent.status = 2;//完成 + // this.curContent.studyItemId = res.result;//学习记录id + // } else { + // console.log('记录学习失败:' + res.message + ',' + res.error); + // } + // }) + this.studyContent(params) + }, + studyContent(params) { + // 增加最大调用次数限制 + this.countRequest = Number(this.countRequest) + 1 + + if (this.countRequest<3 ){ + apiCourseStudy.studyContent(params).then(res => { + if (Number(res.status) === 200) { + this.curContent.status = 2;//完成 + if (res.result)this.curContent.studyItemId = res.result;//学习记录id + else this.studyContent(params) + } else { + console.log('记录学习失败:' + res.message + ',' + res.error); + } + }) + } }, //还需要记录播放时间 saveStudyInfo() { //记录课件学习信息 @@ -1957,14 +1975,15 @@ export default { status: 9, contentTotal: this.totalContent } - 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); - } - }) + // 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.studyContent(params) }, statusClass(status) { let statusObj = {