import "./index.less"; import Player from "../../components/Player"; import { useMount } from "../../hook"; import { Select, Message, Space, Tooltip, Dropdown, Button, Menu, } from "@arco-design/web-react"; import BsCard from "../../components/Card"; import TimeScroll, { IOnScrollParam } from "../../components/TimeScroll"; import Tab20Regular from "@ricons/fluent/Tab20Regular"; import Table20Regular from "@ricons/fluent/Table20Regular"; import Filter20Regular from "@ricons/fluent/Filter20Regular"; import { useRef, useState } from "react"; import { recommendListDefault, courseTimeListDefault } from "./mock"; import { Icon } from "@ricons/utils"; export default function Index() { const scrollContainerRef = useRef(null); const dropList = ( 全部 最新的 ); const [actions, setActions] = useState([ { key: "tab", icon: , active: false, tip: "单格排列", }, { key: "table", icon: , active: true, tip: "缩略", }, ]); const [recommendList, setRecommendList] = useState(recommendListDefault); const [courseTimeList, setCourseTimeList] = useState(courseTimeListDefault); const onClickActionItem = (action: any) => { setActions((p) => p.map((a) => ({ ...a, active: a.key === action.key }))); }; const onTimeScroll = (p: IOnScrollParam) => { const { top, height } = p; //左侧区域高度 const { scrollHeight, clientHeight } = scrollContainerRef.current!; const ratio = (scrollHeight - clientHeight) / height; scrollContainerRef.current!.scrollTop = top * ratio; }; return (
{recommendList.map((item, index) => ( ))}
{actions.map((action) => (
{courseTimeList.map((item, index) => (
{item.year}年{item.month}月
{item.data.length} 个视频
{item.data.map((d: any) => ( ))}
))}
); }