mirror of
https://github.com/PlayEdu/h5.git
synced 2025-07-24 11:19:43 +08:00
学习骨架屏
This commit is contained in:
parent
4c7a11cffa
commit
460517c19d
@ -1,5 +1,5 @@
|
|||||||
import { useState, useEffect } from "react";
|
import { useState, useEffect } from "react";
|
||||||
import { Image, ProgressBar, SpinLoading } from "antd-mobile";
|
import { Image, ProgressBar, Skeleton } from "antd-mobile";
|
||||||
import styles from "./index.module.scss";
|
import styles from "./index.module.scss";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { course } from "../../api/index";
|
import { course } from "../../api/index";
|
||||||
@ -31,13 +31,24 @@ const StudyPage = () => {
|
|||||||
<div className="main-body">
|
<div className="main-body">
|
||||||
<div className={styles["title"]}>最近学习</div>
|
<div className={styles["title"]}>最近学习</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 className={styles["item"]} key={i}>
|
||||||
>
|
<Skeleton
|
||||||
<SpinLoading color="primary" />
|
animated
|
||||||
</div>
|
style={{
|
||||||
)}
|
width: 100,
|
||||||
|
height: 75,
|
||||||
|
borderRadius: 8,
|
||||||
|
marginRight: 15,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<div className={styles["item-info"]}>
|
||||||
|
<Skeleton animated style={{ width: "100%", height: 21 }} />
|
||||||
|
<Skeleton animated style={{ width: "100%", height: 24 }} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
{!loading && courses.length === 0 && <Empty></Empty>}
|
{!loading && courses.length === 0 && <Empty></Empty>}
|
||||||
{/* <div className={styles["label"]}>更早</div> */}
|
{/* <div className={styles["label"]}>更早</div> */}
|
||||||
{!loading &&
|
{!loading &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user