选中状态
This commit is contained in:
parent
3cbdaf58ca
commit
cb6a89ac9f
|
|
@ -5,6 +5,7 @@ import { useNavigate } from 'react-router-dom';
|
||||||
import { Button, Input, Modal, Pagination, Empty, message } from "antd";
|
import { Button, Input, Modal, Pagination, Empty, message } from "antd";
|
||||||
import { GetRoom, PostRomm, GetCheckoutRoomNum, GetRoomRtcToken, GetRoomInfo } from '@/api/Home/Index';
|
import { GetRoom, PostRomm, GetCheckoutRoomNum, GetRoomRtcToken, GetRoomInfo } from '@/api/Home/Index';
|
||||||
import ImageUrl from '@/utils/package/imageUrl'
|
import ImageUrl from '@/utils/package/imageUrl'
|
||||||
|
import { storage } from '@/utils';
|
||||||
const Index: React.FC = () => {
|
const Index: React.FC = () => {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const [list, setList] = useState({
|
const [list, setList] = useState({
|
||||||
|
|
@ -21,6 +22,8 @@ const Index: React.FC = () => {
|
||||||
const [joinRoomModal, setJoinRoomModal] = useState(false)
|
const [joinRoomModal, setJoinRoomModal] = useState(false)
|
||||||
const [joinRoomFrom, setJoinRoomFrom] = useState<string>('')
|
const [joinRoomFrom, setJoinRoomFrom] = useState<string>('')
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
// 默认设置为未加入房间防止用户直接关闭
|
||||||
|
storage.setItem('isJoin', false)
|
||||||
getRoomList()
|
getRoomList()
|
||||||
}, [list.pageIndex]);
|
}, [list.pageIndex]);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.active {
|
.active {
|
||||||
border: 1px red solid;
|
border: 1px white solid;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -123,6 +123,7 @@ const Meeting: React.FC = () => {
|
||||||
userid: userInfo.account,
|
userid: userInfo.account,
|
||||||
token: state.token,
|
token: state.token,
|
||||||
})
|
})
|
||||||
|
setCurrentVideoId(userInfo.account)
|
||||||
setUser(userInfo)
|
setUser(userInfo)
|
||||||
setIsInit(false)
|
setIsInit(false)
|
||||||
window.addEventListener('customStorageChange', handleCustomStorageChange);
|
window.addEventListener('customStorageChange', handleCustomStorageChange);
|
||||||
|
|
@ -253,10 +254,14 @@ const Meeting: React.FC = () => {
|
||||||
stupWizardRef.current.changeIsStupWizard()
|
stupWizardRef.current.changeIsStupWizard()
|
||||||
break;
|
break;
|
||||||
case '录制':
|
case '录制':
|
||||||
|
if (currentVideoId === user.account) {
|
||||||
|
message.error('请勿自己录制自己!')
|
||||||
|
} else {
|
||||||
footerListTemplate[itemIndex][rowIndex].title = '录制中'
|
footerListTemplate[itemIndex][rowIndex].title = '录制中'
|
||||||
footerListTemplate[itemIndex][rowIndex].active = true
|
footerListTemplate[itemIndex][rowIndex].active = true
|
||||||
setFooterList(footerListTemplate)
|
setFooterList(footerListTemplate)
|
||||||
agora.startRecording()
|
agora.startRecording()
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case '录制中':
|
case '录制中':
|
||||||
footerListTemplate[itemIndex][rowIndex].title = '录制'
|
footerListTemplate[itemIndex][rowIndex].title = '录制'
|
||||||
|
|
@ -417,7 +422,7 @@ const Meeting: React.FC = () => {
|
||||||
<div className={`${styles.meetingContentSwiper} drag`}>
|
<div className={`${styles.meetingContentSwiper} drag`}>
|
||||||
{roomUserList.map((item: any, index: number) =>
|
{roomUserList.map((item: any, index: number) =>
|
||||||
<div
|
<div
|
||||||
className={styles.meetingContentSwiperCard}
|
className={`${styles.meetingContentSwiperCard} ${user.account === currentVideoId ? styles.active : ''}`}
|
||||||
key={index}
|
key={index}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setCurrentVideoId(item.account)
|
setCurrentVideoId(item.account)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue