From 3de6c6a5e0cfd238935ff8809ac7624d0cbf5219 Mon Sep 17 00:00:00 2001 From: yanghang Date: Thu, 10 Jul 2025 08:46:16 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=AD=A6=E4=B9=A0-=E4=BB=8E?= =?UTF-8?q?=E6=8C=87=E5=AE=9A=E7=9F=A5=E8=AF=86=E7=82=B9=E5=BC=80=E5=A7=8B?= =?UTF-8?q?=EF=BC=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/course/study.vue | 44 +++++++++++-------- .../courseDetail/components/knowledge.vue | 8 ++-- src/pages/courseDetail/index.vue | 5 ++- 3 files changed, 34 insertions(+), 23 deletions(-) diff --git a/src/pages/course/study.vue b/src/pages/course/study.vue index 50aedcda..cfa8209c 100644 --- a/src/pages/course/study.vue +++ b/src/pages/course/study.vue @@ -165,6 +165,19 @@ const getData = async (flag) => { if(body.stdyProgressFlag === 'N'){ step.value = 1 }else{ + if(startPgrphId.value){ + scrollToBottomNow() + choiceTeacher.value = body.choiceTeacher + sendMessage({ + "commond" : 'STDY', + "body" : { + crsId: crsId.value, + teacherNo: choiceTeacher.value + } + }) + step.value = 2 + return + } common.show('提示信息', '此门课程已有学习历史,请选择是否继续学习?',true, '重新开始','继续学习').then((res) => { if(res) { // 继续学习 , 获取学习历史接口 @@ -280,27 +293,20 @@ const pgrphNum = ref(1) const showOrder = ref(0) const isLastPgrph = ref(false) // 获取段落 -const getGraphInfoUnStudy = () => { +const getGraphInfoUnStudy = (flag = 0) => { console.log(isLastPgrph.value) let _id = new Date().getTime() + 'id' - // if(isLastPgrph.value){ - // talkingList.value.push({ - // chatContent: '您已学完全部知识点!', - // userInfo: {...choiceTeacherInfo.value}, - // type: 7, - // id: _id - // }) - // scrollToBottomNow() - // // common.msg('您已学完全部知识点!') - // return - // } - textChartApi({ - processType: 'PRGH-STDY', - requestBody: JSON.stringify({ + let _data = { crsId: crsId.value, stdyId: unref(stdyId), stdyBatch: unref(stdyBatch) - }) + } + if(flag === 1 && !!startPgrphId.value){ + _data.pgrphId = startPgrphId.value + } + textChartApi({ + processType: 'PRGH-STDY', + requestBody: JSON.stringify(_data) }).then(res=>{ let _body = res.body|| {} console.log(_body) @@ -504,7 +510,7 @@ const initsocketTask = () => { stdyId.value = body.stdyId || '' stdyBatch.value = body.stdyBatch || '' logId.value = body.logId || '' - getGraphInfoUnStudy() + getGraphInfoUnStudy(1) } }else{ if(['0005', 'QQ0005'].includes(res.rtnCode)) { @@ -523,15 +529,15 @@ const sendMessage = (data) => { unref(SocketObj).send(data) } // ws 结束 - +const startPgrphId = ref('') onLoad((params) => { crsId.value = params.crsId||''; crsNum.value = params.crsNum||''; + startPgrphId.value = params.pgrphId||''; }); const showTalkingModel = ref(false) // 录音 onMounted(()=>{ - console.log('init/111') getData('1'); }) // onShow(()=>{ diff --git a/src/pages/courseDetail/components/knowledge.vue b/src/pages/courseDetail/components/knowledge.vue index a43abe4e..05962621 100644 --- a/src/pages/courseDetail/components/knowledge.vue +++ b/src/pages/courseDetail/components/knowledge.vue @@ -4,7 +4,7 @@ - + 知识点0{{ index + 1 }} {{ item.pgrphContent }} @@ -20,12 +20,14 @@ import common from '@/common/common'; - + const emit = defineEmits(['toStudyPrgh']) const props = defineProps({ modelValue: Object }) - + const toDetail = (item) => { + emit('toStudyPrgh', item) + }