{newsList[0].summary}
{newsList[0].publishTime}
- 查看详情
+ 查看详情
{i.summary}
{i.publishTime}
- 查看详情
+ 查看详情
{newsList[0].summary}
{newsList[0].publishTime}
- 查看详情
+ 查看详情
{i.summary}
{i.publishTime}
- 查看详情
+ 查看详情
1 - {newsList[0].name} + {newsList[0].name}
{newsList[0].summary}
@@ -162,7 +161,7 @@ function HeaderPage(props){
{newsList[0].publishTime}
- 查看更多
+ 查看更多
{k + 1} - {i.name} + {i.name}
{i.summary}
diff --git a/src/forge/Information/Pages/main.jsx b/src/forge/Information/Pages/main.jsx index 89c38d930..398658fa9 100644 --- a/src/forge/Information/Pages/main.jsx +++ b/src/forge/Information/Pages/main.jsx @@ -11,7 +11,7 @@ import liulan from '../img/liulan.png'; import emptydata from '../../Images/nodata.png'; import DefaultImg from '../Component/defaultImg'; import { httpUrl } from '../fetch'; -import { tempConfig } from '../tempInfo'; +import { tempConfig, tempEnum } from '../tempInfo'; function Main(props){ const [ key , setKey ] = useState("1"); @@ -22,14 +22,13 @@ function Main(props){ const [ isSpin , setIsSpin ] = useState(true); const [ newCateId , setNewCateId ] = useState(undefined); const { deptId , cateId } = props.match.params; - const { id } = props; - const temp = props.pathName + const { id, temp } = props; useEffect(()=>{ if(id) { setIsSpin(true); - if (temp === 'zone') { + if (temp === tempEnum.zone) { getMainList(); } else { getCateList(); @@ -50,7 +49,7 @@ function Main(props){ if(result){ let rows = result.data.rows; setMainList(rows); - if (temp !== 'zone') { + if (temp !== tempEnum.zone) { selectCate(rows[0].id) } setTimeout(() => { @@ -71,7 +70,7 @@ function Main(props){ if(result){ let rows = result.data.rows; setMainList(rows); - if (temp !== 'zone') { + if (temp !== tempEnum.zone) { selectCate(rows[0].id) } setIsSpin(false); @@ -103,7 +102,7 @@ function Main(props){ function selectCate(id) { setNewCateId(id) - props.history.push(`/${temp}/${deptId}/news/${id}`) + props.history.push(`/zone/${deptId}/news/${id}`) } return( @@ -114,13 +113,13 @@ function Main(props){ { mainList && mainList.length>0 && ( - temp === 'zone' ? + temp === tempEnum.zone ?