dev_sync_trustie
杨树明 5 years ago
parent cd01499650
commit 5f0699aa73

@ -1,14 +1,10 @@
import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import { Menu, Icon, List, Avatar,Row, Col,Tag,Pagination} from 'antd';
import {getImageUrl} from 'educoder';
import axios from 'axios';
import './Competitionsindex.css';
import NoneData from "../../courses/shixunHomework/shixunHomework";
import groups1 from './groups1.png';
import groups2 from './groups2.png';
import groups3 from './groups3.png';
import NoneData from "../../courses/coursesPublic/NoneData";
const { SubMenu } = Menu;
@ -42,7 +38,7 @@ class CompetitionsIndex extends Component{
axios.get(Url,{params:{
category:category,
page:page,
per_page:20,
per_page:15,
}
}).then((response) => {
if(response.status===200){
@ -72,6 +68,14 @@ class CompetitionsIndex extends Component{
this.props.history.replace(url);
}
}
PaginationCourse=(pageNumber)=>{
let {category}=this.state;
this.setState({
page: pageNumber,
})
this.getdata(category,pageNumber);
}
render() {
let {datas,page,count}=this.state;
@ -82,6 +86,21 @@ class CompetitionsIndex extends Component{
<div className="clearfix">
<div>
<div className="newMain clearfix">
<style>
{
`
.courses-head{
width: 100%;
height: 300px;
background-image: url(`getImageUrl(`images/educoder/competitions/courses.png`)`);
background-color: #081C4B;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}
`
}
</style>
<div className="courses-head pr">
<div className="edu-txt-center pathNavLine">
<div className="inline path-nav"></div>
@ -124,7 +143,7 @@ class CompetitionsIndex extends Component{
`
}
</style>
<List
{datas===undefined?"":datas.length===0?"":<List
itemLayout="vertical"
size="large"
dataSource={datas&&datas}
@ -141,7 +160,7 @@ class CompetitionsIndex extends Component{
}
</style>:""}
<img className={"competitonimg"}
src={item.competition_status==="ended"?groups1:item.competition_status==="nearly_published"?groups2:item.competition_status==="progressing"?groups3:""} />
src={item.competition_status==="ended"?getImageUrl(`images/educoder/competitions/groups1.png`):item.competition_status==="nearly_published"?getImageUrl(`images/educoder/competitions/groups2.png`):item.competition_status==="progressing"?getImageUrl(`images/educoder/competitions/groups3.png`):""} />
<List.Item
key={key}
actions={[
@ -193,7 +212,7 @@ class CompetitionsIndex extends Component{
)
}
/>
/>}
{datas===undefined?'none':datas.task_count >20 ?<div className="mb40 edu-txt-center padding20-30"
>

@ -1,13 +1,5 @@
.teamsLayout{background: transparent !important;}
.courses-head{
width: 100%;
height: 300px;
background-image: url(./courses.jpg);
background-color: #081C4B;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}
.competitionstitle{
height:50px !important;
border-radius: 6px;
@ -115,4 +107,15 @@
}
.endedfont{
color:#000 !important;
}
.zhezhaos{
height: 200px;
overflow: hidden;
position: relative;
border: 1px solid rgb(235, 237, 240);
border-radius: 2px;
padding: 48px;
text-align: center;
background: rgb(250, 250, 250);
}
Loading…
Cancel
Save