mirror of
https://github.com/PlayEdu/frontend.git
synced 2025-06-21 13:32:44 +08:00
增加缺省页组件
This commit is contained in:
parent
2e8379f46c
commit
8a52c6cbe9
BIN
src/assets/images/commen/empty.png
Normal file
BIN
src/assets/images/commen/empty.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.1 KiB |
4
src/compenents/empty/index.module.scss
Normal file
4
src/compenents/empty/index.module.scss
Normal file
@ -0,0 +1,4 @@
|
||||
.img-box {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
12
src/compenents/empty/index.tsx
Normal file
12
src/compenents/empty/index.tsx
Normal file
@ -0,0 +1,12 @@
|
||||
import styles from "./index.module.scss";
|
||||
import React from "react";
|
||||
import { Image } from "antd";
|
||||
import empty from "../../assets/images/commen/empty.png";
|
||||
|
||||
export const Empty: React.FC = () => {
|
||||
return (
|
||||
<div className={styles["img-box"]}>
|
||||
<Image src={empty} width={400} height={400} preview={false} />
|
||||
</div>
|
||||
);
|
||||
};
|
@ -4,3 +4,4 @@ export * from "./no-header";
|
||||
export * from "./header";
|
||||
export * from "./change-password";
|
||||
export * from "./user-info"
|
||||
export * from "./empty"
|
||||
|
@ -1,10 +1,11 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { Row, Col, Empty, Spin, Image } from "antd";
|
||||
import { Row, Col, Spin, Image } from "antd";
|
||||
import type { TabsProps } from "antd";
|
||||
import { user } from "../../api/index";
|
||||
import styles from "./index.module.scss";
|
||||
import { useSelector } from "react-redux";
|
||||
import { CoursesModel } from "./compenents/courses-model";
|
||||
import { Empty } from "../../compenents";
|
||||
import myLesoon from "../../assets/images/commen/icon-mylesoon.png";
|
||||
import studyTime from "../../assets/images/commen/icon-studytime.png";
|
||||
import iconRoute from "../../assets/images/commen/icon-route.png";
|
||||
@ -249,7 +250,7 @@ const IndexPage = () => {
|
||||
}}
|
||||
>
|
||||
<Col span={24}>
|
||||
<Empty description="暂无课程" />
|
||||
<Empty />
|
||||
</Col>
|
||||
</Row>
|
||||
)}
|
||||
|
@ -1,7 +1,8 @@
|
||||
import React, { useState, useEffect } from "react";
|
||||
import styles from "./index.module.scss";
|
||||
import { course } from "../../api/index";
|
||||
import { Row, Col, Empty, Spin, Image, Progress } from "antd";
|
||||
import { Row, Col, Spin, Image, Progress } from "antd";
|
||||
import { Empty } from "../../compenents";
|
||||
import mediaIcon from "../../assets/images/commen/icon-medal.png";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
|
||||
@ -25,19 +26,22 @@ const LatestLearnPage = () => {
|
||||
return (
|
||||
<div>
|
||||
<div className={styles["content"]}>
|
||||
<Row style={{ width: 1200 }}>
|
||||
{loading && (
|
||||
{loading && (
|
||||
<Row style={{ width: 1200 }}>
|
||||
<div className="float-left d-j-flex mt-50">
|
||||
<Spin size="large" />
|
||||
</div>
|
||||
)}
|
||||
{courses.length === 0 && (
|
||||
</Row>
|
||||
)}
|
||||
{!loading && courses.length === 0 && (
|
||||
<Row style={{ width: 1200 }}>
|
||||
<Col span={24}>
|
||||
<Empty description="暂无记录" />
|
||||
<Empty />
|
||||
</Col>
|
||||
)}
|
||||
</Row>
|
||||
{courses.length > 0 &&
|
||||
</Row>
|
||||
)}
|
||||
{!loading &&
|
||||
courses.length > 0 &&
|
||||
courses.map((item: any) => (
|
||||
<div
|
||||
key={item.course.id}
|
||||
|
Loading…
x
Reference in New Issue
Block a user