聊天室修改视频会议
This commit is contained in:
@@ -561,8 +561,9 @@ async function startMeeting() {
|
||||
// 已有活跃会议,直接加入
|
||||
const meetingUrl = res.data.iframeUrl
|
||||
const meetingId = res.data.meetingId
|
||||
const meetingName = res.data.meetingName || '视频会议'
|
||||
uni.navigateTo({
|
||||
url: `/pages/meeting/Meeting?meetingUrl=${encodeURIComponent(meetingUrl)}&meetingId=${meetingId}`,
|
||||
url: `/pages/meeting/Meeting?meetingUrl=${encodeURIComponent(meetingUrl)}&meetingId=${meetingId}&meetingName=${encodeURIComponent(meetingName)}`,
|
||||
fail: (err) => {
|
||||
console.error('[chatRoom] 跳转会议页面失败:', err)
|
||||
uni.showToast({ title: '打开会议失败', icon: 'none' })
|
||||
@@ -586,27 +587,40 @@ async function startMeeting() {
|
||||
|
||||
// 加入会议(从MeetingCard点击加入)
|
||||
async function handleJoinMeeting(meetingId: string) {
|
||||
console.log('[handleJoinMeeting] 开始加入会议, meetingId:', meetingId)
|
||||
try {
|
||||
// 调用加入会议接口获取iframe URL
|
||||
const joinRes = await workcaseChatAPI.joinMeeting(meetingId)
|
||||
if (joinRes.success && joinRes.data?.iframeUrl) {
|
||||
const meetingUrl = joinRes.data.iframeUrl
|
||||
console.log('[handleJoinMeeting] API响应:', JSON.stringify(joinRes))
|
||||
|
||||
// 兼容两种判断方式:success 字段或 code === 200
|
||||
const isSuccess = joinRes.success || joinRes.code === 200 || joinRes.code === 0
|
||||
const meetingData = joinRes.data
|
||||
|
||||
if (isSuccess && meetingData && meetingData.iframeUrl) {
|
||||
const meetingUrl = meetingData.iframeUrl
|
||||
const meetingName = meetingData.meetingName || '视频会议'
|
||||
console.log('[handleJoinMeeting] 获取到会议URL:', meetingUrl, '会议名称:', meetingName)
|
||||
// 跳转到会议页面
|
||||
uni.navigateTo({
|
||||
url: `/pages/meeting/Meeting?meetingUrl=${encodeURIComponent(meetingUrl)}&meetingId=${meetingId}`,
|
||||
url: `/pages/meeting/Meeting?meetingUrl=${encodeURIComponent(meetingUrl)}&meetingId=${meetingId}&meetingName=${encodeURIComponent(meetingName)}`,
|
||||
success: () => {
|
||||
console.log('[handleJoinMeeting] 跳转成功')
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('[chatRoom] 跳转会议页面失败:', err)
|
||||
console.error('[handleJoinMeeting] 跳转会议页面失败:', err)
|
||||
uni.showToast({ title: '打开会议失败', icon: 'none' })
|
||||
}
|
||||
})
|
||||
} else {
|
||||
console.error('[handleJoinMeeting] 加入会议失败, isSuccess:', isSuccess, 'data:', meetingData)
|
||||
uni.showToast({
|
||||
title: joinRes.message || '加入会议失败',
|
||||
title: joinRes.message || '加入会议失败:未获取到会议地址',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('[chatRoom] 加入会议失败:', error)
|
||||
console.error('[handleJoinMeeting] 加入会议异常:', error)
|
||||
uni.showToast({
|
||||
title: '加入会议失败',
|
||||
icon: 'none'
|
||||
|
||||
Reference in New Issue
Block a user