运营数据
This commit is contained in:
@@ -162,12 +162,11 @@ import {
|
|||||||
MEETING_ENDED_REASON_LABEL
|
MEETING_ENDED_REASON_LABEL
|
||||||
} from '@/constants/meeting'
|
} from '@/constants/meeting'
|
||||||
import VideoTile from '@/components/meeting/VideoTile.vue'
|
import VideoTile from '@/components/meeting/VideoTile.vue'
|
||||||
import { minimizeCloudLawMeeting, notifyCloudLawCallEnded, getMiniProgram } from '@/utils/cloudLawMiniProgram'
|
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'
|
||||||
@@ -524,16 +523,15 @@ let miniProgramRedirected = false
|
|||||||
let miniProgramEndNotified = false
|
let miniProgramEndNotified = false
|
||||||
let miniProgramRedirectRetryTimer = null
|
let miniProgramRedirectRetryTimer = null
|
||||||
|
|
||||||
|
const getMiniProgram = () => {
|
||||||
|
return typeof window !== 'undefined' && window.wx && window.wx.miniProgram ? window.wx.miniProgram : null
|
||||||
|
}
|
||||||
|
|
||||||
const navigateMiniProgramToReturnUrl = (returnUrl) => {
|
const navigateMiniProgramToReturnUrl = (returnUrl) => {
|
||||||
const mp = getMiniProgram()
|
const mp = getMiniProgram()
|
||||||
console.log('[CloudLawVideoCall] navigateToReturnUrl', { hasMiniProgram: !!mp, returnUrl, consultId: consultId.value })
|
|
||||||
if (!mp) return false
|
if (!mp) return false
|
||||||
const url = String(returnUrl || '').trim()
|
const url = String(returnUrl || '').trim()
|
||||||
// 拿不到咨询详情地址时返回 false:交给 URL 桥接让原生页用本地 consultId 跳转,
|
if (url) {
|
||||||
// 切勿 navigateBack——那会退出整个视频页且误标记"已跳转",导致停不到咨询详情。
|
|
||||||
if (!url) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
const attempts = [
|
const attempts = [
|
||||||
() => mp.reLaunch && mp.reLaunch({ url }),
|
() => mp.reLaunch && mp.reLaunch({ url }),
|
||||||
() => mp.redirectTo && mp.redirectTo({ url }),
|
() => mp.redirectTo && mp.redirectTo({ url }),
|
||||||
@@ -547,6 +545,15 @@ const navigateMiniProgramToReturnUrl = (returnUrl) => {
|
|||||||
console.warn('[CloudLawVideoCall] miniProgram navigate failed', e)
|
console.warn('[CloudLawVideoCall] miniProgram navigate failed', e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
if (typeof mp.navigateBack === 'function') {
|
||||||
|
mp.navigateBack({ delta: 1 })
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.warn('[CloudLawVideoCall] miniProgram navigateBack failed', e)
|
||||||
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1043,16 +1050,14 @@ const hangup = async () => {
|
|||||||
} finally {
|
} finally {
|
||||||
ended.value = true
|
ended.value = true
|
||||||
leaving.value = false
|
leaving.value = false
|
||||||
if (!isLawRole.value) {
|
// 用户端:优先尝试跳转小程序咨询详情;失败则依赖小程序页轮询 /end 状态兜底
|
||||||
// 挂断流程完成后再通知小程序:避免提前 reload web-view 中断 endMeeting
|
|
||||||
notifyMiniProgramCallEndedOnce()
|
notifyMiniProgramCallEndedOnce()
|
||||||
|
if (!isLawRole.value) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
// web-view 内(经 SSO 重定向)常拿不到 consultId 而无法直跳,
|
if (ended.value && !miniProgramRedirected) {
|
||||||
// 此时用 URL 桥接触发原生页 @load,由原生页用本地 consultId 跳转咨询详情。
|
goToConsultDetail()
|
||||||
if (!miniProgramRedirected) {
|
|
||||||
notifyNativeMiniProgramHangup()
|
|
||||||
}
|
}
|
||||||
}, 400)
|
}, 600)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1120,16 +1125,8 @@ onMounted(() => {
|
|||||||
// 对方挂断或会议结束时,通知云律后端 + 父页面(PC 律师浮窗)+ 小程序
|
// 对方挂断或会议结束时,通知云律后端 + 父页面(PC 律师浮窗)+ 小程序
|
||||||
notifyCloudLawEnd().finally(() => {
|
notifyCloudLawEnd().finally(() => {
|
||||||
if (isLawRole.value) {
|
if (isLawRole.value) {
|
||||||
if (isCloudLawPcIframe()) {
|
|
||||||
notifyCloudLawParentCallEnded(callId.value)
|
notifyCloudLawParentCallEnded(callId.value)
|
||||||
return
|
if (isCloudLawPcIframe()) return
|
||||||
}
|
|
||||||
if (getMiniProgram()) {
|
|
||||||
notifyCloudLawCallEnded(callId.value)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
notifyCloudLawParentCallEnded(callId.value)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
notifyMiniProgramCallEndedOnce()
|
notifyMiniProgramCallEndedOnce()
|
||||||
scheduleEndedRedirect()
|
scheduleEndedRedirect()
|
||||||
|
|||||||
Reference in New Issue
Block a user