This commit is contained in:
Your Name
2026-05-07 16:42:29 +08:00
parent 576ef8e033
commit a9474356ff
6 changed files with 144 additions and 12 deletions
@@ -164,7 +164,7 @@
<script lang="ts" setup>
import { ref, watch, computed } from 'vue';
import { onHide, onUnload } from '@dcloudio/uni-app'
import { onUnload } from '@dcloudio/uni-app'
import Avatar from '../Avatar/Avatar.vue';
import TRTCPusher from '@tencentcloud/trtc-component-uniapp/src/components/TRTCPusher.vue';
import TRTCPlayer from '@tencentcloud/trtc-component-uniapp/src/components/TRTCPlayer.vue';
@@ -337,6 +337,8 @@ onUnload(() => {
const callRole = callParticipantInfo?.value?.selfInfo?.role;
if (callStatus === CallStatus.IDLE) return;
// 已接通:页面卸载(返回、切后台、关闭小程序等)不主动 signaling 挂断,医生端可继续面诊;结束请点「挂断」
if (callStatus === CallStatus.CONNECTED) return;
if (callStatus === CallStatus.CALLING) {
if (callRole === CallRole.CALLER) {
hangup();
@@ -344,9 +346,6 @@ onUnload(() => {
reject();
}
}
if (callStatus === CallStatus.CONNECTED) {
hangup();
}
});
</script>