From a32273eaae04f6f0992742499eb48a4633484869 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Tue, 15 Oct 2024 13:52:12 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AA=97=E5=8F=A3=E4=BD=8D=E7=BD=AE=E8=B0=83?= =?UTF-8?q?=E6=95=B4&=E6=A0=B7=E5=BC=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 7 +-- .../Meeting/ChatSmallWindow/index.module.scss | 57 +++++++------------ src/page/Meeting/ChatSmallWindow/index.tsx | 7 +-- src/page/Meeting/index.module.scss | 11 ---- src/page/Meeting/index.tsx | 19 +------ 5 files changed, 27 insertions(+), 74 deletions(-) diff --git a/main.js b/main.js index b0670dc..271c5f0 100644 --- a/main.js +++ b/main.js @@ -437,7 +437,7 @@ function windowOperation(config) { break; case 'currentSpeakUserWindow': x = width - child.getSize()[0]; - child.setPosition(x - 40, 250); + child.setPosition(x - 40, 40); break; } } @@ -450,8 +450,5 @@ function mainWindowCenter() { } // 主窗口隐藏 function mainWindowHide() { - const display = screen.getDisplayMatching({ ...mainWindow.getBounds() }); - const { width, height } = display.size - x = width - mainWindow.getSize()[0]; - mainWindow.setPosition(x - 40, 40); + mainWindow.setPosition(-999999, -999999); } \ No newline at end of file diff --git a/src/page/Meeting/ChatSmallWindow/index.module.scss b/src/page/Meeting/ChatSmallWindow/index.module.scss index 5e8896c..e386a8c 100644 --- a/src/page/Meeting/ChatSmallWindow/index.module.scss +++ b/src/page/Meeting/ChatSmallWindow/index.module.scss @@ -11,33 +11,27 @@ max-height: 80%; padding: 4px; box-sizing: border-box; + display: flex; + flex-direction: column-reverse; .chatSmallWindowContentLeft { display: flex; flex-direction: column; align-items: flex-start; - >div:nth-child(1) { - display: flex; - align-items: center; - - >span { - font-size: 14px; - color: black; - margin-left: 4px; - } - - >div {} - } - - >div:nth-child(2) { - background-color: #5575F2; - color: #F3F3F5; + >div { + background-color: #5574f25d; + color: black; padding: 4px; box-sizing: border-box; border-radius: 0 15px 15px 15px; - margin: 0 0 10px 40px; + margin: 0 0 10px 0; font-size: 12px; + display: flex; + + >span:nth-child(1) { + white-space: nowrap; + } } } @@ -46,29 +40,20 @@ flex-direction: column; align-items: flex-end; - >div:nth-child(1) { - display: flex; - align-items: center; - flex-direction: row-reverse; - - >span { - font-size: 14px; - color: black; - } - - >div { - margin-left: 4px; - } - } - - >div:nth-child(2) { - background-color: #464E6B; - color: #F3F3F5; + >div { + background-color: #464e6b55; + color: black; padding: 4px; box-sizing: border-box; border-radius: 15px 0 15px 15px; - margin: 0 40px 10px 0; + margin: 0 0 10px 0; font-size: 14px; + display: flex; + flex-direction: row-reverse; + + >span:nth-child(1) { + white-space: nowrap; + } } } } diff --git a/src/page/Meeting/ChatSmallWindow/index.tsx b/src/page/Meeting/ChatSmallWindow/index.tsx index 2d2c47b..1e99b01 100644 --- a/src/page/Meeting/ChatSmallWindow/index.tsx +++ b/src/page/Meeting/ChatSmallWindow/index.tsx @@ -1,7 +1,6 @@ import styles from '@/page/Meeting/ChatSmallWindow/index.module.scss' import { Input } from 'antd'; import { useEffect, useState } from "react"; -import Avatar from '@/components/Avatar'; import { storage } from '@/utils'; const ChatSmallWindow: React.FC = () => { const [inputValue, setInputValue] = useState('') @@ -13,7 +12,7 @@ const ChatSmallWindow: React.FC = () => { const { type, chatList } = event.data; switch (type) { case 'chatList': - setChatLists(chatList) + setChatLists(chatList.reverse()) setTimeout(() => { const chatSmallWindowView = document.getElementById('chatSmallWindowView') as HTMLElement; if (chatSmallWindowView) { @@ -33,10 +32,10 @@ const ChatSmallWindow: React.FC = () => { {chatLists.map((item: any) =>
-
{item.userName} + + {item.message}
-
{item.message}
)} diff --git a/src/page/Meeting/index.module.scss b/src/page/Meeting/index.module.scss index 69586e3..262c256 100644 --- a/src/page/Meeting/index.module.scss +++ b/src/page/Meeting/index.module.scss @@ -94,17 +94,6 @@ background-color: #1F2022; display: flex; flex-direction: column; - position: relative; - - .meetingAbsolute { - position: absolute; - width: 100%; - height: 100%; - background-color: #1F2022; - left: 0; - top: 0; - z-index: 3000; - } .meetingHeader { display: flex; diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index 12f095a..6984da7 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -1445,24 +1445,11 @@ const Meeting: React.FC = () => { }) window.electron.createChildWindow({ url: location.origin + `/#/currentSpeakUserWindow`, - width: 350, + width: 200, height: 30, key: 'currentSpeakUserWindow', }) setKeyOpenChildWindow('shareScreenWindow', true) - window.electron.setMainWindowSize({ - width: 350, - height: 200, - }) - setTimeout(() => { - agora.setupLocalVideo({ - uid: Number(user.screenShareId), - view: document.getElementById(`meetingAbsoluteVideo`) as HTMLElement, - channelId: state.channelId, - sourceType: VideoSourceType.VideoSourceScreen, - type: true - }) - }, 1500); } } else { message.error('请选择应用!') @@ -1503,7 +1490,6 @@ const Meeting: React.FC = () => { const stopScreenCapture = async (): Promise => { const footerListTemplate = [...footerList] await agora.leaveChannelEx(userInfo.screenShareId) - await agora.destroyRendererByConfig(Number(userInfo.screenShareId), state.channelId) agora.stopScreenCapture() footerListTemplate[1][0].title = '共享屏幕' setFooterList(footerListTemplate) @@ -1857,9 +1843,6 @@ const Meeting: React.FC = () => { return ( <>
- {isShare == user.screenShareId ?
- -
: null} {contextHolder}