From d860e6d920b0cf70f2d0451800d32bf66434ce41 Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Tue, 20 Aug 2024 10:20:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Meeting/index.tsx | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index ad9e919..93331c5 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -3,7 +3,7 @@ import { useEffect, useRef, useState } from "react"; import Operation from '@/components/Operation'; import SpeakerModeModal from '@/components/SpeakerModeModal'; import InvitingPersonnelModal from '@/components/InvitingPersonnelModal'; -import { Button, Input, Popover, Modal, Checkbox, message, Popconfirm } from "antd"; +import { Button, Input, Popover, Modal, Checkbox, message, Popconfirm, notification } from "antd"; import { SearchOutlined, EllipsisOutlined, ExclamationCircleFilled } from '@ant-design/icons'; import { useLocation, useNavigate } from 'react-router-dom'; import { thumbImageBufferToBase64 } from '@/utils/package/base64' @@ -130,6 +130,11 @@ const Meeting: React.FC = () => { '我要发言', ]) const [roomUserItem, setRoomUserItem] = useState(null) + const [api, contextHolder] = notification.useNotification({ + stack: { + threshold: 3 + } + }); let userInfo = JSON.parse(storage.getItem('user') as string) const msgTips = '您不是管理员或发言人,无法开启此功能!' useEffect(() => { @@ -206,7 +211,6 @@ const Meeting: React.FC = () => { time = setInterval(() => { setCurrentSeconds(currentSeconds++) }, 1000) - return () => { window.removeEventListener('customStorageChange', handleCustomStorageChange); window.removeEventListener('online', handleNetworkChange); @@ -251,6 +255,17 @@ const Meeting: React.FC = () => { setNoViewChatList(storageNoViewChatList) } setChatList((newChatList: any) => [...newChatList, item]) + setStatusList((res: any) => { + if (!res.userChatList) { + api.open({ + message: '消息', + description: item.message, + duration: 3, + showProgress: true, + }); + } + return res + }) chatScrollBotton() break; // 扩展操作 @@ -963,9 +978,8 @@ const Meeting: React.FC = () => { } return ( <> -
{ - - }}> +
+ {contextHolder}