帮助中心

This commit is contained in:
谢思 2022-04-08 15:32:34 +08:00
parent 5edf45988e
commit d375ed8b02
4 changed files with 103 additions and 4 deletions

View File

@ -6,7 +6,6 @@ import './index.scss';
import TextArea from 'antd/lib/input/TextArea';
const Option = Select.Option;
function Apply(props) {
console.log(props);
const {form, qzDetail, enrollStatus, setReload, current_user, history} = props;
const {getFieldDecorator, validateFields, setFieldsValue, validateFieldsAndScroll } = form;
const [imageUrl, setImageUrl] = useState(undefined);

62
src/glcc/help/index.jsx Normal file
View File

@ -0,0 +1,62 @@
import React , { useCallback, useEffect , useState } from 'react';
import { Breadcrumb, Button, Form, Icon, Input, Select, Upload } from 'antd';
import {classify} from '../static';
import { wikiPages, getWiki } from '../../forge/Wiki/api';
import Axios from 'axios';
import './index.scss';
import TextArea from 'antd/lib/input/TextArea';
const Option = Select.Option;
function Help(props) {
const [fileArrInit, setFileArrInit] = useState(null);
const [checkItem, setCheckItem] = useState({});
const [itemDetail, setItemDetail] = useState({});
// wiki
useEffect(()=>{
wikiPages({
owner: 'innov',
repo: 'PiggyMetrics22',
projectId: '1158'
}).then(res => {
if (res && res.message === "200" && Array.isArray(res.data)) {
setFileArrInit(res.data);
if (res.data.length) {
setCheckItem(res.data[0]);
};
} else {
setFileArrInit([]);
}
});
}, [])
// wiki
useEffect(() => {
checkItem.name && getWiki({
owner: 'innov',
repo: 'PiggyMetrics22',
pagename: checkItem.name,
projectId: '1158'
}).then(res => {
if (res && res.message === "200") {
setItemDetail(res.data);
} else {
showNotification("加载失败")
}
});
}, [checkItem]);
return(
<div className="glcc_help">
<div className='help_main'>
<div className='menuList'>
<span className='font-18 mb15'>帮助文档</span>
{fileArrInit && fileArrInit.map(item => {
// onClick={() => { setCheckItem(item) }} checkItem.name
return <span className={`wiki_title font-15 mb15 ${item.name === checkItem.name? 'active' : ''}`} key={item.name} onClick={() => { setCheckItem(item) }}>{item.name}</span>})}
</div>
<div className="help_cntent" dangerouslySetInnerHTML={{ __html: itemDetail && itemDetail.simple_content }} ></div>
</div>
</div>
)
}
export default Help;

26
src/glcc/help/index.scss Normal file
View File

@ -0,0 +1,26 @@
.glcc_help{
background-image:linear-gradient(180deg,#ebf2ff 0%,#f2f4ff 100%);
padding: 30px 0 120px;
min-height: 85vh;
.help_main{
width: 1200px;
margin: 0 auto;
display: flex;
}
.menuList{
display: flex;
flex-direction: column;
width: 16%;
padding: 20px 0 25px 25px;
background-color:#f3f8ff;
border:1px solid;
border-color:#ffffff;
margin-right: 40px;
}
.wiki_title{
cursor: pointer;
&:hover, &.active{
color:#466aff;
}
}
}

View File

@ -13,16 +13,21 @@ import Loading from "../Loading";
import { ImageLayerOfCommentHOC } from "../modules/page/layers/ImageLayerOfCommentHOC";
{/* 任务管理审核 */}
//
const Home = Loadable({
loader: () => import("./home"),
loading: Loading,
});
{/* 开源夏令营报名页面 */}
//
const Apply = Loadable({
loader: () => import("./apply"),
loading: Loading,
});
//
const Help = Loadable({
loader: () => import("./help"),
loading: Loading,
});
const Glcc = (propsF) => {
@ -30,13 +35,20 @@ const Glcc = (propsF) => {
return (
<div className="newMain clearfix">
<Switch {...propsF}>
{/* 开源夏令营报名页面 */}
<Route
path="/glcc/apply"
render={(props) => (
<Apply {...propsF} {...props} />
)}
></Route>
{/* 帮助中心 */}
<Route
path="/glcc/help"
render={(props) => (
<Help {...propsF} {...props} />
)}
></Route>
{/* 首页 */}
<Route
path="/glcc"