forked from Gitlink/forgeplus-react
新增关于我们页面
This commit is contained in:
parent
941a89cecc
commit
0717ec8fbb
12
src/App.js
12
src/App.js
|
@ -45,6 +45,11 @@ const License = Loadable({
|
|||
loader: () => import('./mulan/license/Index'),
|
||||
loading: Loading,
|
||||
})
|
||||
//关于我们
|
||||
const About = Loadable({
|
||||
loader: () => import('./mulan/About/Index'),
|
||||
loading: Loading,
|
||||
})
|
||||
//403页面
|
||||
const Shixunauthority = Loadable({
|
||||
loader: () => import('./modules/403/Shixunauthority'),
|
||||
|
@ -177,6 +182,13 @@ class App extends Component {
|
|||
)
|
||||
}
|
||||
/>
|
||||
<Route path="/About"
|
||||
render={
|
||||
(props) => (
|
||||
<About {...this.props} {...props} {...this.state}></About>
|
||||
)
|
||||
}
|
||||
/>
|
||||
<Route path="/license"
|
||||
render={
|
||||
(props) => (
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
import React, { useEffect, useState } from 'react';
|
||||
import { HomeHoc } from '../HOC/HomeHoc';
|
||||
import'./Index.scss';
|
||||
import axios from 'axios';
|
||||
|
||||
function Index(){
|
||||
const [ about , setAbout ] = useState(undefined);
|
||||
|
||||
useEffect(()=>{
|
||||
getAbout();
|
||||
},[])
|
||||
|
||||
function getAbout(){
|
||||
const url = `/helps/about.json`;
|
||||
axios.get(url).then(result=>{
|
||||
if(result && result.data){
|
||||
setAbout(result.data.data);
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}
|
||||
return(
|
||||
<div className="aboutBox">
|
||||
<p className="aboutTitle">关于我们</p>
|
||||
<div className="desc">
|
||||
{about && about.content}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
export default HomeHoc(Index);
|
|
@ -0,0 +1,21 @@
|
|||
.aboutBox{
|
||||
max-width: 1200px;
|
||||
margin:20px auto;
|
||||
border:1px solid #eee;
|
||||
border-radius: 4px;
|
||||
.aboutTitle{
|
||||
font-size: 20px;
|
||||
padding:10px 0px;
|
||||
text-align: center;
|
||||
border-bottom:1px solid #eee;
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
.desc{
|
||||
line-height: 22px;
|
||||
font-size: 16px;
|
||||
color: #333;
|
||||
text-indent: 2em;
|
||||
text-align: justify;
|
||||
padding:40px;
|
||||
}
|
||||
}
|
|
@ -52,14 +52,15 @@ export function HomeHoc(Sub){
|
|||
render(){
|
||||
const { users } = this.state;
|
||||
const { headData } = this.props;
|
||||
console.log(this.props);
|
||||
return(
|
||||
<div style={{height:"100%",overflow:"auto",position:"relative"}}>
|
||||
<Header {...this.props} {...this.state} users={users} headData={headData} successFunc={this.successFunc} quitFunc={this.quitFunc}/>
|
||||
<div className="homebody">
|
||||
<Sub {...this.props} {...this.state} users={users}/>
|
||||
</div>
|
||||
<Footer />
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,7 +53,9 @@
|
|||
|
||||
.homebody{
|
||||
padding-top: 60px;
|
||||
padding-bottom: 136px;
|
||||
min-height: 100%;
|
||||
position: relative;
|
||||
}
|
||||
.footsnav{
|
||||
position: absolute;
|
||||
|
@ -73,6 +75,10 @@
|
|||
color: #666;
|
||||
text-align: center;
|
||||
padding:30px 0px;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
left: 0px;
|
||||
bottom: 0px;
|
||||
.homeFooterUl{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
|
|
@ -128,7 +128,7 @@ function Index(props){
|
|||
<div className="firstPanelBox">
|
||||
<div class="tit" style={{marginBottom:"30px"}}>{about.name}</div>
|
||||
<div className="desc">
|
||||
{about.content}
|
||||
{about.content}<Link to={`/about`} className="color-blue">查看更多</Link>
|
||||
</div>
|
||||
<ul className="aboutul">
|
||||
<li>
|
||||
|
|
Loading…
Reference in New Issue