diff --git a/src/main.scss b/src/main.scss index b2f03c4..e71e598 100644 --- a/src/main.scss +++ b/src/main.scss @@ -32,6 +32,13 @@ code { float: left; height: auto; } + +.float-left { + width: 100%; + height: auto; + float: left; +} + .main-header { position: relative; width: 100%; diff --git a/src/pages/index/index.module.scss b/src/pages/index/index.module.scss index 8ab7721..f66752b 100644 --- a/src/pages/index/index.module.scss +++ b/src/pages/index/index.module.scss @@ -107,7 +107,7 @@ width: 100%; height: auto; box-sizing: border-box; - padding: 96px 20px 55px 20px; + padding: 0px 20px 55px 20px; text-align: left; overflow-x: hidden; overflow-y: auto; diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx index 83d66c9..eec950d 100644 --- a/src/pages/index/index.tsx +++ b/src/pages/index/index.tsx @@ -1,5 +1,6 @@ import { useEffect, useRef, useState } from "react"; -import { Dropdown, Skeleton, Tabs } from "antd-mobile"; +import { Dropdown, PullToRefresh, Skeleton, Tabs } from "antd-mobile"; +import { sleep } from "antd-mobile/es/utils/sleep"; import { DropdownRef } from "antd-mobile/es/components/dropdown"; import { user } from "../../api/index"; import styles from "./index.module.scss"; @@ -71,14 +72,15 @@ const IndexPage = () => { }, []); useEffect(() => { + setLoading(true); if (currentDepId === 0) { + setLoading(false); return; } getData(); }, [currentDepId, categoryId]); const getData = () => { - setLoading(true); user.courses(currentDepId, categoryId).then((res: any) => { const records = res.data.learn_course_records; setLearnCourseRecords(records); @@ -265,61 +267,74 @@ const IndexPage = () => { -