电话咨询

This commit is contained in:
duoaohui
2026-06-04 15:52:22 +08:00
parent 495f0aae1b
commit cae3876d8b
4 changed files with 188 additions and 71 deletions

View File

@@ -115,6 +115,7 @@ import { ref, reactive, computed, onBeforeUnmount, nextTick } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import { useMeetingStore } from '@/store/meeting'
import { useUserStore } from '@/store/user'
import { isCloudLawEmbed, isCloudLawLawRole, minimizeCloudLawMeeting } from '@/utils/cloudLawMiniProgram'
const meetingStore = useMeetingStore()
const userStore = useUserStore()
@@ -124,6 +125,7 @@ const joinCode = ref('')
const joinPassword = ref('')
const autoJoin = ref(false)
const cloudLawRole = ref('')
const cloudLawCallId = ref('')
const initializing = ref(true)
// autoJoin 失败/超时的可见错误(替代无限"正在进入会议…"转圈)
const autoJoinError = ref('')
@@ -372,6 +374,10 @@ const onToggleVideoDefault = (e) => { mediaPrefs.startVideo = e.detail.value }
const onToggleAudioDefault = (e) => { mediaPrefs.startAudio = e.detail.value }
const onCancel = () => {
if (isCloudLawEmbed() && isCloudLawLawRole(cloudLawRole.value)) {
minimizeCloudLawMeeting(cloudLawCallId.value)
return
}
uni.navigateBack()
}
@@ -398,16 +404,10 @@ const retryAutoJoin = () => {
const exitAutoJoin = () => {
clearAutoJoinWatchdog()
// 云律小程序 web-view 内:返回到小程序;否则回上一步
try {
const embedded = typeof window !== 'undefined' && window.sessionStorage
&& window.sessionStorage.getItem('echo_cloud_law_meeting_embed') === '1'
const mp = typeof window !== 'undefined' && window.wx && window.wx.miniProgram ? window.wx.miniProgram : null
if (embedded && mp && typeof mp.navigateBack === 'function') {
mp.navigateBack({ delta: 1 })
return
}
} catch (e) {}
if (isCloudLawEmbed() && isCloudLawLawRole(cloudLawRole.value)) {
minimizeCloudLawMeeting(cloudLawCallId.value)
return
}
onCancel()
}
@@ -469,7 +469,8 @@ const onJoin = async (options = {}) => {
}
const roomCode = meetingStore.currentRoom?.room_code
const roleQ = cloudLawRole.value ? `&cloudLawRole=${encodeURIComponent(cloudLawRole.value)}` : ''
uni.redirectTo({ url: `/pages/meeting/room${roomCode ? `?code=${roomCode}${roleQ}` : (roleQ ? `?${roleQ.slice(1)}` : '')}` })
const callQ = cloudLawCallId.value ? `&callId=${encodeURIComponent(cloudLawCallId.value)}` : ''
uni.redirectTo({ url: `/pages/meeting/room${roomCode ? `?code=${roomCode}${roleQ}${callQ}` : `${roleQ || callQ ? `?${(roleQ + callQ).replace(/^&/, '')}` : ''}`}` })
} catch (err) {
const msg = err?.message || JSON.stringify(err)
// autoJoin 模式下把错误显式呈现在页面toast 一闪而过,真机很难看清)
@@ -494,6 +495,7 @@ onLoad(async (query) => {
mode.value = query?.mode === 'join' ? 'join' : 'create'
joinCode.value = query?.code || ''
cloudLawRole.value = query?.cloudLawRole || query?.cloud_law_role || ''
cloudLawCallId.value = query?.callId || query?.call_id || ''
autoJoin.value = query?.autoJoin === '1' || query?.autoJoin === 'true' || query?.autoJoin === true
// #ifdef H5
if (String(cloudLawRole.value).toLowerCase() === 'law') {