forked from Gitlink/forgeplus-react
优化样式
This commit is contained in:
parent
81e41eaa6b
commit
ed4d5aaa48
|
|
@ -36,7 +36,7 @@ function Contributor(props) {
|
|||
{ i.name &&
|
||||
<div className="c_item">
|
||||
<Link to={`/${i.login}`}><img src={i.imageUrl} alt="" /></Link>
|
||||
<span className="c_name">{i.name}</span>
|
||||
<div className="c_name task-hide">{i.name}</div>
|
||||
<p className="c_desc task-hide-2" style={{display:i.introduction?"":"flex"}}>{i.introduction || "暂无~"}</p>
|
||||
</div>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,9 +49,9 @@ function Projects(props) {
|
|||
projectList.map((i,k)=>{
|
||||
return(
|
||||
<div className="container">
|
||||
<div className="zone_p_item" >
|
||||
<div className="zone_p_item">
|
||||
{i.projectProperties && i.projectProperties.authorImageUrl && <img className="info_img" src={i.projectProperties.authorImageUrl} alt="" /> }
|
||||
<p className="z_p_title task-hide">{i.projectProperties && i.projectProperties.name}</p>
|
||||
<p className="z_p_title task-hide" onClick={()=>window.open(i.projectURL)}>{i.projectProperties && i.projectProperties.name}</p>
|
||||
<p className="z_p_desc task-hide-2">{i.projectProperties && i.projectProperties.description ? i.projectProperties.description : "暂无~"}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -29,11 +29,21 @@ function Main(props){
|
|||
useEffect(()=>{
|
||||
if(id) {
|
||||
setIsSpin(true);
|
||||
getMainList();
|
||||
if (temp === 'zone') {
|
||||
getMainList();
|
||||
} else {
|
||||
getCateList();
|
||||
}
|
||||
getHotList();
|
||||
}
|
||||
},[id])
|
||||
|
||||
useEffect(() => {
|
||||
if (newCateId) {
|
||||
getSubHotList()
|
||||
}
|
||||
}, [newCateId])
|
||||
|
||||
function getMainList(){
|
||||
const url = `${httpUrl}/cms/doc/open/zone/${id}/docOverviewList`;
|
||||
axios.get(url).then(result=>{
|
||||
|
|
@ -55,6 +65,20 @@ function Main(props){
|
|||
}).catch(error=>{})
|
||||
}
|
||||
|
||||
function getCateList() {
|
||||
const url = `${httpUrl}/cms/doc/open/zone/${id}/dirList`;
|
||||
axios.get(url).then(result=>{
|
||||
if(result){
|
||||
let rows = result.data.rows;
|
||||
setMainList(rows);
|
||||
if (temp !== 'zone') {
|
||||
selectCate(rows[0].id)
|
||||
}
|
||||
setIsSpin(false);
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}
|
||||
|
||||
function getHotList(){
|
||||
const url = `${httpUrl}/cms/doc/open/zone/${id}/hotDocList`;
|
||||
axios.get(url,{
|
||||
|
|
@ -66,6 +90,17 @@ function Main(props){
|
|||
}).catch(error=>{})
|
||||
}
|
||||
|
||||
function getSubHotList() {
|
||||
const url = `${httpUrl}/cms/doc/open/dir/${newCateId}/hotDocList`;
|
||||
axios.get(url,{
|
||||
params:{pageSize:15,pageNum:1}
|
||||
}).then(result=>{
|
||||
if(result){
|
||||
setHotList(result.data.rows);
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}
|
||||
|
||||
function selectCate(id) {
|
||||
setNewCateId(id)
|
||||
props.history.push(`/${temp}/${deptId}/news/${id}`)
|
||||
|
|
|
|||
|
|
@ -234,7 +234,6 @@
|
|||
background:#fefefe;
|
||||
}
|
||||
.zone_p_item {
|
||||
cursor: pointer;
|
||||
width: 364px;
|
||||
height: 320px;
|
||||
border-radius:16px;
|
||||
|
|
@ -258,6 +257,7 @@
|
|||
font-size: 16px;
|
||||
text-align: center;
|
||||
margin-top: 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.z_p_desc{
|
||||
margin-top: 18px;
|
||||
|
|
@ -313,6 +313,7 @@
|
|||
color: #000000;
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
max-width: 240px;
|
||||
}
|
||||
.c_desc {
|
||||
color: #4c5876;
|
||||
|
|
|
|||
Loading…
Reference in New Issue