mirror of
https://github.com/PlayEdu/h5.git
synced 2025-07-24 03:19:43 +08:00
首页、最近学习页面重构代码
This commit is contained in:
parent
cd93d27e06
commit
fa47b63769
@ -12,13 +12,17 @@ type LocalUserLearnHourRecordModel = {
|
|||||||
[key: number]: UserLearnHourRecordModel;
|
[key: number]: UserLearnHourRecordModel;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type LocalUserLearnHourCountModel = {
|
||||||
|
[key: number]: number;
|
||||||
|
};
|
||||||
|
|
||||||
const IndexPage = () => {
|
const IndexPage = () => {
|
||||||
const ref = useRef<DropdownRef>(null);
|
const ref = useRef<DropdownRef>(null);
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const result = new URLSearchParams(useLocation().search);
|
const result = new URLSearchParams(useLocation().search);
|
||||||
const [loading, setLoading] = useState<boolean>(false);
|
const [loading, setLoading] = useState<boolean>(false);
|
||||||
const [tabKey, setTabKey] = useState(result.get("tab") || "0");
|
const [tabKey, setTabKey] = useState(result.get("tab") || "0");
|
||||||
const [coursesList, setCoursesList] = useState<any>([]);
|
const [coursesList, setCoursesList] = useState<CourseModel[]>([]);
|
||||||
const [categories, setCategories] = useState<any>([]);
|
const [categories, setCategories] = useState<any>([]);
|
||||||
const [categoryId, setCategoryId] = useState<number>(
|
const [categoryId, setCategoryId] = useState<number>(
|
||||||
Number(result.get("cid") || 0)
|
Number(result.get("cid") || 0)
|
||||||
@ -28,12 +32,12 @@ const IndexPage = () => {
|
|||||||
);
|
);
|
||||||
const [learnCourseRecords, setLearnCourseRecords] =
|
const [learnCourseRecords, setLearnCourseRecords] =
|
||||||
useState<LocalUserLearnHourRecordModel>({});
|
useState<LocalUserLearnHourRecordModel>({});
|
||||||
const [learnCourseHourCount, setLearnCourseHourCount] = useState<any>({});
|
const [learnCourseHourCount, setLearnCourseHourCount] =
|
||||||
|
useState<LocalUserLearnHourCountModel>({});
|
||||||
const systemConfig = useSelector((state: any) => state.systemConfig.value);
|
const systemConfig = useSelector((state: any) => state.systemConfig.value);
|
||||||
const currentDepId = useSelector(
|
const currentDepId = useSelector(
|
||||||
(state: any) => state.loginUser.value.currentDepId
|
(state: any) => state.loginUser.value.currentDepId
|
||||||
);
|
);
|
||||||
|
|
||||||
const items = [
|
const items = [
|
||||||
{
|
{
|
||||||
key: "0",
|
key: "0",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user