fix ;bug

This commit is contained in:
yanghang
2025-07-17 11:32:29 +08:00
parent c31da2f215
commit 484d5c78f7
+27 -14
View File
@@ -181,6 +181,7 @@ const getData = async (flag) => {
// }else{
// return
// }
console.log(11111111)
try{
initsocketTask()
const { body } = await getCourseStudyInfoApi({crsId: crsId.value})
@@ -194,15 +195,12 @@ const getData = async (flag) => {
}else{
choiceTeacher.value = body.choiceTeacher
if(startPgrphId.value){
setTimeout(() => {
sendMessage({
"commond" : 'STDY',
"body" : {
crsId: crsId.value,
teacherNo: choiceTeacher.value
}
},300)
step.value = 2
sendMessage({
"commond" : 'STDY',
"body" : {
crsId: crsId.value,
teacherNo: choiceTeacher.value
}
})
return
}
@@ -590,6 +588,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('message', (res)=>{
const { rtnCode, body, commond } = JSON.parse(res.data)
if(rtnCode === '0000'){
@@ -598,6 +608,7 @@ const initsocketTask = () => {
stdyBatch.value = body.stdyBatch || ''
logId.value = body.logId || ''
getGraphInfoUnStudy(1)
step.value = 2
}
}else{
// if(['0005', 'QQ0005'].includes(res.rtnCode)) {
@@ -623,13 +634,14 @@ onLoad((params) => {
crsNum.value = params.crsNum||'';
imageId.value = params.imgId || ''
startPgrphId.value = params.pgrphId||'';
getData('1');
console.log('onLoad')
});
const showTalkingModel = ref(false)
// 录音
// onMounted(()=>{
// getData('1');
// })
onMounted(()=>{
getData('1');
console.log('onMounted')
})
onHide(()=>{
if(watchFlag.value === 1) return
changePlayItemId('')
@@ -639,8 +651,9 @@ onHide(()=>{
}).finally(() => {})
})
onShow(()=>{
console.log('onShow')
if(watchFlag.value === 1) return
socketStore.createSocket()
getData('1');
})
const watchFlag = ref(1)
onUnload(()=>{