+
+ {chatLists.map((item: any) =>
+
+ )}
+
+
+ {
+ setInputValue(e.target.value)
+ }}
+ onPressEnter={() => {
+ if (inputValue) {
+ channel.postMessage({
+ type: 'chatSmallWindowSendChannelMsg',
+ chatSmallWindowSendChannelMsg: {
+ msg: inputValue,
+ }
+ });
+ setInputValue('')
+ }
+ }}
+ suffix={
+ {
+ if (inputValue) {
+ channel.postMessage({
+ type: 'chatSmallWindowSendChannelMsg',
+ chatSmallWindowSendChannelMsg: {
+ msg: inputValue,
+ }
+ });
+ setInputValue('')
+ }
+ }}
+ >发送
+
+ }
+ />
+
+
+ >
+ )
+}
+
+export default ChatSmallWindow
diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx
index 56bbaec..345fab2 100644
--- a/src/page/Meeting/index.tsx
+++ b/src/page/Meeting/index.tsx
@@ -195,6 +195,7 @@ const Meeting: React.FC = () => {
window.electron.setViewStatus('maximize')
}
})
+ setKeyOpenChildWindow('shareScreenWindow', false)
setMeetingMode('StandardMode');
agoraInit()
storage.setItem('noViewChatList', 0)
@@ -210,7 +211,8 @@ const Meeting: React.FC = () => {
userListWindowDeleteRoomManager,
userListWindowPostRoomManager,
userListWindowGetRoomKickout,
- shareScreenWindowEquipmentManagement
+ shareScreenWindowEquipmentManagement,
+ chatSmallWindowSendChannelMsg
} = event.data;
switch (type) {
case 'shareScreenWindowClose':
@@ -273,6 +275,9 @@ const Meeting: React.FC = () => {
equipmentManagement(shareScreenWindowEquipmentManagement.uid, shareScreenWindowEquipmentManagement.userName)
window.electron.mainWindowCenter()
break;
+ case 'chatSmallWindowSendChannelMsg':
+ sendMsg(chatSmallWindowSendChannelMsg.msg)
+ break;
}
}
time = setInterval(() => {
@@ -342,6 +347,15 @@ const Meeting: React.FC = () => {
}
}, [currentEffective]);
+ useEffect(() => {
+ if (chatList.length) {
+ channel.postMessage({
+ type: 'chatList',
+ chatList,
+ });
+ }
+ }, [chatList]);
+
useEffect(() => {
let currentVideoUserItem = roomUserList.find((item: any) => item.uid === currentVideoId || item.screenShareId === currentVideoId)
if (currentVideoUserItem) {
@@ -1355,6 +1369,12 @@ const Meeting: React.FC = () => {
height: 70,
key: 'shareScreenWindow',
})
+ window.electron.createChildWindow({
+ url: location.origin + `/#/chatSmallWindow`,
+ width: 200,
+ height: 300,
+ key: 'chatSmallWindow',
+ })
setKeyOpenChildWindow('shareScreenWindow', true)
}
} else {
@@ -1458,8 +1478,8 @@ const Meeting: React.FC = () => {
msg: msg,
})
setChatList((newChatList: any) => [...newChatList, {
- uid: user.uid,
- userName: user.userName,
+ uid: userInfo.uid,
+ userName: userInfo.userName,
message: msg,
timestamp: +new Date()
}])