This commit is contained in:
lb 2024-01-25 16:36:12 +08:00
父節點 0da9ba434d
當前提交 97409d61a9
共有 3 個檔案被更改,包括 22 行新增8 行删除

查看文件

@ -7,13 +7,23 @@ const EnergyCostRealtime = () => {
const [isPage1, setIsPage1] = useState(false);
const energyInfo = useSelector((state) => state.energy?.info);
function handleClick() {
setIsPage1((pre) => !pre);
}
// function handleClick() {
// setIsPage1((pre) => !pre);
// }
useEffect(() => {
const timer = setInterval(() => {
setIsPage1(pre => !pre);
}, 10000);
return () => {
clearInterval(timer);
}
}, []);
return (
<>
<Arrow key="left" direction="left" onClick={handleClick} />
<Arrow key="right" direction="right" onClick={handleClick} />
{/* <Arrow key="left" direction="left" onClick={handleClick} />
<Arrow key="right" direction="right" onClick={handleClick} /> */}
{isPage1 && (
<div className={`${cls.cost__info} flex`}>
<div className={`${cls.info__item_groups_col1}`}>

查看文件

@ -8,9 +8,13 @@ function Energy(props) {
const energyInfo = useSelector((state) => state.energy?.info);
useEffect(() => {
setInterval(() => {
const timer = setInterval(() => {
setIsPage1((pre) => !pre);
}, 3000);
}, 10000);
return () => {
clearInterval(timer);
}
}, []);
return (

查看文件

@ -28,5 +28,5 @@
.infoText > span:last-child {
color: #00FFF7;
font-size: 28px;
font-size: 24px;
}