|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
import React, {Component} from 'react';
|
|
|
|
|
import axios from 'axios';
|
|
|
|
|
import {SnackbarHOC, WordsBtn,getImageUrl} from 'educoder';
|
|
|
|
|
import {SnackbarHOC, WordsBtn,getImageUrl,markdownToHTML} from 'educoder';
|
|
|
|
|
import {Row, Col,Input,Divider,Card,Button} from 'antd';
|
|
|
|
|
import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
|
|
|
|
|
import { CNotificationHOC } from '../courses/common/CNotificationHOC';
|
|
|
|
@ -11,13 +11,35 @@ class Osshackathon extends Component {
|
|
|
|
|
constructor(props) {
|
|
|
|
|
super(props)
|
|
|
|
|
this.state = {
|
|
|
|
|
|
|
|
|
|
page:1,
|
|
|
|
|
limit:10,
|
|
|
|
|
search:undefined,
|
|
|
|
|
data:undefined
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
|
this.getosshackathon();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
getosshackathon=()=>{
|
|
|
|
|
let {page,limit,search}=this.state;
|
|
|
|
|
let url=`/osshackathon.json`;
|
|
|
|
|
axios.get(url,{params:{
|
|
|
|
|
page:page,
|
|
|
|
|
limit:limit,
|
|
|
|
|
search:search,
|
|
|
|
|
}}).then((result)=>{
|
|
|
|
|
if(result.status==200){
|
|
|
|
|
console.log(result)
|
|
|
|
|
this.setState({
|
|
|
|
|
data:result.data
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}).catch((error)=>{
|
|
|
|
|
console.log(error);
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
componentDidUpdate = (prevProps) => {
|
|
|
|
|
|
|
|
|
@ -25,10 +47,21 @@ class Osshackathon extends Component {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
// let {} = this.state;
|
|
|
|
|
let{data}=this.state;
|
|
|
|
|
console.log(this.state.data)
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="newMain clearfix newMainybot">
|
|
|
|
|
<style>
|
|
|
|
|
{
|
|
|
|
|
`
|
|
|
|
|
.ant-btn-primary{
|
|
|
|
|
background: #4CACFF;
|
|
|
|
|
border-color: #4CACFF;
|
|
|
|
|
}
|
|
|
|
|
`
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
<div className={"educontent mb20 persmstyle"} style={{width: "1200px", marginTop: "26px"}}>
|
|
|
|
|
|
|
|
|
@ -50,7 +83,7 @@ class Osshackathon extends Component {
|
|
|
|
|
|
|
|
|
|
<Col span={3} className={"fr textright"}>
|
|
|
|
|
<div>
|
|
|
|
|
报名整数:<span className={"color-red"}>280</span>个
|
|
|
|
|
报名整数:<span className={"color-red"}>{data&&data.hackathon.hackathon_users_count}</span> 个
|
|
|
|
|
</div>
|
|
|
|
|
</Col>
|
|
|
|
|
|
|
|
|
@ -58,7 +91,7 @@ class Osshackathon extends Component {
|
|
|
|
|
|
|
|
|
|
<Row className={"mt20"}>
|
|
|
|
|
<Col span={6} className={"Osshackathonfont"}>
|
|
|
|
|
大赛介绍
|
|
|
|
|
{data&&data.hackathon.name}
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={3} className={"fr textright"}>
|
|
|
|
|
<Button type="primary">编辑</Button>
|
|
|
|
@ -77,12 +110,18 @@ class Osshackathon extends Component {
|
|
|
|
|
<Divider />
|
|
|
|
|
|
|
|
|
|
<p className={"Osshackathonfontlist mb30"}>
|
|
|
|
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista
|
|
|
|
|
probare, quae sunt a te dicta? Refert tamen, quo modo.
|
|
|
|
|
{data&&data.hackathon.description===null?"":<div className={"markdown-body"}
|
|
|
|
|
dangerouslySetInnerHTML={{__html: markdownToHTML(data&&data.hackathon.description).replace(/▁/g, "▁▁▁")}}></div>}
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
data&&data.hacks.length==0?"":data&&data.hacks.map((item,key)=>{
|
|
|
|
|
return(
|
|
|
|
|
<span></span>
|
|
|
|
|
)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
{/*学生身份*/}
|
|
|
|
|
<Card className={"OsshackathonCard"}>
|
|
|
|
|
<Card className={"OsshackathonCard mb20"}>
|
|
|
|
|
|
|
|
|
|
<Row>
|
|
|
|
|
<Col span={6} className={"OsshackathonCardtitle"}>
|
|
|
|
|