邀请完成
This commit is contained in:
parent
d7eaf1584d
commit
7a75abc22c
|
|
@ -72,7 +72,7 @@ const App: React.FC = () => {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}, [])
|
}, [navigate])
|
||||||
const handleResize = (): void => {
|
const handleResize = (): void => {
|
||||||
setWindowSize({
|
setWindowSize({
|
||||||
width: window.innerWidth,
|
width: window.innerWidth,
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import { SearchOutlined } from '@ant-design/icons';
|
||||||
import { GetUserList } from '@/api/Home/User';
|
import { GetUserList } from '@/api/Home/User';
|
||||||
import { useLocation } from 'react-router-dom';
|
import { useLocation } from 'react-router-dom';
|
||||||
import { PostRoomInvite } from '@/api/Meeting';
|
import { PostRoomInvite } from '@/api/Meeting';
|
||||||
|
import { storage } from '@/utils';
|
||||||
const InvitingPersonnelModal = forwardRef((props: any, ref: any) => {
|
const InvitingPersonnelModal = forwardRef((props: any, ref: any) => {
|
||||||
useImperativeHandle(ref, () => ({
|
useImperativeHandle(ref, () => ({
|
||||||
changeInvitingPersonnelModal: () => {
|
changeInvitingPersonnelModal: () => {
|
||||||
|
|
@ -164,8 +165,18 @@ const InvitingPersonnelModal = forwardRef((props: any, ref: any) => {
|
||||||
<Button type="primary" onClick={() => { setIsInvitingPersonnelModal(false) }} style={{ backgroundColor: '#31353A', marginRight: '14px' }}>取消</Button>
|
<Button type="primary" onClick={() => { setIsInvitingPersonnelModal(false) }} style={{ backgroundColor: '#31353A', marginRight: '14px' }}>取消</Button>
|
||||||
<Button type="primary" className='m-ant-btn' onClick={() => {
|
<Button type="primary" className='m-ant-btn' onClick={() => {
|
||||||
if (checkedList.length) {
|
if (checkedList.length) {
|
||||||
PostRoomInvite(state.roomId, checkedList.map((item: any) => item.id))
|
let userInfo = JSON.parse(storage.getItem('user') as string)
|
||||||
setIsInvitingPersonnelModal(false)
|
let me = checkedList.find((item: any) => item.id === userInfo.uid)
|
||||||
|
if (me) {
|
||||||
|
message.error('您不能邀请自己')
|
||||||
|
} else {
|
||||||
|
PostRoomInvite(state.roomId, checkedList.map((item: any) => item.id)).then(res => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
message.success('邀请成功')
|
||||||
|
setIsInvitingPersonnelModal(false)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
message.error('请选择人员')
|
message.error('请选择人员')
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,10 @@ const JoinMeetingModal = forwardRef((props: any, ref: any) => {
|
||||||
<span>拒绝</span>
|
<span>拒绝</span>
|
||||||
</div>
|
</div>
|
||||||
<div onClick={() => {
|
<div onClick={() => {
|
||||||
|
if (location.hash.indexOf('/meeting') !== -1) {
|
||||||
|
setIsJoinMeetingModal(false)
|
||||||
|
return message.error('您已经在房间中了,请退出房间重试。')
|
||||||
|
}
|
||||||
isGetCheckoutRoomNum(info.roomNum, (bool: boolean) => {
|
isGetCheckoutRoomNum(info.roomNum, (bool: boolean) => {
|
||||||
if (bool) {
|
if (bool) {
|
||||||
getRoomRtcToken(info.roomNum, (token: string) => {
|
getRoomRtcToken(info.roomNum, (token: string) => {
|
||||||
|
|
|
||||||
|
|
@ -638,7 +638,7 @@ const Meeting: React.FC = () => {
|
||||||
}
|
}
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className={`${styles.meetingUserListFooter} drag`}>
|
<div className={`${styles.meetingUserListFooter} drag`} onClick={() => invitingPersonnelRef.current.changeInvitingPersonnelModal()}>
|
||||||
<div>邀请</div>
|
<div>邀请</div>
|
||||||
<div onClick={() => postOpenMicr(false, true)}>全员静音</div>
|
<div onClick={() => postOpenMicr(false, true)}>全员静音</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -17,12 +17,14 @@ export const startSignalr = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
export const onInvitation = (callBack: Function) => {
|
export const onInvitation = (callBack: Function) => {
|
||||||
connection.on("Invitation", (roomNum: string, roomName: string, InviterName: string) => {
|
if (connection) {
|
||||||
callBack({
|
connection.on("Invitation", (roomNum: string, roomName: string, InviterName: string) => {
|
||||||
key: 'Invitation',
|
callBack({
|
||||||
roomNum, roomName, InviterName
|
key: 'Invitation',
|
||||||
})
|
roomNum, roomName, InviterName
|
||||||
});
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
export const onSignalr = (callBack: Function) => {
|
export const onSignalr = (callBack: Function) => {
|
||||||
if (connection) {
|
if (connection) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue