From 187698c247b18cb28d21464fc8e14e1589f1eda0 Mon Sep 17 00:00:00 2001 From: yanghang Date: Thu, 17 Jul 2025 10:55:44 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=EF=BC=9B=20bug=20=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E7=9F=A5=E8=AF=86=E7=82=B9=E8=BF=9B=E5=85=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/course/study.vue | 25 +++++++++++++------------ src/pages/index/dialog.vue | 7 +++++++ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/pages/course/study.vue b/src/pages/course/study.vue index 7ae7e1d7..5d5e9996 100644 --- a/src/pages/course/study.vue +++ b/src/pages/course/study.vue @@ -182,7 +182,7 @@ const getData = async (flag) => { // return // } try{ - await initsocketTask() + initsocketTask() const { body } = await getCourseStudyInfoApi({crsId: crsId.value}) teacherList.value = body.teacheList.map(t=>({ ...t, @@ -192,16 +192,18 @@ const getData = async (flag) => { if(body.stdyProgressFlag === 'N'){ step.value = 1 }else{ + choiceTeacher.value = body.choiceTeacher if(startPgrphId.value){ - choiceTeacher.value = body.choiceTeacher - sendMessage({ - "commond" : 'STDY', - "body" : { - crsId: crsId.value, - teacherNo: choiceTeacher.value - } + setTimeout(() => { + sendMessage({ + "commond" : 'STDY', + "body" : { + crsId: crsId.value, + teacherNo: choiceTeacher.value + } + },300) + step.value = 2 }) - step.value = 2 return } common.show('提示', '系统检测到您已存在学习记录,要继续学习吗?',true, '重新学习','继续学习').then((res) => { @@ -209,7 +211,6 @@ const getData = async (flag) => { // 继续学习 , 获取学习历史接口 // 滚动到最下面 scrollToBottomNow() - choiceTeacher.value = body.choiceTeacher sendMessage({ "commond" : 'STDY', "body" : { @@ -587,8 +588,8 @@ const stdyId = ref('') const stdyBatch = ref('') const logId = ref('') // ws 初始化逻辑 -const initsocketTask = async () => { - await socketStore.creatSocket() +const initsocketTask = () => { + socketStore.creatSocket() unref(SocketObj).on('message', (res)=>{ const { rtnCode, body, commond } = JSON.parse(res.data) if(rtnCode === '0000'){ diff --git a/src/pages/index/dialog.vue b/src/pages/index/dialog.vue index f1562bdd..a1f5b782 100644 --- a/src/pages/index/dialog.vue +++ b/src/pages/index/dialog.vue @@ -415,6 +415,13 @@ import { onShow(()=>{ if(watchFlag.value === 1) return socketStore?.createSocket?.() + sendMessage({ + "commond" : 'ASK-START', + "body" : { + mascotId: mascotId.value, + deviceImei: '' + } + }) }) onUnload(()=>{ watchFlag.value = 1