消息完成
This commit is contained in:
parent
961a64ef6c
commit
3fb0907a68
|
|
@ -148,10 +148,7 @@ const Meeting: React.FC = () => {
|
|||
|
||||
useEffect(() => {
|
||||
onSignalr((item: any) => {
|
||||
console.log(item);
|
||||
const newChatList = [...chatList]
|
||||
newChatList.push(item)
|
||||
setChatList(newChatList)
|
||||
setChatList((newChatList: any) => [...newChatList, item])
|
||||
})
|
||||
}, [])
|
||||
// 操作按钮
|
||||
|
|
@ -423,11 +420,20 @@ const Meeting: React.FC = () => {
|
|||
setTextMsg(e.target.value)
|
||||
}}></Input.TextArea>
|
||||
<Button type="primary" className='m-ant-btn' style={{ flexShrink: 0, marginTop: '4px' }} onClick={() => {
|
||||
onInvoke('sendChannelMsg', {
|
||||
roomNum: state.channelId,
|
||||
msg: textMsg,
|
||||
})
|
||||
setTextMsg('')
|
||||
if (textMsg) {
|
||||
onInvoke('sendChannelMsg', {
|
||||
roomNum: state.channelId,
|
||||
msg: textMsg,
|
||||
})
|
||||
setChatList((newChatList: any) => [...newChatList, {
|
||||
uid: state.uid,
|
||||
userName: state.userName,
|
||||
message: textMsg,
|
||||
}])
|
||||
setTextMsg('')
|
||||
} else {
|
||||
message.success('请输入内容!')
|
||||
}
|
||||
}}>发送</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue