This commit is contained in:
yj 2024-08-14 16:26:58 +08:00
parent 4d074cf28b
commit 523efcae2e
1 changed files with 25 additions and 13 deletions

View File

@ -15,9 +15,14 @@ const JoinSetting = forwardRef((_props: any, ref: any) => {
let userInfo = JSON.parse(storage.getItem('user') as string) let userInfo = JSON.parse(storage.getItem('user') as string)
setUser(userInfo) setUser(userInfo)
setJoinRoomSettingModal(true) setJoinRoomSettingModal(true)
setJoinRoomSettingForm({ setJoinRoomSettingForm((res: any) => {
...joinRoomSettingForm, res.list.forEach((item: any) => {
roomNum, item.active = false
});
return {
...res,
roomNum: roomNum
}
}) })
if (location.hash.indexOf('/meeting') === -1) { if (location.hash.indexOf('/meeting') === -1) {
agora.init() agora.init()
@ -107,7 +112,8 @@ const JoinSetting = forwardRef((_props: any, ref: any) => {
<> <>
<Modal title=" <Modal title="
" open={joinRoomSettingModal} " open={joinRoomSettingModal}
footer={null} centered footer={null}
centered
width={'500px'} width={'500px'}
onCancel={() => { onCancel={() => {
clearInterval(time) clearInterval(time)
@ -143,17 +149,23 @@ const JoinSetting = forwardRef((_props: any, ref: any) => {
{ {
joinRoomSettingForm.list.map((item, index) => { joinRoomSettingForm.list.map((item, index) => {
return <div key={index} onClick={async () => { return <div key={index} onClick={async () => {
let msg = '';
setDeviceList((res: any) => {
if (index === 0) { if (index === 0) {
if (!deviceList.audioList.length) { if (!res.audioList.length) {
message.error('未检测到麦克风!') msg = '未检测到麦克风!'
return
} }
} else { } else {
if (!deviceList.videoList.length) { if (!res.videoList.length) {
message.error('未检测到摄像头!') msg = '未检测到麦克风!'
return
} }
} }
return res
})
if (msg) {
message.error('未检测到麦克风!')
return
}
const list = [...joinRoomSettingForm.list] const list = [...joinRoomSettingForm.list]
list[index].active = !list[index].active list[index].active = !list[index].active
setJoinRoomSettingForm({ setJoinRoomSettingForm({