diff --git a/src/pages/course/study.vue b/src/pages/course/study.vue index 4facd525..30abf488 100644 --- a/src/pages/course/study.vue +++ b/src/pages/course/study.vue @@ -547,7 +547,8 @@ const nextQuestionSuccess = (info, type='next') => { isQuestion: true } talkingList.value.push(lastTalkingInfo.value) - qstLogId.value = _body.chatBody.qstLogId + logId.value = _body.chatBody.logId + qstLogId.value = _body.chatBody.qstLogId || qstLogId.value scrollToBottomNow() }) } @@ -610,10 +611,7 @@ const initsocketTask = () => { }) } const reconnect = ()=> { - if(reconnectTimer || isManualClose.value) return - reconnectTimer = setTimeout(()=>{ - initsocketTask() - },3000) + initsocketTask() } const sendMessage = (data) => { unref(SocketObj).send(data) @@ -622,6 +620,7 @@ const sendMessage = (data) => { const startPgrphId = ref('') const imageId = ref('') onLoad((params) => { + watchFlag.value = 1 crsId.value = params.crsId||''; crsNum.value = params.crsNum||''; imageId.value = params.imgId || '' @@ -638,13 +637,14 @@ onHide(()=>{ if(watchFlag.value === 1) return changePlayItemId('') socketStore.closeSocket() - common.show('提示信息', '检测到您已离开,即将退出学习页面。',false, '','确认').then((res) => { - common.redirectTo(`/pages/courseDetail/index?crsId=${crsId.value}&crsNum=${crsNum.value}&from=study`) - }).finally(() => {}) + // common.show('提示信息', '检测到您已离开,即将退出学习页面。',false, '','确认').then((res) => { + // common.redirectTo(`/pages/courseDetail/index?crsId=${crsId.value}&crsNum=${crsNum.value}&from=study`) + // }).finally(() => {}) }) onShow(()=>{ if(watchFlag.value === 1) return - getData('2'); + // getData('2'); + initsocketTask() }) const watchFlag = ref(1) onUnload(()=>{