运营数据

This commit is contained in:
duoaohui
2026-06-06 13:38:50 +08:00
parent e697354ce9
commit c6e460ad97

View File

@@ -166,8 +166,7 @@ import { minimizeCloudLawMeeting } from '@/utils/cloudLawMiniProgram'
import {
notifyCloudLawBackendEnd,
notifyCloudLawParentCallEnded,
isCloudLawPcIframe,
notifyNativeMiniProgramHangup
isCloudLawPcIframe
} from '@/utils/cloudLawVoiceCall'
import bgImage from '@/static/bg.png'
import hangupIcon from '@/static/cacel.png'
@@ -1054,14 +1053,36 @@ const hangup = async () => {
if (isLawRole.value) {
notifyMiniProgramCallEndedOnce()
} else {
// 用户端跳转咨询详情postMessage 仅作辅助。
// 房间已 endMeeting 同源结束,这里用 URL 桥接(cloudLawHangup=1)触发原生页 onWebViewLoad
// 由原生页用 uni.reLaunch 跳转——web-view JSSDK 的 reLaunch 无成功回调,当前微信环境会
// navigateTo:fail timeout 静默失败却误标记已跳转,导致停不到咨询详情,故不依赖它。
notifyMiniProgramCallEndedOnce()
setTimeout(() => {
notifyNativeMiniProgramHangup()
}, 300)
// 关键修复web-view 的 wx.miniProgram.reLaunch/navigateTo 在本环境会 navigateTo:fail
// timeout、根本不触发小程序导航导致原生承载页 onUnload 不执行、同域 /end 不被调
// 会议结束不了status 一直 accepted、律师端不结束
// navigateBack 不加载新页面、可靠触发后退 → 原生页 onUnload 调同域 /end 结束会议
//(等同用户手点左上角返回箭头,已验证可行);同时 postMessage 携带 consultId
// 原生页 onMessage 收到后用 uni.reLaunch 跳咨询详情。
const returnUrl = buildMiniProgramReturnUrl()
const mp = getMiniProgram()
try {
if (mp && typeof mp.postMessage === 'function') {
mp.postMessage({
data: {
type: 'cloudLawCallEnded',
action: 'cloudLawCallEnded',
callId: callId.value,
consultId: consultId.value,
returnUrl
}
})
}
} catch (e) {
console.warn('[CloudLawVideoCall] postMessage failed', e)
}
try {
if (mp && typeof mp.navigateBack === 'function') {
mp.navigateBack({ delta: 1 })
}
} catch (e) {
console.warn('[CloudLawVideoCall] navigateBack failed', e)
}
}
}
}