Merge branch 'develop' into 'sit'

闪退问题处理

See merge request K17_AITS/tra-app!24
This commit is contained in:
田岩
2025-07-15 17:16:53 +08:00
2 changed files with 12 additions and 12 deletions
+2 -8
View File
@@ -69,17 +69,11 @@ const audioObj = uni.createInnerAudioContext()
const recordObjCom = ref({})
const initRecord = () => {
recordObjCom.value = uni.getRecorderManager()
startRecord()
stopRecord()
unref(recordObjCom)?.onStop((res, duration)=>{
audioPath.value = res.tempFilePath
uni.saveFile({
tempFilePath:res.tempFilePath,
success:(res)=>{
console.log(res)
}
})
})
unref(recordObjCom).start({format:'mp3'})
stopRecord()
}
const startRecord = () => {
unref(recordObjCom).start({format:'mp3'})
+10 -4
View File
@@ -121,7 +121,7 @@
<script setup>
import { reactive, ref, computed, unref, onMounted, onUnmounted, getCurrentInstance, nextTick } from 'vue';
import { onLoad,onShow, onUnload } from '@dcloudio/uni-app';
import { onLoad,onShow, onUnload,onHide } from '@dcloudio/uni-app';
import {
previewFile,
downloadFile,
@@ -582,9 +582,15 @@ const showTalkingModel = ref(false)
// onMounted(()=>{
// getData('1');
// })
// onShow(()=>{
// getData('2');
// })
onHide(()=>{
socketStore.closeSocket()
common.show('提示信息', '检测到您已离开,即将退出学习页面。',false, '','确认').then((res) => {
common.redirectTo(`/pages/courseDetail/index?crsId=${crsId.value}&crsNum=${crsNum.value}&from=study`)
}).finally(() => {})
})
onShow(()=>{
socketStore.createSocket()
})
onUnload(()=>{
changePlayItemId()
teacherVoiceObj?.stop?.()