mirror of
https://github.com/PlayEdu/h5.git
synced 2025-06-28 20:52:44 +08:00
首页骨架屏
This commit is contained in:
parent
460517c19d
commit
aa63bff8ca
@ -1,5 +1,5 @@
|
|||||||
import { useEffect, useRef, useState } from "react";
|
import { useEffect, useRef, useState } from "react";
|
||||||
import { Dropdown, SpinLoading, Tabs } from "antd-mobile";
|
import { Dropdown, Skeleton, Tabs } from "antd-mobile";
|
||||||
import { DropdownRef } from "antd-mobile/es/components/dropdown";
|
import { DropdownRef } from "antd-mobile/es/components/dropdown";
|
||||||
import { user } from "../../api/index";
|
import { user } from "../../api/index";
|
||||||
import styles from "./index.module.scss";
|
import styles from "./index.module.scss";
|
||||||
@ -226,13 +226,42 @@ const IndexPage = () => {
|
|||||||
</Dropdown>
|
</Dropdown>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles["list-box"]}>
|
<div className={styles["list-box"]}>
|
||||||
{loading && (
|
{loading &&
|
||||||
<div
|
Array.from({ length: 2 }).map((_, i) => (
|
||||||
style={{ width: "100%", display: "flex", justifyContent: "center" }}
|
<div
|
||||||
>
|
style={{
|
||||||
<SpinLoading color="primary" />
|
width: "100%",
|
||||||
</div>
|
height: 75,
|
||||||
)}
|
display: "flex",
|
||||||
|
alignItems: "center",
|
||||||
|
marginBottom: 30,
|
||||||
|
marginTop: 30,
|
||||||
|
}}
|
||||||
|
key={i}
|
||||||
|
>
|
||||||
|
<Skeleton
|
||||||
|
animated
|
||||||
|
style={{
|
||||||
|
width: 100,
|
||||||
|
height: 75,
|
||||||
|
borderRadius: 8,
|
||||||
|
marginRight: 15,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
flex: 1,
|
||||||
|
height: 75,
|
||||||
|
display: "flex",
|
||||||
|
flexDirection: "column",
|
||||||
|
justifyContent: "space-between",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Skeleton animated style={{ width: "100%", height: 21 }} />
|
||||||
|
<Skeleton animated style={{ width: "100%", height: 24 }} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
{!loading && coursesList.length === 0 && <Empty></Empty>}
|
{!loading && coursesList.length === 0 && <Empty></Empty>}
|
||||||
{!loading && coursesList.length > 0 && (
|
{!loading && coursesList.length > 0 && (
|
||||||
<>
|
<>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user