From e3b06ae6c5afccb12cc637810263ab28635aef4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E8=88=AA?= Date: Fri, 19 Sep 2025 10:54:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AD=A6=E4=B9=A0=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/course/study.vue | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/src/pages/course/study.vue b/src/pages/course/study.vue index d33d6990..87d04261 100644 --- a/src/pages/course/study.vue +++ b/src/pages/course/study.vue @@ -750,7 +750,9 @@ const closeStudy = () => { } onHide(() => { changePlayItemId('') - closeStudy() + if(isPreview.value === 'S'){ + closeStudy() + } // socketStore.closeSocket() //#ifdef APP-PLUS uni.offKeyboardHeightChange(setHeight) @@ -767,21 +769,25 @@ onShow(() => { if (watchFlag.value === 1) return // getData('2'); // initsocketTask() - sendMessage({ - commond: 'STDY', - body: { - crsId: crsId.value, - teacherNo: choiceTeacher.value, - studyType: isPreview.value ? 'P' : 'S', - isContinue: isContinue.value, - stdyId: stdyId.value - } - }) + if(isPreview.value === 'S'){ + sendMessage({ + commond: 'STDY', + body: { + crsId: crsId.value, + teacherNo: choiceTeacher.value, + studyType: isPreview.value ? 'P' : 'S', + isContinue: isContinue.value, + stdyId: stdyId.value + } + }) + } }) const watchFlag = ref(1) onUnload(() => { console.log('onUnload') - closeStudy() + if(isPreview.value === 'S'){ + closeStudy() + } // socketStore.closeSocket() changePlayItemId('') console.log(typeof teacherVoiceObj)