From d365b319a1cf83a1d56ca0b95dd0732b58e77a09 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Fri, 23 Aug 2024 09:20:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E7=A4=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Meeting/index.tsx | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index 386dafa..7744a00 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -364,7 +364,7 @@ const Meeting: React.FC = () => { if (item.user.uid === userInfo.uid) { message.success(`管理员${item.user.isRoomManager ? '设置' : '取消'}您为发言人`) await agora.updateChannelMediaOptions(item.user.isRoomManager) - await postOpenMicrApi(item.user.isRoomManager, userInfo.uid) + await postOpenMicrApi(item.user.isRoomManager, userInfo.uid, false) await postOpenCameraApi(item.user.isRoomManager, userInfo.uid) await stopScreenCapture() } else { @@ -1007,7 +1007,7 @@ const Meeting: React.FC = () => { }, 0); } // 开关麦克风 - const postOpenMicr = async (enableMicr: boolean, uid: string, isAll?: boolean): Promise => { + const postOpenMicr = async (enableMicr: boolean, uid: string, isAll: boolean = false): Promise => { await getUserRoomInfo().then(async (res) => { if (res) { if (!isAll) { @@ -1030,14 +1030,14 @@ const Meeting: React.FC = () => { return message.error('房间内最多20个开启麦克风') } } - await postOpenMicrApi(enableMicr, uid, isAll) + await postOpenMicrApi(enableMicr, uid, isAll, true) } else { message.error(msgTips) } }) } // 开关麦克风 - const postOpenMicrApi = async (enableMicr: boolean, uid: string, isAll?: boolean): Promise => { + const postOpenMicrApi = async (enableMicr: boolean, uid: string, isAll: boolean, isMessage: boolean = false): Promise => { if (isAll) { await PostMuteAll({ roomNum: state.channelId, @@ -1050,6 +1050,9 @@ const Meeting: React.FC = () => { enableMicr }) } + if (isMessage) { + message.success('操作成功') + } } // 开关视频 @@ -1074,14 +1077,14 @@ const Meeting: React.FC = () => { return message.error('房间内最多20个开启摄像头') } } - await postOpenCameraApi(enableCamera, uid) + await postOpenCameraApi(enableCamera, uid, true) } else { message.error(msgTips) } }) } // 开关视频 - const postOpenCameraApi = async (enableCamera: boolean, uid: string): Promise => { + const postOpenCameraApi = async (enableCamera: boolean, uid: string, isMessage: boolean = false): Promise => { if (enableCamera) { await agora.startCameraCapture() } else { @@ -1092,6 +1095,9 @@ const Meeting: React.FC = () => { uid, enableCamera }) + if (isMessage) { + message.success('操作成功') + } } // 演讲者模式 // const changeSpeakerMode = (): void => { @@ -1173,12 +1179,13 @@ const Meeting: React.FC = () => { }) } // 设置全员观看 - const setAllUserLook = (item: any): void => { + const setAllUserLook = async (item: any): Promise => { if (isShare) { - allUserLook(String(isShare) === item.screenShareId ? item.screenShareId : item.uid, item.userName) + await allUserLook(String(isShare) === item.screenShareId ? item.screenShareId : item.uid, item.userName) } else { - allUserLook(item.uid, item.userName) + await allUserLook(item.uid, item.userName) } + message.success('操作成功') } // 移出房间 const getRoomKickout = async (channelId: string, uid: string, userName: string): Promise => { @@ -1191,6 +1198,7 @@ const Meeting: React.FC = () => { cancelText: '取消', async onOk() { await GetRoomKickout(channelId, uid) + message.success('操作成功') }, onCancel() { },