添加加入房间钱的loading

This commit is contained in:
yj 2024-09-24 15:40:34 +08:00
parent a913c6520b
commit ef932fd3a8
3 changed files with 27 additions and 1 deletions

View File

@ -68,7 +68,11 @@ const JoinSetting = forwardRef((_props: any, ref: any) => {
await GetCheckoutRoomNum(roomNum).then(res => {
if (res.code === 200) {
callBack(res.data)
} else {
storage.setItem('loading', false)
}
}).catch(() => {
storage.setItem('loading', false)
})
}
const getRoomRtcToken = async (roomNum: string, callBack: Function): Promise<void> => {
@ -78,7 +82,11 @@ const JoinSetting = forwardRef((_props: any, ref: any) => {
token: res[0].data,
tokenA: res[1].data,
})
} else {
storage.setItem('loading', false)
}
}).catch(() => {
storage.setItem('loading', false)
})
}
const postRefresh = async (callBack: Function): Promise<void> => {
@ -87,7 +95,11 @@ const JoinSetting = forwardRef((_props: any, ref: any) => {
storage.setItem('user', JSON.stringify(res.data))
storage.setItem('userLogin', true)
callBack(res.data)
} else {
storage.setItem('loading', false)
}
}).catch(() => {
storage.setItem('loading', false)
})
}
return (
@ -172,6 +184,7 @@ const JoinSetting = forwardRef((_props: any, ref: any) => {
message.error('请输入会议号!')
return
}
storage.setItem('loading', true)
isGetCheckoutRoomNum(roomNumber, (bool: boolean) => {
if (bool) {
getRoomRtcToken(roomNumber, (options: any) => {
@ -194,6 +207,8 @@ const JoinSetting = forwardRef((_props: any, ref: any) => {
}
})
}
}).finally(() => {
storage.setItem('loading', false)
})
})
}

View File

@ -87,6 +87,8 @@ const Index: React.FC = () => {
tokenA: res[1].data,
})
}
}).finally(() => {
storage.setItem('loading', false)
})
}
const postRefresh = async (callBack: Function): Promise<void> => {
@ -95,7 +97,11 @@ const Index: React.FC = () => {
storage.setItem('user', JSON.stringify(res.data))
storage.setItem('userLogin', true)
callBack(res.data)
} else {
storage.setItem('loading', false)
}
}).catch(() => {
storage.setItem('loading', false)
})
}
@ -206,7 +212,7 @@ const Index: React.FC = () => {
<img src={ImageUrl.icon10} alt="" />
</div>
<div>
{role.ID.includes(userInfo.roleId) ? <Popover
{role.ID.includes(userInfo.roleId) ? <Popover
content={
<div className='meetingContentFooterPopover'>
{userInfo.roleId === '1' ? <Popconfirm
@ -254,6 +260,7 @@ const Index: React.FC = () => {
if (role.ID.includes(userInfo.roleId)) {
joinSettingRef.current.changeModal(item.roomNum)
} else {
storage.setItem('loading', true)
postRefresh(() => {
getRoomRtcToken(item.roomNum, (options: any) => {
if (options) {

View File

@ -380,4 +380,8 @@ $pagination-hover-background-color: #5575F2;
// ant-message
.ant-message {
-webkit-app-region: no-drag;
}
.ant-spin-fullscreen {
z-index: 10000;
}