This commit is contained in:
yanghang
2025-07-18 09:39:41 +08:00
parent 19f0697c66
commit a292198d33
+14 -16
View File
@@ -177,7 +177,6 @@ const isUploadingVoice = ref(false)
// 初始化数据
const getData = async (flag) => {
try{
initsocketTask()
const { body } = await getCourseStudyInfoApi({crsId: crsId.value})
teacherList.value = body.teacheList.map(t=>({
...t,
@@ -581,18 +580,18 @@ const logId = ref('')
// ws 初始化逻辑
const initsocketTask = () => {
socketStore.creatSocket()
unref(SocketObj).on('open', (res)=>{
if(startPgrphId.value){
sendMessage({
"commond" : 'STDY',
"body" : {
crsId: crsId.value,
teacherNo: choiceTeacher.value
}
})
step.value = 2
}
})
// unref(SocketObj).on('open', (res)=>{
// if(startPgrphId.value){
// sendMessage({
// "commond" : 'STDY',
// "body" : {
// crsId: crsId.value,
// teacherNo: choiceTeacher.value
// }
// })
// step.value = 2
// }
// })
unref(SocketObj).on('message', (res)=>{
const { rtnCode, body, commond } = JSON.parse(res.data)
if(rtnCode === '0000'){
@@ -632,8 +631,8 @@ onLoad((params) => {
const showTalkingModel = ref(false)
// 录音
onMounted(()=>{
initsocketTask()
getData('1');
console.log('onMounted')
})
onHide(()=>{
if(watchFlag.value === 1) return
@@ -644,9 +643,8 @@ onHide(()=>{
}).finally(() => {})
})
onShow(()=>{
console.log('onShow')
if(watchFlag.value === 1) return
getData('1');
getData('2');
})
const watchFlag = ref(1)
onUnload(()=>{