diff --git a/frontend/src/pages/meeting/room.vue b/frontend/src/pages/meeting/room.vue index e6bf94b..7674a66 100644 --- a/frontend/src/pages/meeting/room.vue +++ b/frontend/src/pages/meeting/room.vue @@ -236,7 +236,8 @@ import { isCloudLawEmbed, isCloudLawLawRole, minimizeCloudLawMeeting, - notifyCloudLawCallEnded + notifyCloudLawCallEnded, + getMiniProgram } from '@/utils/cloudLawMiniProgram' import { isCloudLawLawRoleInMeeting, @@ -875,13 +876,17 @@ const handleCloudLawConsultEnded = async (tip = '用户已退出咨询') => { try { if (cloudLawCallId.value) { await notifyCloudLawBackendEnd(cloudLawCallId.value, 'law', cloudLawApiBase.value) - notifyCloudLawParentCallEnded(cloudLawCallId.value) + if (isCloudLawPcIframe()) { + notifyCloudLawParentCallEnded(cloudLawCallId.value) + } else if (getMiniProgram()) { + notifyCloudLawCallEnded(cloudLawCallId.value) + } } if (meetingStore.isInMeeting) { await meetingStore.leave().catch(() => {}) } uni.showToast({ title: tip, icon: 'none' }) - if (!isCloudLawPcIframe()) { + if (!isCloudLawPcIframe() && !getMiniProgram()) { setTimeout(() => redirectHome(true), 800) } } finally { @@ -987,8 +992,12 @@ onMounted(() => { // 云律律师端(含 PC iframe):用户挂断后同步云律后端 + 通知父页面释放浮窗 if (isCloudLawLawRoleInMeeting(cloudLawRole.value) && cloudLawCallId.value) { notifyCloudLawBackendEnd(cloudLawCallId.value, 'law', cloudLawApiBase.value) - notifyCloudLawParentCallEnded(cloudLawCallId.value) if (isCloudLawPcIframe()) { + notifyCloudLawParentCallEnded(cloudLawCallId.value) + return + } + if (getMiniProgram()) { + notifyCloudLawCallEnded(cloudLawCallId.value) return } } diff --git a/frontend/src/utils/cloudLawMiniProgram.js b/frontend/src/utils/cloudLawMiniProgram.js index cd11612..aabdac4 100644 --- a/frontend/src/utils/cloudLawMiniProgram.js +++ b/frontend/src/utils/cloudLawMiniProgram.js @@ -54,7 +54,7 @@ export function minimizeCloudLawMeeting(callId = '') { /** 会议真正结束:通知小程序释放占用 */ export function notifyCloudLawCallEnded(callId = '') { const mp = getMiniProgram() - if (!isCloudLawEmbed() || !mp) return false + if (!mp) return false try { if (typeof mp.postMessage === 'function') { mp.postMessage({