1
This commit is contained in:
parent
0da9ba434d
commit
97409d61a9
@ -7,13 +7,23 @@ const EnergyCostRealtime = () => {
|
|||||||
const [isPage1, setIsPage1] = useState(false);
|
const [isPage1, setIsPage1] = useState(false);
|
||||||
const energyInfo = useSelector((state) => state.energy?.info);
|
const energyInfo = useSelector((state) => state.energy?.info);
|
||||||
|
|
||||||
function handleClick() {
|
// function handleClick() {
|
||||||
setIsPage1((pre) => !pre);
|
// setIsPage1((pre) => !pre);
|
||||||
|
// }
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const timer = setInterval(() => {
|
||||||
|
setIsPage1(pre => !pre);
|
||||||
|
}, 10000);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
clearInterval(timer);
|
||||||
}
|
}
|
||||||
|
}, []);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Arrow key="left" direction="left" onClick={handleClick} />
|
{/* <Arrow key="left" direction="left" onClick={handleClick} />
|
||||||
<Arrow key="right" direction="right" onClick={handleClick} />
|
<Arrow key="right" direction="right" onClick={handleClick} /> */}
|
||||||
{isPage1 && (
|
{isPage1 && (
|
||||||
<div className={`${cls.cost__info} flex`}>
|
<div className={`${cls.cost__info} flex`}>
|
||||||
<div className={`${cls.info__item_groups_col1}`}>
|
<div className={`${cls.info__item_groups_col1}`}>
|
||||||
|
@ -8,9 +8,13 @@ function Energy(props) {
|
|||||||
const energyInfo = useSelector((state) => state.energy?.info);
|
const energyInfo = useSelector((state) => state.energy?.info);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setInterval(() => {
|
const timer = setInterval(() => {
|
||||||
setIsPage1((pre) => !pre);
|
setIsPage1((pre) => !pre);
|
||||||
}, 3000);
|
}, 10000);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
clearInterval(timer);
|
||||||
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -28,5 +28,5 @@
|
|||||||
|
|
||||||
.infoText > span:last-child {
|
.infoText > span:last-child {
|
||||||
color: #00FFF7;
|
color: #00FFF7;
|
||||||
font-size: 28px;
|
font-size: 24px;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user