接口调整

This commit is contained in:
yanghang
2025-07-01 16:21:01 +08:00
parent fee07ada90
commit bf638b894c
2 changed files with 23 additions and 15 deletions
+13 -6
View File
@@ -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