运营数据
This commit is contained in:
@@ -166,7 +166,8 @@ import { minimizeCloudLawMeeting } from '@/utils/cloudLawMiniProgram'
|
|||||||
import {
|
import {
|
||||||
notifyCloudLawBackendEnd,
|
notifyCloudLawBackendEnd,
|
||||||
notifyCloudLawParentCallEnded,
|
notifyCloudLawParentCallEnded,
|
||||||
isCloudLawPcIframe
|
isCloudLawPcIframe,
|
||||||
|
notifyNativeMiniProgramHangup
|
||||||
} from '@/utils/cloudLawVoiceCall'
|
} from '@/utils/cloudLawVoiceCall'
|
||||||
import bgImage from '@/static/bg.png'
|
import bgImage from '@/static/bg.png'
|
||||||
import hangupIcon from '@/static/cacel.png'
|
import hangupIcon from '@/static/cacel.png'
|
||||||
@@ -577,6 +578,12 @@ const notifyMiniProgramCallEnded = () => {
|
|||||||
console.warn('[CloudLawVideoCall] postMessage failed', e)
|
console.warn('[CloudLawVideoCall] postMessage failed', e)
|
||||||
}
|
}
|
||||||
if (miniProgramRedirected) return
|
if (miniProgramRedirected) return
|
||||||
|
// 首选 URL 桥接:改地址加 cloudLawHangup=1,触发原生页 @load 用同域 token 调 /end 并 reLaunch 跳详情。
|
||||||
|
// 这是本环境唯一稳定的「web-view → 原生」通道(jweixin 的 reLaunch/navigateTo/navigateBack 会 timeout)。
|
||||||
|
if (notifyNativeMiniProgramHangup()) {
|
||||||
|
miniProgramRedirected = true
|
||||||
|
return
|
||||||
|
}
|
||||||
if (navigateMiniProgramToReturnUrl(returnUrl)) {
|
if (navigateMiniProgramToReturnUrl(returnUrl)) {
|
||||||
miniProgramRedirected = true
|
miniProgramRedirected = true
|
||||||
return
|
return
|
||||||
@@ -1053,12 +1060,15 @@ const hangup = async () => {
|
|||||||
if (isLawRole.value) {
|
if (isLawRole.value) {
|
||||||
notifyMiniProgramCallEndedOnce()
|
notifyMiniProgramCallEndedOnce()
|
||||||
} else {
|
} else {
|
||||||
// 关键修复:web-view 的 wx.miniProgram.reLaunch/navigateTo 在本环境会 navigateTo:fail
|
// 关键修复(回归点):web-view 内 wx.miniProgram.reLaunch/navigateTo/navigateBack 在本环境
|
||||||
// timeout、根本不触发小程序导航,导致原生承载页 onUnload 不执行、同域 /end 不被调,
|
// 会 navigateTo:fail timeout、根本不触发小程序导航,导致:用户停在 EchoChat 结束页、
|
||||||
// 会议结束不了(status 一直 accepted、律师端不结束)。
|
// 原生承载页 onUnload 不执行、同域 /end 不被调、status 一直 accepted、律师端不结束。
|
||||||
// navigateBack 不加载新页面、可靠触发后退 → 原生页 onUnload 调同域 /end 结束会议
|
//
|
||||||
//(等同用户手点左上角返回箭头,已验证可行);同时 postMessage 携带 consultId,
|
// 唯一可靠的「web-view → 原生」信号是「改 URL 触发原生 @load」:
|
||||||
// 原生页 onMessage 收到后用 uni.reLaunch 跳咨询详情。
|
// notifyNativeMiniProgramHangup() 用 location.replace 给当前地址加 cloudLawHangup=1,
|
||||||
|
// web-view 真实重载 → 原生页 onWebViewLoad 命中 cloudLawHangup=1 →
|
||||||
|
// 用原生 token 调同域 /end(结束会议、通知律师端 PC/小程序)→ uni.reLaunch 跳咨询详情。
|
||||||
|
// 不依赖 jweixin 导航、不依赖 postMessage 销毁时机、不依赖 EchoChat 房间是否先结束。
|
||||||
const returnUrl = buildMiniProgramReturnUrl()
|
const returnUrl = buildMiniProgramReturnUrl()
|
||||||
const mp = getMiniProgram()
|
const mp = getMiniProgram()
|
||||||
try {
|
try {
|
||||||
@@ -1076,6 +1086,8 @@ const hangup = async () => {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn('[CloudLawVideoCall] postMessage failed', e)
|
console.warn('[CloudLawVideoCall] postMessage failed', e)
|
||||||
}
|
}
|
||||||
|
// 主路径:URL 桥接(最可靠)。失败再退回 navigateBack 兜底。
|
||||||
|
if (!notifyNativeMiniProgramHangup()) {
|
||||||
try {
|
try {
|
||||||
if (mp && typeof mp.navigateBack === 'function') {
|
if (mp && typeof mp.navigateBack === 'function') {
|
||||||
mp.navigateBack({ delta: 1 })
|
mp.navigateBack({ delta: 1 })
|
||||||
@@ -1086,6 +1098,7 @@ const hangup = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onLoad(query => {
|
onLoad(query => {
|
||||||
const decodeQueryValue = (value) => {
|
const decodeQueryValue = (value) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user