From 175cf8dc0158cff7770527aa2678fde28033fbaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 16 Nov 2019 23:44:50 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=B9=B3=E5=8F=B0=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E4=BD=93=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/common/LoadingSpin.js | 29 ++++++++++++ .../Competitimain/CompetitionsIndex.js | 6 ++- .../courses/coursesHome/CoursesHome.js | 8 ++-- .../react/src/modules/moop_cases/CaseList.js | 16 +++++-- .../react/src/modules/paths/ShixunPathCard.js | 7 +-- .../src/modules/paths/ShixunPathSearch.js | 14 +++++- .../src/modules/tpm/shixuns/ShixunCard.js | 46 ++++++++++--------- 7 files changed, 90 insertions(+), 36 deletions(-) create mode 100644 public/react/src/common/LoadingSpin.js diff --git a/public/react/src/common/LoadingSpin.js b/public/react/src/common/LoadingSpin.js new file mode 100644 index 000000000..80a798906 --- /dev/null +++ b/public/react/src/common/LoadingSpin.js @@ -0,0 +1,29 @@ +import React, { Component } from 'react'; +import {Spin} from 'antd'; +class LoadingSpin extends Component{ + constructor(props) { + super(props) + } + render(){ + const { style } = this.props; + return( +
+ + +
+ ) + } +} +export default LoadingSpin; \ No newline at end of file diff --git a/public/react/src/modules/competitions/Competitimain/CompetitionsIndex.js b/public/react/src/modules/competitions/Competitimain/CompetitionsIndex.js index e747a81e3..5a341726d 100644 --- a/public/react/src/modules/competitions/Competitimain/CompetitionsIndex.js +++ b/public/react/src/modules/competitions/Competitimain/CompetitionsIndex.js @@ -5,6 +5,7 @@ import {getImageUrl} from 'educoder'; import axios from 'axios'; import './Competitionsindex.css'; import NoneData from "../../courses/coursesPublic/NoneData"; +import LoadingSpin from '../../../common/LoadingSpin'; class CompetitionsIndex extends Component{ constructor(props) { @@ -48,6 +49,7 @@ class CompetitionsIndex extends Component{ handleClick = e => { this.setState({ current: e.key, + datas:undefined }); let{category,page}=this.state; this.getdata(e.key,page) @@ -193,7 +195,7 @@ class CompetitionsIndex extends Component{ } />} - {count===undefined?"":count >15 ?
15 ?
:""} { - datas===undefined?"":datas && datas.length===0? :"" + datas===undefined?:datas && datas.length===0? :"" }
diff --git a/public/react/src/modules/courses/coursesHome/CoursesHome.js b/public/react/src/modules/courses/coursesHome/CoursesHome.js index d4e4609f6..56de3ba7f 100644 --- a/public/react/src/modules/courses/coursesHome/CoursesHome.js +++ b/public/react/src/modules/courses/coursesHome/CoursesHome.js @@ -3,6 +3,7 @@ import {getImageUrl} from 'educoder'; import CoursesHomeCard from "./CoursesHomeCard.js" import axios from 'axios'; import {Input,Tooltip} from 'antd'; +import LoadingSpin from '../../../common/LoadingSpin'; import UpgradeModals from '../../modals/UpgradeModals'; import './css/CoursesHome.css'; import Pagination from '@icedesign/base/lib/pagination'; @@ -25,7 +26,8 @@ class CoursesHome extends Component{ changeStatus=(value)=>{ this.setState({ order:value, - page:1 + page:1, + coursesHomelist:undefined }) this.searchcourses(16,1,value,"") @@ -156,8 +158,8 @@ class CoursesHome extends Component{
- + {coursesHomelist===undefined?:} {coursesHomelist===undefined?"":coursesHomelist.courses.length===0?
diff --git a/public/react/src/modules/moop_cases/CaseList.js b/public/react/src/modules/moop_cases/CaseList.js index fe2331d9a..a3d9f8c64 100644 --- a/public/react/src/modules/moop_cases/CaseList.js +++ b/public/react/src/modules/moop_cases/CaseList.js @@ -26,7 +26,7 @@ class CaseList extends Component{ pageSize:20, libraries:undefined, totalCount:undefined, - isSpin:false + isSpin:true } } @@ -51,9 +51,16 @@ class CaseList extends Component{ totalCount:result.data.count, isSpin:false }) - } + }else{ + this.setState({ + isSpin:false + }) + } }).catch((error)=>{ console.log(error); + this.setState({ + isSpin:false + }) }) } @@ -61,7 +68,8 @@ class CaseList extends Component{ changeType = (type) =>{ this.setState({ type, - page:1 + page:1, + isSpin:true }) let { search , page , pageSize } = this.state; this.InitList(type,search,page,pageSize); @@ -141,7 +149,7 @@ class CaseList extends Component{
- + { libraries && libraries.length > 0 && } diff --git a/public/react/src/modules/paths/ShixunPathCard.js b/public/react/src/modules/paths/ShixunPathCard.js index d919b1a6b..66f236692 100644 --- a/public/react/src/modules/paths/ShixunPathCard.js +++ b/public/react/src/modules/paths/ShixunPathCard.js @@ -1,8 +1,8 @@ import React, { Component } from 'react'; import {getImageUrl , setImagesUrl } from 'educoder'; import { BrowserRouter as Router, Route, Link } from "react-router-dom"; -import { Tooltip } from 'antd'; -import axios from 'axios'; +import { Tooltip} from 'antd'; +import LoadingSpin from '../../common/LoadingSpin'; class ShixunPathCard extends Component{ @@ -15,7 +15,8 @@ class ShixunPathCard extends Component{
{ - pathList && pathList.length > 0 ? + pathList===null? + : pathList && pathList.length > 0 ? (
{ diff --git a/public/react/src/modules/paths/ShixunPathSearch.js b/public/react/src/modules/paths/ShixunPathSearch.js index bf6efcd5e..a473c5149 100644 --- a/public/react/src/modules/paths/ShixunPathSearch.js +++ b/public/react/src/modules/paths/ShixunPathSearch.js @@ -16,13 +16,18 @@ class ShixunPathSearch extends Component{ select:undefined, search:"", page:1, - pathList:'', + pathList:null, sortList:'', total_count:0 } } //切换列表状态 changeStatus=(value)=>{ + this.setState( + { + pathList:null + } + ) let {select,search}=this.state; this.setState({ order:value, @@ -56,6 +61,11 @@ class ShixunPathSearch extends Component{ //顶部分类 changeSelect=(tag_id)=>{ + this.setState( + { + pathList:null + } + ) let { order,search }=this.state; this.setState({ select:tag_id @@ -172,7 +182,7 @@ class ShixunPathSearch extends Component{
{ - total_count > 16 && + this.state.pathList===null?"":total_count > 16 &&
diff --git a/public/react/src/modules/tpm/shixuns/ShixunCard.js b/public/react/src/modules/tpm/shixuns/ShixunCard.js index d08af8bed..9f62ed6b7 100644 --- a/public/react/src/modules/tpm/shixuns/ShixunCard.js +++ b/public/react/src/modules/tpm/shixuns/ShixunCard.js @@ -9,10 +9,10 @@ import classNames from 'classnames'; import { Rating ,Pagination} from "@icedesign/base"; -import {getImageUrl,setImagesUrl, toPath} from 'educoder'; +import {getImageUrl,setImagesUrl, toPath,getUrl} from 'educoder'; import { Spin,Icon,Tooltip ,Rate} from 'antd'; - +import LoadingSpin from '../../../common/LoadingSpin'; import './shixunCss/shixunCard.css'; // 引入业务组件样式 @@ -58,26 +58,28 @@ class ShixunCard extends Component { return (
- -
-
-
- -

暂时还没有相关数据哦!

-
-
-
-
-
    - -
-
-
-
-
- -
+ + { middleshixundata === undefined?"":middleshixundata.length === 0 ?
+ + +

暂时还没有相关数据哦!

+
:""} + + +