调整平台加载体验

dev_home
杨树明 5 years ago
parent 2b7246d910
commit 175cf8dc01

@ -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(
<div className="edu-tab-con-box clearfix edu-txt-center" style={style}>
<style>
{`
.edu-tab-con-box{
padding:100px 0px;
}
.ant-modal-body .edu-tab-con-box{
padding:0px!important;
}
img.edu-nodata-img{
margin: 40px auto 20px;
}
`}
</style>
<Spin tip="正在获取相关数据..."/>
</div>
)
}
}
export default LoadingSpin;

@ -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 ?<div className="mb40 edu-txt-center padding20-30"
{datas===undefined?"":count===undefined?"":count >15 ?<div className="mb40 edu-txt-center padding20-30"
>
<Pagination
@ -208,7 +210,7 @@ class CompetitionsIndex extends Component{
</div>:""}
{
datas===undefined?"":datas && datas.length===0? <NoneData></NoneData>:""
datas===undefined?<LoadingSpin/>:datas && datas.length===0? <NoneData></NoneData>:""
}
</div>

@ -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{
</div>
<CoursesHomeCard {...this.props} {...this.state}
coursesHomelist={coursesHomelist}></CoursesHomeCard>
{coursesHomelist===undefined?<LoadingSpin/>:<CoursesHomeCard {...this.props} {...this.state}
coursesHomelist={coursesHomelist}></CoursesHomeCard>}
{coursesHomelist===undefined?"":coursesHomelist.courses.length===0?<div className="edu-tab-con-box clearfix edu-txt-center mb50">
<img className="edu-nodata-img mb20" src={getImageUrl("images/educoder/nodata.png")}/>

@ -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{
</div>
</div>
</div>
<Spin size="large" spinning={this.state.isSpin}>
<Spin size="large" spinning={this.state.isSpin} tip="正在获取相关数据...">
{
libraries && libraries.length > 0 && <CaseItem {...this.props} {...this.state} libraries={libraries}></CaseItem>
}

@ -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{
<div className="educontent" id="subjects_list_content">
{
pathList && pathList.length > 0 ?
pathList===null?<LoadingSpin/>
: pathList && pathList.length > 0 ?
(
<div className="square-list clearfix">
{

@ -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{
</div>
<PathCard {...this.props} {...this.state}></PathCard>
{
total_count > 16 &&
this.state.pathList===null?"":total_count > 16 &&
<div className="educontent mb80 edu-txt-center mt10">
<Pagination current={page} total={ total_count || 1299 } type="mini" pageSize={16} onChange={this.onChange} />
</div>

@ -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 (
<div className="educontent mb80">
<Spin spinning={typepvisible} size="large" style={{marginTop:'15%'}}>
<div id="shixun_list_content"
style={{display: middleshixundata === undefined || middleshixundata.length === 0 ? "block" : "none"}}>
<div className="square-list clearfix">
<div className="edu-tab-con-box clearfix edu-txt-center">
<img className="edu-nodata-img mb20" src={getImageUrl("images/educoder/nodata.png")}/>
<p className="edu-nodata-p mb20">暂时还没有相关数据哦</p>
</div>
</div>
<div className="educontent edu-txt-center mb80">
<div className="inline pages_user_show">
<ul>
</ul>
<div className="cl"></div>
</div>
</div>
</div>
<div className="mt10 mb20 clearfix"
<Spin spinning={typepvisible} tip="正在获取相关数据..." size="large" style={{marginTop:'15%'}}>
{ middleshixundata === undefined?"":middleshixundata.length === 0 ?<div className="edu-tab-con-box clearfix edu-txt-center">
<style>
{`
.edu-tab-con-box{
padding:100px 0px;
}
.ant-modal-body .edu-tab-con-box{
padding:0px!important;
}
img.edu-nodata-img{
margin: 40px auto 20px;
}
`}
</style>
<img className="edu-nodata-img mb20" src={getUrl("/images/educoder/nodata.png")}/>
<p className="edu-nodata-p mb20">暂时还没有相关数据哦</p>
</div>:""}
<div className="mt10 mb20 clearfix"
// style={{display: middleshixundata === undefined || middleshixundata.length === 0 ? "none" : "block"}}
>
<div className="shixun_list_content">

Loading…
Cancel
Save