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)