运营数据
This commit is contained in:
@@ -528,28 +528,23 @@ const navigateMiniProgramToReturnUrl = (returnUrl) => {
|
||||
const mp = getMiniProgram()
|
||||
if (!mp) return false
|
||||
const url = String(returnUrl || '').trim()
|
||||
if (url) {
|
||||
const attempts = [
|
||||
() => mp.reLaunch && mp.reLaunch({ url }),
|
||||
() => mp.redirectTo && mp.redirectTo({ url }),
|
||||
() => mp.navigateTo && mp.navigateTo({ url })
|
||||
]
|
||||
for (let i = 0; i < attempts.length; i++) {
|
||||
try {
|
||||
attempts[i]()
|
||||
return true
|
||||
} catch (e) {
|
||||
console.warn('[CloudLawVideoCall] miniProgram navigate failed', e)
|
||||
}
|
||||
}
|
||||
// 拿不到咨询详情地址时返回 false:交给 URL 桥接让原生页用本地 consultId 跳转,
|
||||
// 切勿 navigateBack——那会退出整个视频页且误标记"已跳转",导致停不到咨询详情。
|
||||
if (!url) {
|
||||
return false
|
||||
}
|
||||
try {
|
||||
if (typeof mp.navigateBack === 'function') {
|
||||
mp.navigateBack({ delta: 1 })
|
||||
const attempts = [
|
||||
() => mp.reLaunch && mp.reLaunch({ url }),
|
||||
() => mp.redirectTo && mp.redirectTo({ url }),
|
||||
() => mp.navigateTo && mp.navigateTo({ url })
|
||||
]
|
||||
for (let i = 0; i < attempts.length; i++) {
|
||||
try {
|
||||
attempts[i]()
|
||||
return true
|
||||
} catch (e) {
|
||||
console.warn('[CloudLawVideoCall] miniProgram navigate failed', e)
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('[CloudLawVideoCall] miniProgram navigateBack failed', e)
|
||||
}
|
||||
return false
|
||||
}
|
||||
@@ -1051,10 +1046,8 @@ const hangup = async () => {
|
||||
// 挂断流程完成后再通知小程序:避免提前 reload web-view 中断 endMeeting
|
||||
notifyMiniProgramCallEndedOnce()
|
||||
setTimeout(() => {
|
||||
if (!miniProgramRedirected) {
|
||||
goToConsultDetail()
|
||||
}
|
||||
// 跳转失败时再用 URL 桥接触发原生页 @load 兜底
|
||||
// web-view 内(经 SSO 重定向)常拿不到 consultId 而无法直跳,
|
||||
// 此时用 URL 桥接触发原生页 @load,由原生页用本地 consultId 跳转咨询详情。
|
||||
if (!miniProgramRedirected) {
|
||||
notifyNativeMiniProgramHangup()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user