From bf638b894c5eddfee4918029efdeb293108457f8 Mon Sep 17 00:00:00 2001 From: yanghang Date: Tue, 1 Jul 2025 16:21:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/course/components/talkingItem.vue | 19 ++++++++++--------- src/pages/course/study.vue | 19 +++++++++++++------ 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/src/pages/course/components/talkingItem.vue b/src/pages/course/components/talkingItem.vue index 319e81b4..ec6cd3cd 100644 --- a/src/pages/course/components/talkingItem.vue +++ b/src/pages/course/components/talkingItem.vue @@ -43,7 +43,7 @@ class="icon" src="@/static/images/course/play.png" style="width: 100%;height: 100%;" - @click="playVoice" + @click="playVoice()" v-show="!isPlaying" > { talkVoiceObj.value.src = itemVoice.value talkVoiceObj.value.play() },100) }else{ + console.log(2,itemVoice.value) let _params = { crsId: unref(dataInfo)?.crsId || '', pgrphId: unref(dataInfo)?.pgrphId || '', @@ -244,14 +246,13 @@ import { getUserInfo } from '@/common/common'; } const showNextBtn = ref(true) const goOnGetQues = () => { - // studyParagraphOverApi({ - // pgrphId:unref(dataInfo)?.pgrphId - // }).then(res=>{ - // showNextBtn.value = false - // emit('nextQuestion', unref(dataInfo)) - // }) - showNextBtn.value = false - emit('nextQuestion', unref(dataInfo)) + studyParagraphOverApi({ + pgrphId:unref(dataInfo)?.pgrphId, + logId:unref(dataInfo)?.logId, + }).then(res=>{ + showNextBtn.value = false + emit('nextQuestion', unref(dataInfo)) + }) } diff --git a/src/pages/course/study.vue b/src/pages/course/study.vue index fe3b49de..b6f12d22 100644 --- a/src/pages/course/study.vue +++ b/src/pages/course/study.vue @@ -145,13 +145,13 @@ const getData = async () => { try{ const { body } = await getCourseStudyInfoApi({crsId: crsId.value}) initsocketTask() + teacherList.value = body.teacheList.map(t=>({ + ...t, + voicePath: '', + voiceObj: null + })) if(body.stdyProgressFlag === 'N'){ step.value = 1 - teacherList.value = body.teacheList.map(t=>({ - ...t, - voicePath: '', - voiceObj: null - })) }else{ common.show('提示信息', '此门课程已有学习历史,请选择是否继续学习?',true, '重新开始','继续学习').then((res) => { if(res) { @@ -218,6 +218,7 @@ const showKeyboard = () => { let _data = { qnsId: unref(lastTalkingInfo).qnsId,// 问题ID 必输项:true 类型:String pgrphId: unref(lastTalkingInfo).pgrphId,// 段落ID 必输项:true 类型:String + qstLogId: unref(qstLogId),// 段落ID 必输项:true 类型:String crsId: crsId.value,// 课程ID 必输项:true 类型:String stdyBatch: stdyBatch.value,// 学习批次 必输项:true 类型:String ansterContent: answerValue.value // 回答文本内容 必输项:false 类型:String @@ -313,16 +314,19 @@ const getGraphInfoUnStudy = () => { pgrphNum.value = res.body.pgrphNum showOrder.value = res.body.showOrder + logId.value = res.body.logId || '' scrollToBottomNow() }) } const lastTalkingInfo = ref({}) +const qstLogId = ref('') // 获取问题 const getQuestionInfoUnStudy = (pgrphId) => { queryTraStdyBatchWaitQuestionInfoApi({ crsId: crsId.value, stdyId: unref(stdyId), stdyBatch: unref(stdyBatch), + logId: unref(logId), pgrphId }).then(res=>{ let _id = new Date().getTime() + 'id' @@ -333,6 +337,7 @@ const getQuestionInfoUnStudy = (pgrphId) => { id: _id } talkingList.value.push(lastTalkingInfo.value) + qstLogId.value = res.body.qstLogId scrollToBottomNow() }) } @@ -378,6 +383,7 @@ const isManualClose = ref(false) // 是否手动关闭 const stdyId = ref('') const stdyBatch = ref('') +const logId = ref('') // ws 初始化逻辑 const initsocketTask = () => { socketStore.creatSocket() @@ -387,6 +393,7 @@ const initsocketTask = () => { if(commond === 'STDYBTH' && !stdyId.value){ stdyId.value = body.stdyId || '' stdyBatch.value = body.stdyBatch || '' + logId.value = body.logId || '' getGraphInfoUnStudy() } }else{ @@ -489,11 +496,11 @@ const hideOverlayTalking = (obj) => { stopRecord() // #endif if(!isOut.value){ - console.log(11111111111111) setTimeout(()=>{ let _data = { qnsId: unref(lastTalkingInfo).qnsId,// 问题ID 必输项:true 类型:String pgrphId: unref(lastTalkingInfo).pgrphId,// 段落ID 必输项:true 类型:String + qstLogId: unref(qstLogId),// 段落ID 必输项:true 类型:String crsId: crsId.value,// 课程ID 必输项:true 类型:String stdyBatch: stdyBatch.value,// 学习批次 必输项:true 类型:String ansterContent: '',// 回答文本内容 必输项:false 类型:String