This commit is contained in:
caishi 2023-05-30 17:32:55 +08:00
parent dde76c1123
commit 0d2fb2e0ea
10 changed files with 176 additions and 72 deletions

View File

@ -6,16 +6,20 @@ import Menu3 from '../img/menu3.png';
import Menu4 from '../img/menu4.png';
import Menu5 from '../img/menu5.png';
import Menu6 from '../img/menu6.png';
import Menu7 from '../img/menu7.png';
import banner from '../img/mainbanner.png'
import { Link } from 'react-router-dom';
function PublicBanner(props){
const [ key , setKey ] = useState("1");
const { deptId } = props.match.params;
const { pathname } = props.history.location;
const { data , adminUrl } = props;
useEffect(()=>{
if(pathname){
const head = /\/information\/[0-9]{0,}/g;
@ -39,7 +43,7 @@ function PublicBanner(props){
},[pathname])
return(
<div className="in_banner">
<div className="in_banner" style={{backgroundImage:`url(${(data && data.bannerList) || banner})`}}>
{
data &&
<div>
@ -49,13 +53,13 @@ function PublicBanner(props){
}
<div className="bannerMenus">
<Menu mode={"horizontal"} selectedKeys={[key]}>
<Menu.Item key={"1"}><Link to={`/information/1`}><img src={Menu1} alt="" width="29px"/>首页</Link></Menu.Item>
<Menu.Item key={"2"}><Link to={`/information/1/projects`}><img src={Menu2} alt="" width="34px"/>开源项目</Link></Menu.Item>
<Menu.Item key={"1"}><Link to={`/information/${deptId}`}><img src={Menu1} alt="" width="29px"/>首页</Link></Menu.Item>
<Menu.Item key={"2"}><Link to={`/information/${deptId}/projects`}><img src={Menu2} alt="" width="34px"/>开源项目</Link></Menu.Item>
{/* <Menu.Item key={"3"}><img src={Menu3} alt="" width="33px"/>资源发布</Menu.Item> */}
<Menu.Item key={"4"}><Link to={`/information/1/news`}><img src={Menu4} alt="" width="32px"/>领域资讯</Link></Menu.Item>
<Menu.Item key={"4"}><Link to={`/information/${deptId}/news`}><img src={Menu4} alt="" width="32px"/>领域资讯</Link></Menu.Item>
{/* <Menu.Item key={"5"}><img src={Menu5} alt="" width="27px"/>Sig小组</Menu.Item> */}
<Menu.Item key={"6"}><Link to={`/information/1/VIP`}><img src={Menu6} alt="" width="27px"/>专区会员</Link></Menu.Item>
{ adminUrl && <Menu.Item key={"6"}><a onClick={()=>{window.location.href=adminUrl}}><img src={Menu6} alt="" width="27px"/>后台管理</a></Menu.Item> }
<Menu.Item key={"6"}><Link to={`/information/${deptId}/VIP`}><img src={Menu6} alt="" width="36px"/>专区会员</Link></Menu.Item>
{ adminUrl && <Menu.Item key={"6"}><a onClick={()=>{window.location.href=adminUrl}}><img src={Menu7} alt="" width="34px"/>后台管理</a></Menu.Item> }
</Menu>
</div>
</div>

View File

@ -49,18 +49,18 @@ function HeaderPage(props){
}
return(
<div className="zone_box">
<p className="in_title">{data && data.name}</p>
<p className="in_title">{data && data.firstTitle}</p>
<div className="boxmain zone_infos">
{
data &&
<div className="zone_infos_desc">
<p className="z_name">{data.name}</p>
<p className="z_desc">{data.introductionContent}</p>
<p className="z_name">{data.introductionTitle}</p>
<p className="z_desc task-hide-2">{data.introductionContent}</p>
</div>
}
{
data && data.introductionImage &&
<img src={data.introductionImage} alt="" width="512px" height="330px"/>
<img src={data.introductionImage} alt="" width="474px" height="277px"/>
}
</div>
<div className="zone_news">
@ -69,18 +69,18 @@ function HeaderPage(props){
newsList && newsList.length>0 &&
<div className="boxmain" style={{display:"flex"}}>
<div className="zone_new_first">
<img src={img1} alt="" height="302px" className="mb30"/>
<img src={newsList[0].headImg || img1} alt="" height="302px" className="mb30"/>
<p className="zone_n_title task-hide">{newsList[0].name}</p>
<p className="zone_n_desc task-hide-2">{newsList[0].summary}</p>
<p className="font-13 mt10" style={{color:"#8d95a3"}}>
<p className="font-13 mt10 flexCenter" style={{color:"#8d95a3"}}>
<img src={shijian} alt="" className="mr3" />
{newsList[0].publishTime}
</p>
<p className="mt15">
<Link to={`/information/${deptId}/newdetail/${newsList[0].id}`} className="color-blue">查看详情<img src={guideArrow} alt="" width="14px" className="ml3"/></Link>
<Link to={`/information/${deptId}/newdetail/${newsList[0].id}`} className="color-blue flexCenter zone_btn">查看详情<img src={guideArrow} alt="" width="14px" className="ml3"/></Link>
</p>
</div>
<ul className="zone_new_three">
<ul className={`zone_new_three ${newsList.length <4 ? "flexStart" : "spaceeTween"}`}>
{
newsList.map((i,k)=>{
return(
@ -92,7 +92,7 @@ function HeaderPage(props){
<img src={shijian} alt="" className="mr3" />
{i.publishTime}
</span>
<Link to={`/information/${deptId}/newdetail/${i.id}`} className="color-blue">查看详情<img src={guideArrow} alt="" width="14px"/></Link>
<Link to={`/information/${deptId}/newdetail/${i.id}`} className="color-blue flexCenter zone_btn">查看详情<img src={guideArrow} alt="" width="14px"/></Link>
</p>
</li>
)
@ -111,9 +111,9 @@ function HeaderPage(props){
projectList.map((i,k)=>{
return(
<li>
{i.projectProperties && i.projectProperties.authorImageUrl && <img src={i.projectProperties.authorImageUrl} alt="" /> }
<div>
<a onClick={()=>window.open(i.projectURL)} className="z_p_title">{i.projectProperties && i.projectProperties.fullName}</a>
<div className="imgBox">{i.projectProperties && i.projectProperties.authorImageUrl && <img src={i.projectProperties.authorImageUrl} alt="" /> }</div>
<div className="infoBox">
<a onClick={()=>window.open(i.projectURL)} className="z_p_title">{i.projectProperties && i.projectProperties.name}</a>
<p className="z_p_desc task-hide-2">{i.projectProperties && i.projectProperties.description ? i.projectProperties.description : "暂无~"}</p>
</div>
</li>

View File

@ -30,7 +30,11 @@ function Main(props){
function getMainList(){
const url = `/cms/doc/open/zone/${deptId}/docOverviewList`;
axios.get(url).then(result=>{
axios.get(url,{
params:{
pageSize:10,pageNum:1
}
}).then(result=>{
if(result){
setMainList(result.data.rows);
setIsSpin(false);
@ -52,11 +56,23 @@ function Main(props){
function clickTab(k,idName){
setKey(k);
}
// const hash = props.history.location.hash;
// useEffect(()=>{
// if(hash){
// setTimeout(()=>{
// let top =document.documentElement.scrollTop;
// console.log(document.documentElement.scrollTop);
// window.scrollTo(0,top-120);
// },50)
// }
// },[hash])
return(
<div>
{/* <Banner {...props}/> */}
<div className="main_content">
<div id={`main_card_item_1`} style={{opacity:"0"}}></div>
<p className="in_title">领域资讯</p>
{
mainList && mainList.length>0 &&
@ -82,42 +98,47 @@ function Main(props){
mainList && mainList.length>0 &&
mainList.map((i,k)=>{
return(
<div className="main_card radius4" id={`main_card_item_${k+1}`}>
<div className="main_card radius4">
<div className="guide">
<span>{i.name}</span>
<Link to={`/information/${deptId}/news/${i.id}`}>更多<img src={guideArrow} alt="" width="14px"/></Link>
<span><span className="task-hide">{i.name}</span></span>
<Link className="flexCenter" to={`/information/${deptId}/news/${i.id}`}>更多<img src={guideArrow} alt="" width="14px"/></Link>
</div>
<div>
{
i.cmsDocList && i.cmsDocList.length>0 ?
i.cmsDocList.map((j,e)=>{
return(
<div className="main_card_item">
{e===0 &&
(
i.headImg ?
<img src={i.headImg} alt=""/>
:
<DefaultImg name="GitLink" title={i.name} />
)
}
<div style={{flex:1,width:0}}>
<Link to={`/information/${deptId}/newdetail/${j.id}`} className={`sub_name ${e===0? "":"sub_i"}`}>{j.name}</Link>
<p className={`sub_desc ${e===0? "task-hide-2":"task-hide"}`}>
{j.summary}
</p>
<div className="sub_info">
<span><img src={shijian} alt="" />{j.publishTime}</span>
<span><img src={liulan} alt="" />{j.visits}</span>
i.cmsDocList && i.cmsDocList.length>0 ?
<React.Fragment>
{i.cmsDocList.map((j,e)=>{
return(
<div className="main_card_item">
{e===0 &&
(
j.headImg ?
<img src={j.headImg} alt=""/>
:
<DefaultImg name="GitLink" title={i.name} />
)
}
<div style={{flex:1,width:0}}>
<Link to={`/information/${deptId}/newdetail/${j.id}`} className={`sub_name task-hide ${e===0? "":"sub_i"}`}>{j.name}</Link>
<p className={`sub_desc ${e===0? "task-hide-2":"task-hide"}`}>
{j.summary}
</p>
<div className="sub_info">
<span><img src={shijian} alt="" />{j.publishTime}</span>
<span><img src={liulan} alt="" />{j.visits}</span>
</div>
</div>
</div>
</div>
)
})
)
})
}
<div id={`main_card_item_${k+2}`} style={{opacity:"0"}}></div>
</React.Fragment>
:
<div style={{display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column",height:300}}>
<img src={emptydata} alt="" width="230"/>
<p className="font-15 color-grey-6 mt20">暂无数据~</p>
<div id={`main_card_item_${k+2}`} style={{opacity:"0"}}></div>
</div>
}
</div>

View File

@ -1,7 +1,7 @@
import React , { useEffect , useState } from 'react';
import PublicBanner from '../Component/publicBanner';
import { Box , LongWidth } from '../../Component/layout';
import { Menu , Breadcrumb , Pagination , Spin } from 'antd';
import { Menu , Breadcrumb , Pagination , Spin , Tooltip } from 'antd';
import Hot from '../Component/hot';
import axios from 'axios';
import shijian from '../img/shijian.png';
@ -21,12 +21,15 @@ function NewsList(props){
const [ details , setDetails ] = useState(undefined);
const [ menuSpin , setMenuSpin ] = useState(true);
useEffect(()=>{
if(deptId && cateId){
getMainList();
}
},[deptId,cateId,pageNum])
useEffect(()=>{
if(deptId && cateId){
setMenuSpin(true);
@ -66,6 +69,7 @@ function NewsList(props){
}).then(result=>{
if(result){
setMainList(result.data.rows);
setTotal(result.data.total);
}
}).catch(error=>{})
}
@ -101,7 +105,7 @@ function NewsList(props){
{
columnList.map((i,k)=>{
return(
<Menu.Item key={i.id} value={i.id} ><Link to={`/information/${deptId}/news/${i.id}`}>{i.name}</Link></Menu.Item>
<Menu.Item key={i.id} value={i.id} ><Tooltip placement={'left'} title={i.name}><Link className="task-hide" onClick={()=>{if(document.documentElement.scrollTop > 600)window.scrollTo(0,480);}} to={`/information/${deptId}/news/${i.id}`} title={i.name}>{i.name}</Link></Tooltip></Menu.Item>
)
})
}
@ -144,7 +148,7 @@ function NewsList(props){
}
{
total > pageSize &&
<div style={{padding:"0px 25px"}}>
<div style={{padding:"25px 0px"}}>
<Pagination current={pageNum} pageSize={pageSize} total={total} showQuickJumper onChange={p=>{setPageNum(p)}}/>
</div>
}

View File

@ -67,6 +67,13 @@ function ProjectSource(props){
<Menu.Item>点赞数量排序</Menu.Item>
</Menu>
)
function changeValue(e){
if(!e.target.value && e.target.value !==value){
setSearchName(e.target.value);
}
setValue(e.target.value);
}
return(
<div className="in_pro">
{/* <Banner {...props}/> */}
@ -74,7 +81,7 @@ function ProjectSource(props){
<p className="in_title">开源项目</p>
<Box>
<ul className="in_pro_menu">
<li className="u_t">项目分类</li>
<li className="u_t"><i className="iconfont icon-muluicon font-15 mr10 mt2" style={{color:"#1f2329"}} />项目分类</li>
<li className={0 === typeId ? "active":""} onClick={()=>setTypeId(0)}>全部分类</li>
{
typeList && typeList.length>0 &&
@ -90,8 +97,8 @@ function ProjectSource(props){
<div className="in_list_menu">
<Search
value={value}
onChange={(e)=>setValue(e.target.value)}
onSearch={()=>setSearchName(value)}
onChange={changeValue}
onSearch={()=>{setSearchName(value)}}
allowClear={true}
size={'large'}
placeholder="请输入项目名称"
@ -112,7 +119,7 @@ function ProjectSource(props){
{i.projectProperties && <img src={i.projectProperties.authorImageUrl} alt="" className="author_img"/> }
<div style={{flex:"1"}}>
<p className="in_b_main">
<a onClick={()=>window.open(i.projectURL)}>{i.projectProperties && i.projectProperties.fullName}</a>
<a onClick={()=>window.open(i.projectURL)}>{i.projectProperties && i.projectProperties.name}</a>
{
i.projectProperties &&
<ul>

View File

@ -1,5 +1,6 @@
import React , { useState , useEffect } from 'react';
import Crown from '../img/crown.png';
import Nodata from '../../Nodata';
import { Spin } from 'antd';
import axios from 'axios';
@ -68,6 +69,12 @@ function ZoneVIP(props){
}
</div>
}
{
vipLists && vipLists.length === 0 &&
<div style={{marginTop:30,backgroundColor:"#fff",padding:"20px"}}>
<Nodata _html={"暂无数据"}/>
</div>
}
</div>
</Spin>
</div>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -45,7 +45,7 @@ function Index(props){
useEffect(()=>{
axios.interceptors.request.use(
config => {
var localproxy = "https://testgetway.gitlink.org.cn";
var localproxy = "https://testgetway.trustie.net";
var proxy = "";
let url = "/api" +config.url;
if(isDev){
@ -84,7 +84,9 @@ function Index(props){
const url = `/zone/open/${deptId}`;
axios.get(url).then(result=>{
if(result){
setData(result.data.data);
let data = result.data.data;
setData(data);
document.title= data&& data.name;
}
}).catch(console.error())
}

View File

@ -20,10 +20,10 @@
text-align:center;
}
.in_banner{
background-image: url(./img/mainbanner.png);
// background-image: url(./img/mainbanner.png);
background-size: 100% 100%;
// background-color:linear-gradient(270deg,#262a35 0%,rgba(38, 42, 53, 0.26) 42.94%,#262a35 100%);
height: 600px;
height: 450px;
position: relative;
padding-bottom: 88px;
&>div{
@ -37,7 +37,6 @@
color:#78d0f5;
font-size:40px;
line-height: 40px;
height: 40px;
}
.sub_t{
margin-top: 35px;
@ -73,7 +72,7 @@
&.ant-menu-item-selected a,a{
color: #fff!important;
}
&.ant-menu-item-selected::after{
&.ant-menu-item-selected::after, &.ant-menu-item-active::after{
content:"";
position: absolute;
width: 100%;
@ -82,6 +81,9 @@
bottom: 1px;
background-color: #466aff;
}
&.ant-menu-item-active::after{
background-color:rgba(255, 255, 255, 0.36);
}
}
}
}
@ -217,6 +219,7 @@
position: relative;
display: block;
line-height: 25px;
word-break: break-all;
&.sub_i{
padding-left: 18px;
&::before{
@ -239,7 +242,7 @@
align-items: center;
border-bottom: 1px dashed rgba(70, 106, 255, 0.48);
margin-bottom: 5px;
span{
&>span{
display: block;
width: 113px;
height: 30px;
@ -249,6 +252,10 @@
font-size:17px;
background-image: url(./img/guide.png);
background-size: 100% 100%;
span{
display: block;
max-width: 100px;
}
}
a{
color:#466aff;
@ -342,6 +349,10 @@
width: 1200px;
margin:0px auto;
}
.flexCenter{
display: flex;
align-items: center;
}
.detail_news_all{
.detail_banners{
background-image: url(./img/subbanner.png);
@ -420,7 +431,7 @@
.author_img{
width: 66px;
height: 66px;
border-radius: 10px;
border-radius: 50%;
margin-right: 20px;
object-fit: cover;
}
@ -530,6 +541,8 @@
font-size:18px;
font-weight:500;
cursor: default;
display: flex;
align-items: center;
}
&.active{
color:#466aff;
@ -555,12 +568,13 @@
display: flex;
align-items: center;
margin-top: 54px;
padding:27px 24px;
&>img{
border-radius: 0px 4px 4px 0px;
border-radius: 4px;
object-fit: cover;
}
.zone_infos_desc{
padding:0px 34px;
padding:0px 34px 0px 10px;
flex: 1;
.z_name{
color:#1f2329;
@ -573,6 +587,8 @@
color:#3d485d;
font-size:14px;
line-height:32px;
word-break: break-all;
-webkit-line-clamp: 4;
}
}
}
@ -590,6 +606,9 @@
font-size:17px;
height: 24px;
line-height: 24px;
&:hover{
color: #466aff;
}
}
.zone_n_desc{
color:#4c5876;
@ -606,6 +625,23 @@
line-height: 20px;
margin-top: 15px;
}
.zone_btn{
padding-right: 20px;
position: relative;
height: 20px;
line-height: 20px;
img{
position: absolute;
left: 62px;
top:5px;
transition: 0.1s;
}
&:hover{
img{
left: 68px;
}
}
}
.zone_new_first{
background-color: #fff;
padding:30px;
@ -616,12 +652,21 @@
margin-left: 30px;
display: flex;
flex-direction: column;
justify-content: space-between;
&.spaceeTween{
justify-content: space-between;
}
&.flexStart{
justify-content: flex-start;
li{
margin-bottom: 30px!important;
}
}
li{
background-color: #fff;
width: 385px;
padding:20px;
border-radius: 4px;
margin-bottom: 30px;
&:last-child{
margin-bottom: 0px;
}
@ -649,13 +694,19 @@
&:nth-child(2n){
margin-right: 0px!important;
}
&>img{
.imgBox{
background-color: #E3E7F3;
border-radius: 8px;
width: 75px;
height: 75px;
border-radius: 8px;
margin-right: 14px;
img{
width: 75px;
height: 75px;
border-radius: 8px;
}
}
&>div{
.infoBox{
flex:1;
.z_p_title{
font-weight:700;
@ -665,6 +716,9 @@
height: 22px;
line-height: 22px;
display: block;
&:hover{
color: #466aff;
}
}
.z_p_desc{
color:#4c5876;
@ -687,11 +741,12 @@
display: flex;
align-items: center;
margin-top: 50px;
justify-content: space-between;
flex-wrap: wrap;
li{
padding:17px 13px;
background-image: url(./img/contributebg.png);
box-shadow:0px 0px 15px rgba(49,61,113,0.06);
background-size: 100% 100%;
width: 268px;
height: 268px;
border:1px solid #fff;
@ -699,6 +754,10 @@
flex-direction: column;
align-items: center;
margin-bottom: 30px!important;
margin-right: 40px;
&:nth-child(4n){
margin-right: 0px;
}
&>img{
width: 80px;
height: 80px;
@ -776,16 +835,16 @@
padding:0px 40px 10px;
margin:35px 0px 15px;
&:nth-child(4n+1) .card_title{
background-color: #466aff;
background-color: rgba(72, 91, 170, 1);
}
&:nth-child(4n+2) .card_title{
background-color: #07a583;
background-color: rgba(54, 141, 122, 1);
}
&:nth-child(4n+3) .card_title{
background-color: #8257e8;
background-color: rgba(120, 95, 181, 1);
}
&:nth-child(4n+4) .card_title{
background-color: #cb7e4b;
background-color: rgba(168, 128, 101, 1);
}
.card_title{
height: 49px;
@ -822,7 +881,7 @@
&>img{
width: 100px;
height: 100px;
border-radius: 10px;
border-radius: 50%;
margin-right: 24px;
}
.card_u_info{