dev_ysm^2
杨树明 5 years ago
parent 6ce9d01ffb
commit 6cdd9120f9

@ -19,33 +19,35 @@ class CaseItem extends Component{
{
libraries && libraries.map((item,key)=>{
return(
<li className="library_list_item">
<img alt={item.id} className="mr15 mt3 radius4" height="90" src={getUrl(`${item.cover_url || "/images/educoder/library-default-cover.png"}`)} width="120" />
<div className="flex1">
<p className="clearfix mb25 lineh-40">
<a href={`/moop_cases/${item.id}`} className="task-hide font-22 library_l_name">{item.title}</a>
<span className="fl mt10"><Tags tags={item.tags}></Tags></span>
</p>
<p className="clearfix lineh-20">
<span className="color-grey-3 mr10">{item.author_name}</span>
<span className="color-grey-3 mr20">{item.author_school_name}</span>
<span className="color-grey-c fr">
{
item.visited_count && item.visited_count != 0 ?
<span className="color-grey-c ml20"><span className=" item-group-icon mr5"><i className="fa fa-eye"></i></span>{item.visited_count} </span>:""
}
{
item.praise_count && item.praise_count != 0 ?
<span className="color-grey-c ml20"><span className=" item-group-icon mr5"><i className="fa fa-thumbs-o-up"></i></span>{item.praise_count} </span>:""
}
{
item.download_count && item.download_count != 0 ?
<span className="color-grey-c ml20" style={{"marginRight":'1px'}}><span className=" item-group-icon mr5"><i className="fa fa-download"></i></span>{item.download_count} </span>:""
}
</span>
</p>
</div>
</li>
<a href={`/moop_cases/${item.id}`} target="_blank">
<li className="library_list_item pointer">
<img alt={item.id} className="mr15 mt3 radius4" height="90" src={getUrl(`${item.cover_url || "/images/educoder/library-default-cover.png"}`)} width="120" />
<div className="flex1">
<p className="clearfix mb25 lineh-40">
<a className="task-hide font-22 library_l_name">{item.title}</a>
<span className="fl mt10"><Tags tags={item.tags}></Tags></span>
</p>
<p className="clearfix lineh-20">
<span className="color-grey-3 mr10">{item.author_name}</span>
<span className="color-grey-3 mr20">{item.author_school_name}</span>
<span className="color-grey-c fr">
{
item.visited_count && item.visited_count != 0 ?
<span className="color-grey-c ml20"><span className=" item-group-icon mr5"><i className="fa fa-eye"></i></span>{item.visited_count} </span>:""
}
{
item.praise_count && item.praise_count != 0 ?
<span className="color-grey-c ml20"><span className=" item-group-icon mr5"><i className="fa fa-thumbs-o-up"></i></span>{item.praise_count} </span>:""
}
{
item.download_count && item.download_count != 0 ?
<span className="color-grey-c ml20" style={{"marginRight":'1px'}}><span className=" item-group-icon mr5"><i className="fa fa-download"></i></span>{item.download_count} </span>:""
}
</span>
</p>
</div>
</li>
</a>
)
})
}

@ -20,7 +20,8 @@ class Osshackathon extends Component {
hackathonedit:false,
Osshackathonmodeltype:false,
spinning:false,
opentitletype:true
opentitletype:true,
boxoffsetHeigh:0
}
}
@ -54,6 +55,7 @@ class Osshackathon extends Component {
spinning:true
})
})
}
@ -67,9 +69,16 @@ class Osshackathon extends Component {
}
componentDidUpdate = (prevProps) => {
componentDidUpdate = (prevProps,prevState) => {
if(prevState.data!=this.state.data){
//防止陷入无限循环
let box=document.getElementById("Osshackathonfontlists");
if(box){
this.setState({
boxoffsetHeigh:box.offsetHeight
})
}
}
}
PaginationTask=(pageNumber)=>{
@ -228,7 +237,6 @@ class Osshackathon extends Component {
render() {
let {page,data,hackathonedit,opentitletype}=this.state;
return (
<div className="newMain clearfix newMainybot">
<style>
@ -299,18 +307,18 @@ class Osshackathon extends Component {
{
`
.Osshackathonfontlist{
height: 180px;
max-height: 180px;
overflow: hidden;
}
`
}
</style>:""}
{hackathonedit===true?"":<p className={"Osshackathonfontlist mb30"}>
{hackathonedit===true?"":<p className={"Osshackathonfontlist mb30"} id={"Osshackathonfontlists"}>
{data&&data.hackathon.description===null?"":<div className={"markdown-body"}
dangerouslySetInnerHTML={{__html: markdownToHTML(data&&data.hackathon.description).replace(/▁/g, "▁▁▁")}}></div>}
</p>}
{opentitletype===true?<Divider dashed={true} onClick={()=>this.opentitle()} className={"pointer Breadcrumbfont"}>展开阅读全文<Icon type="down" /></Divider>:""}
{opentitletype===true&&this.state.boxoffsetHeigh===180?<Divider dashed={true} onClick={()=>this.opentitle()} className={"pointer Breadcrumbfont"}>展开阅读全文<Icon type="down" /></Divider>:""}
{hackathonedit===true?<Osshackathonmd
getosshackathon={()=>this.getosshackathonlist()}

Loading…
Cancel
Save