增加缺省页组件

This commit is contained in:
禺狨 2023-03-28 10:17:43 +08:00
parent 2e8379f46c
commit 8a52c6cbe9
6 changed files with 33 additions and 11 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

@ -0,0 +1,4 @@
.img-box {
width: 100%;
height: auto;
}

View 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>
);
};

View File

@ -4,3 +4,4 @@ export * from "./no-header";
export * from "./header"; export * from "./header";
export * from "./change-password"; export * from "./change-password";
export * from "./user-info" export * from "./user-info"
export * from "./empty"

View File

@ -1,10 +1,11 @@
import { useEffect, useState } from "react"; 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 type { TabsProps } from "antd";
import { user } from "../../api/index"; import { user } from "../../api/index";
import styles from "./index.module.scss"; import styles from "./index.module.scss";
import { useSelector } from "react-redux"; import { useSelector } from "react-redux";
import { CoursesModel } from "./compenents/courses-model"; import { CoursesModel } from "./compenents/courses-model";
import { Empty } from "../../compenents";
import myLesoon from "../../assets/images/commen/icon-mylesoon.png"; import myLesoon from "../../assets/images/commen/icon-mylesoon.png";
import studyTime from "../../assets/images/commen/icon-studytime.png"; import studyTime from "../../assets/images/commen/icon-studytime.png";
import iconRoute from "../../assets/images/commen/icon-route.png"; import iconRoute from "../../assets/images/commen/icon-route.png";
@ -249,7 +250,7 @@ const IndexPage = () => {
}} }}
> >
<Col span={24}> <Col span={24}>
<Empty description="暂无课程" /> <Empty />
</Col> </Col>
</Row> </Row>
)} )}

View File

@ -1,7 +1,8 @@
import React, { useState, useEffect } from "react"; import React, { useState, useEffect } from "react";
import styles from "./index.module.scss"; import styles from "./index.module.scss";
import { course } from "../../api/index"; 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 mediaIcon from "../../assets/images/commen/icon-medal.png";
import { useNavigate } from "react-router-dom"; import { useNavigate } from "react-router-dom";
@ -25,19 +26,22 @@ const LatestLearnPage = () => {
return ( return (
<div> <div>
<div className={styles["content"]}> <div className={styles["content"]}>
<Row style={{ width: 1200 }}>
{loading && ( {loading && (
<Row style={{ width: 1200 }}>
<div className="float-left d-j-flex mt-50"> <div className="float-left d-j-flex mt-50">
<Spin size="large" /> <Spin size="large" />
</div> </div>
)}
{courses.length === 0 && (
<Col span={24}>
<Empty description="暂无记录" />
</Col>
)}
</Row> </Row>
{courses.length > 0 && )}
{!loading && courses.length === 0 && (
<Row style={{ width: 1200 }}>
<Col span={24}>
<Empty />
</Col>
</Row>
)}
{!loading &&
courses.length > 0 &&
courses.map((item: any) => ( courses.map((item: any) => (
<div <div
key={item.course.id} key={item.course.id}