增加缺省页组件

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

View File

@@ -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>
)}

View File

@@ -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}