forked from Gitlink/forgeplus-react
This commit is contained in:
parent
156e6977de
commit
29082d1f5f
|
|
@ -22,17 +22,20 @@ function Partner(props) {
|
|||
},[id])
|
||||
|
||||
function getUnit(array){
|
||||
const newArray = array.map(e => {
|
||||
const newArray = []
|
||||
for(let i in array) {
|
||||
let e = array[i]
|
||||
if (e.zonePartnersList && e.zonePartnersList.length > 0) {
|
||||
e.zonePartnersList[0].typeName = e.typeName
|
||||
}
|
||||
return e.zonePartnersList
|
||||
})
|
||||
if ( e.zonePartnersList.length > 0 ) {
|
||||
newArray.push(e.zonePartnersList)
|
||||
}
|
||||
}
|
||||
|
||||
while(newArray[1] && newArray[1].length + newArray[0].length <= 5) {
|
||||
newArray[0] = [...newArray[0], ...newArray.splice(1, 1)]
|
||||
}
|
||||
console.log(newArray)
|
||||
setTopics(newArray)
|
||||
}
|
||||
|
||||
|
|
@ -47,7 +50,7 @@ function Partner(props) {
|
|||
i.map((j,k1)=>{
|
||||
return(
|
||||
<div className="zone_part_item" key={ k1 }>
|
||||
{ j.typeName && <span>{j.typeName}</span>}
|
||||
{ j.typeName && topics.length > 1 && <span>{j.typeName}</span>}
|
||||
<a key={ k1 } href={j.link} target="_blank"><img src={j.logo} alt=""/></a>
|
||||
</div>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ function NewsDetail(props){
|
|||
<div className="info_text_main">
|
||||
<p className="i_name">{detail.name}</p>
|
||||
<ul className="i_ul_value">
|
||||
{ cmsDir && <li>{cmsDir.name}</li> }
|
||||
{ cmsDir && <li> { detail.publishUser }</li> }
|
||||
{ cmsDir && <li>发布于{detail.publishTime}</li> }
|
||||
{ detail.visits && <li><img src={liulan} alt="" className="mr5" />{detail.visits}</li> }
|
||||
</ul>
|
||||
|
|
|
|||
Loading…
Reference in New Issue