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

@ -19,11 +19,12 @@ class CaseItem extends Component{
{ {
libraries && libraries.map((item,key)=>{ libraries && libraries.map((item,key)=>{
return( return(
<li className="library_list_item"> <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" /> <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"> <div className="flex1">
<p className="clearfix mb25 lineh-40"> <p className="clearfix mb25 lineh-40">
<a href={`/moop_cases/${item.id}`} className="task-hide font-22 library_l_name">{item.title}</a> <a className="task-hide font-22 library_l_name">{item.title}</a>
<span className="fl mt10"><Tags tags={item.tags}></Tags></span> <span className="fl mt10"><Tags tags={item.tags}></Tags></span>
</p> </p>
<p className="clearfix lineh-20"> <p className="clearfix lineh-20">
@ -46,6 +47,7 @@ class CaseItem extends Component{
</p> </p>
</div> </div>
</li> </li>
</a>
) )
}) })
} }

@ -20,7 +20,8 @@ class Osshackathon extends Component {
hackathonedit:false, hackathonedit:false,
Osshackathonmodeltype:false, Osshackathonmodeltype:false,
spinning:false, spinning:false,
opentitletype:true opentitletype:true,
boxoffsetHeigh:0
} }
} }
@ -54,6 +55,7 @@ class Osshackathon extends Component {
spinning:true 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)=>{ PaginationTask=(pageNumber)=>{
@ -228,7 +237,6 @@ class Osshackathon extends Component {
render() { render() {
let {page,data,hackathonedit,opentitletype}=this.state; let {page,data,hackathonedit,opentitletype}=this.state;
return ( return (
<div className="newMain clearfix newMainybot"> <div className="newMain clearfix newMainybot">
<style> <style>
@ -299,18 +307,18 @@ class Osshackathon extends Component {
{ {
` `
.Osshackathonfontlist{ .Osshackathonfontlist{
height: 180px; max-height: 180px;
overflow: hidden; overflow: hidden;
} }
` `
} }
</style>:""} </style>:""}
{hackathonedit===true?"":<p className={"Osshackathonfontlist mb30"}> {hackathonedit===true?"":<p className={"Osshackathonfontlist mb30"} id={"Osshackathonfontlists"}>
{data&&data.hackathon.description===null?"":<div className={"markdown-body"} {data&&data.hackathon.description===null?"":<div className={"markdown-body"}
dangerouslySetInnerHTML={{__html: markdownToHTML(data&&data.hackathon.description).replace(/▁/g, "▁▁▁")}}></div>} dangerouslySetInnerHTML={{__html: markdownToHTML(data&&data.hackathon.description).replace(/▁/g, "▁▁▁")}}></div>}
</p>} </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 {hackathonedit===true?<Osshackathonmd
getosshackathon={()=>this.getosshackathonlist()} getosshackathon={()=>this.getosshackathonlist()}

Loading…
Cancel
Save