diff --git a/web/client/src/sections/fillion/containers/videoCenter.js b/web/client/src/sections/fillion/containers/videoCenter.js index 42ff7e4a..700d3b76 100644 --- a/web/client/src/sections/fillion/containers/videoCenter.js +++ b/web/client/src/sections/fillion/containers/videoCenter.js @@ -15,7 +15,7 @@ function VideoCenter (props) { return (
- +
); } diff --git a/web/client/src/sections/quanju/containers/footer/build/videoMonitor.js b/web/client/src/sections/quanju/containers/footer/build/videoMonitor.js index 979f44af..deeecd13 100644 --- a/web/client/src/sections/quanju/containers/footer/build/videoMonitor.js +++ b/web/client/src/sections/quanju/containers/footer/build/videoMonitor.js @@ -25,12 +25,32 @@ const videoMonitor = (props) => { /> } + useEffect(() => { + const timer = setInterval(() => { + if (pageLeft + 1 < Math.ceil(videoCenterList?.length / 3)) { + setPageLeft(pageLeft + 1) + } else { + setPageLeft(0) + } + }, 1000 * 60 * 5); + return () => clearInterval(timer); + }, [pageLeft]); + + return ( videoCenterList?.length > 0 ?
{ - if (pageLeft > 0) setPageLeft(pageLeft - 1) + if (pageLeft == 0) { + if (Math.ceil(videoCenterList?.length / 3) == 0) { + setPageLeft(0) + } else { + setPageLeft(Math.ceil(videoCenterList?.length / 3) - 1) + } + } else { + setPageLeft(pageLeft - 1) + } }} /> -
+
{videoCenterList?.slice(pageLeft * 3, (pageLeft + 1) * 3)?.map((v, index) => { return
{renderVideo(v, index)} @@ -44,7 +64,11 @@ const videoMonitor = (props) => { })}
{ - if (pageLeft + 1 < Math.ceil(videoCenterList?.length / 3)) setPageLeft(pageLeft + 1) + if (pageLeft + 1 < Math.ceil(videoCenterList?.length / 3)) { + setPageLeft(pageLeft + 1) + } else { + setPageLeft(0) + } }} />