电话咨询

This commit is contained in:
duoaohui
2026-06-04 11:51:24 +08:00
parent 96fca438f4
commit 6727259e8b
2 changed files with 78 additions and 9 deletions

View File

@@ -7,6 +7,7 @@
<text class="entry-title">{{ entryTitle }}</text>
<text class="entry-desc">{{ joinError || stateText }}</text>
<button v-if="joinError" class="retry-btn" @click="joinMeeting">重新进入</button>
<button v-else-if="ended && buildMiniProgramReturnUrl()" class="retry-btn" @click="goToConsultDetail">查看咨询详情</button>
</view>
<view v-else class="call-shell" :class="{ 'voice-mode': isVoiceMode }">
@@ -425,6 +426,8 @@ const buildMiniProgramReturnUrl = () => {
return `/pages_work/ai_consult/ai_consult?id=${encodeURIComponent(consultId.value)}&mode=detail&from=videoCall`
}
let endedRedirectTimer = null
const notifyMiniProgramCallEnded = () => {
const payload = {
type: 'cloudLawCallEnded',
@@ -446,6 +449,18 @@ const notifyMiniProgramCallEnded = () => {
}
}
const scheduleEndedRedirect = () => {
if (endedRedirectTimer) return
endedRedirectTimer = setTimeout(() => {
endedRedirectTimer = null
notifyCloudLawEnd().finally(() => notifyMiniProgramCallEnded())
}, 1200)
}
const goToConsultDetail = () => {
notifyCloudLawEnd().finally(() => notifyMiniProgramCallEnded())
}
const pollCommandsOnce = async () => {
if (!callId.value || !meetingStore.isInMeeting || leaving.value || ended.value || commandPolling) return
commandPolling = true
@@ -827,6 +842,7 @@ const hangup = async () => {
ended.value = true
leaving.value = false
notifyMiniProgramCallEnded()
scheduleEndedRedirect()
}
}
@@ -855,11 +871,20 @@ onMounted(() => {
const label = MEETING_ENDED_REASON_LABEL?.[reason] || '视频咨询已结束'
uni.showToast({ title: label, icon: 'none' })
ended.value = true
// 对方挂断或会议结束时,通知小程序跳转到「我的咨询详情」
notifyCloudLawEnd().finally(() => {
notifyMiniProgramCallEnded()
scheduleEndedRedirect()
})
}
}, { immediate: true })
})
onBeforeUnmount(() => {
if (endedRedirectTimer) {
clearTimeout(endedRedirectTimer)
endedRedirectTimer = null
}
if (timerHandle) {
clearInterval(timerHandle)
timerHandle = null