yangjie #22

Merged
yangqiang merged 99 commits from yangjie into master 2024-10-22 16:11:46 +08:00
5 changed files with 27 additions and 74 deletions
Showing only changes of commit a32273eaae - Show all commits

View File

@ -437,7 +437,7 @@ function windowOperation(config) {
break; break;
case 'currentSpeakUserWindow': case 'currentSpeakUserWindow':
x = width - child.getSize()[0]; x = width - child.getSize()[0];
child.setPosition(x - 40, 250); child.setPosition(x - 40, 40);
break; break;
} }
} }
@ -450,8 +450,5 @@ function mainWindowCenter() {
} }
// 主窗口隐藏 // 主窗口隐藏
function mainWindowHide() { function mainWindowHide() {
const display = screen.getDisplayMatching({ ...mainWindow.getBounds() }); mainWindow.setPosition(-999999, -999999);
const { width, height } = display.size
x = width - mainWindow.getSize()[0];
mainWindow.setPosition(x - 40, 40);
} }

View File

@ -11,33 +11,27 @@
max-height: 80%; max-height: 80%;
padding: 4px; padding: 4px;
box-sizing: border-box; box-sizing: border-box;
display: flex;
flex-direction: column-reverse;
.chatSmallWindowContentLeft { .chatSmallWindowContentLeft {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: flex-start; align-items: flex-start;
>div:nth-child(1) { >div {
display: flex; background-color: #5574f25d;
align-items: center;
>span {
font-size: 14px;
color: black; color: black;
margin-left: 4px;
}
>div {}
}
>div:nth-child(2) {
background-color: #5575F2;
color: #F3F3F5;
padding: 4px; padding: 4px;
box-sizing: border-box; box-sizing: border-box;
border-radius: 0 15px 15px 15px; border-radius: 0 15px 15px 15px;
margin: 0 0 10px 40px; margin: 0 0 10px 0;
font-size: 12px; font-size: 12px;
display: flex;
>span:nth-child(1) {
white-space: nowrap;
}
} }
} }
@ -46,29 +40,20 @@
flex-direction: column; flex-direction: column;
align-items: flex-end; align-items: flex-end;
>div:nth-child(1) {
display: flex;
align-items: center;
flex-direction: row-reverse;
>span {
font-size: 14px;
color: black;
}
>div { >div {
margin-left: 4px; background-color: #464e6b55;
} color: black;
}
>div:nth-child(2) {
background-color: #464E6B;
color: #F3F3F5;
padding: 4px; padding: 4px;
box-sizing: border-box; box-sizing: border-box;
border-radius: 15px 0 15px 15px; border-radius: 15px 0 15px 15px;
margin: 0 40px 10px 0; margin: 0 0 10px 0;
font-size: 14px; font-size: 14px;
display: flex;
flex-direction: row-reverse;
>span:nth-child(1) {
white-space: nowrap;
}
} }
} }
} }

View File

@ -1,7 +1,6 @@
import styles from '@/page/Meeting/ChatSmallWindow/index.module.scss' import styles from '@/page/Meeting/ChatSmallWindow/index.module.scss'
import { Input } from 'antd'; import { Input } from 'antd';
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import Avatar from '@/components/Avatar';
import { storage } from '@/utils'; import { storage } from '@/utils';
const ChatSmallWindow: React.FC = () => { const ChatSmallWindow: React.FC = () => {
const [inputValue, setInputValue] = useState<string>('') const [inputValue, setInputValue] = useState<string>('')
@ -13,7 +12,7 @@ const ChatSmallWindow: React.FC = () => {
const { type, chatList } = event.data; const { type, chatList } = event.data;
switch (type) { switch (type) {
case 'chatList': case 'chatList':
setChatLists(chatList) setChatLists(chatList.reverse())
setTimeout(() => { setTimeout(() => {
const chatSmallWindowView = document.getElementById('chatSmallWindowView') as HTMLElement; const chatSmallWindowView = document.getElementById('chatSmallWindowView') as HTMLElement;
if (chatSmallWindowView) { if (chatSmallWindowView) {
@ -33,10 +32,10 @@ const ChatSmallWindow: React.FC = () => {
{chatLists.map((item: any) => {chatLists.map((item: any) =>
<div className={`${item.uid !== userInfo.uid ? styles.chatSmallWindowContentLeft : styles.chatSmallWindowContentRight}`}> <div className={`${item.uid !== userInfo.uid ? styles.chatSmallWindowContentLeft : styles.chatSmallWindowContentRight}`}>
<div> <div>
<div><Avatar name={item.userName} /></div>
<span>{item.userName}</span> <span>{item.userName}</span>
<span></span>
<span>{item.message}</span>
</div> </div>
<div>{item.message}</div>
</div> </div>
)} )}
</div> </div>

View File

@ -94,17 +94,6 @@
background-color: #1F2022; background-color: #1F2022;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
position: relative;
.meetingAbsolute {
position: absolute;
width: 100%;
height: 100%;
background-color: #1F2022;
left: 0;
top: 0;
z-index: 3000;
}
.meetingHeader { .meetingHeader {
display: flex; display: flex;

View File

@ -1445,24 +1445,11 @@ const Meeting: React.FC = () => {
}) })
window.electron.createChildWindow({ window.electron.createChildWindow({
url: location.origin + `/#/currentSpeakUserWindow`, url: location.origin + `/#/currentSpeakUserWindow`,
width: 350, width: 200,
height: 30, height: 30,
key: 'currentSpeakUserWindow', key: 'currentSpeakUserWindow',
}) })
setKeyOpenChildWindow('shareScreenWindow', true) 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 { } else {
message.error('请选择应用!') message.error('请选择应用!')
@ -1503,7 +1490,6 @@ const Meeting: React.FC = () => {
const stopScreenCapture = async (): Promise<void> => { const stopScreenCapture = async (): Promise<void> => {
const footerListTemplate = [...footerList] const footerListTemplate = [...footerList]
await agora.leaveChannelEx(userInfo.screenShareId) await agora.leaveChannelEx(userInfo.screenShareId)
await agora.destroyRendererByConfig(Number(userInfo.screenShareId), state.channelId)
agora.stopScreenCapture() agora.stopScreenCapture()
footerListTemplate[1][0].title = '共享屏幕' footerListTemplate[1][0].title = '共享屏幕'
setFooterList(footerListTemplate) setFooterList(footerListTemplate)
@ -1857,9 +1843,6 @@ const Meeting: React.FC = () => {
return ( return (
<> <>
<div className={styles.meeting}> <div className={styles.meeting}>
{isShare == user.screenShareId ? <div className={styles.meetingAbsolute} id='meetingAbsoluteVideo'>
</div> : null}
{contextHolder} {contextHolder}
<div className={styles.meetingHeader}> <div className={styles.meetingHeader}>
<div> <div>