forked from Gitlink/forgeplus-react
commit
513255428c
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "forge",
|
||||
"version": "0.1.0",
|
||||
"version": "3.0.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
@ -990,6 +990,18 @@
|
|||
"react-lifecycles-compat": "^3.0.4",
|
||||
"warning": "^4.0.3"
|
||||
}
|
||||
},
|
||||
"react-slick": {
|
||||
"version": "0.25.2",
|
||||
"resolved": "https://registry.nlark.com/react-slick/download/react-slick-0.25.2.tgz",
|
||||
"integrity": "sha1-VjMbZ9R9i8/i3OtqyrHI/VvR9rw=",
|
||||
"requires": {
|
||||
"classnames": "^2.2.5",
|
||||
"enquire.js": "^2.1.6",
|
||||
"json2mq": "^0.2.0",
|
||||
"lodash.debounce": "^4.0.8",
|
||||
"resize-observer-polyfill": "^1.5.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -2067,7 +2079,6 @@
|
|||
"version": "6.26.0",
|
||||
"resolved": "https://registry.npm.taobao.org/babel-polyfill/download/babel-polyfill-6.26.0.tgz",
|
||||
"integrity": "sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"babel-runtime": "^6.26.0",
|
||||
"core-js": "^2.5.0",
|
||||
|
@ -2076,9 +2087,8 @@
|
|||
"dependencies": {
|
||||
"regenerator-runtime": {
|
||||
"version": "0.10.5",
|
||||
"resolved": "https://registry.nlark.com/regenerator-runtime/download/regenerator-runtime-0.10.5.tgz",
|
||||
"integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=",
|
||||
"dev": true
|
||||
"resolved": "https://registry.npm.taobao.org/regenerator-runtime/download/regenerator-runtime-0.10.5.tgz?cache=0&sync_timestamp=1595456367497&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fregenerator-runtime%2Fdownload%2Fregenerator-runtime-0.10.5.tgz",
|
||||
"integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg="
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -15245,9 +15255,9 @@
|
|||
}
|
||||
},
|
||||
"react-slick": {
|
||||
"version": "0.25.2",
|
||||
"resolved": "https://registry.nlark.com/react-slick/download/react-slick-0.25.2.tgz",
|
||||
"integrity": "sha1-VjMbZ9R9i8/i3OtqyrHI/VvR9rw=",
|
||||
"version": "0.28.1",
|
||||
"resolved": "https://registry.nlark.com/react-slick/download/react-slick-0.28.1.tgz",
|
||||
"integrity": "sha1-EsGNmRtZQy35w3V7pUCiJ7P7hbk=",
|
||||
"requires": {
|
||||
"classnames": "^2.2.5",
|
||||
"enquire.js": "^2.1.6",
|
||||
|
@ -17030,6 +17040,11 @@
|
|||
"is-fullwidth-code-point": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"slick-carousel": {
|
||||
"version": "1.8.1",
|
||||
"resolved": "https://registry.npm.taobao.org/slick-carousel/download/slick-carousel-1.8.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fslick-carousel%2Fdownload%2Fslick-carousel-1.8.1.tgz",
|
||||
"integrity": "sha1-pL+ykBSIe7Zs5Si5C9DNomLMj40="
|
||||
},
|
||||
"snapdragon": {
|
||||
"version": "0.8.2",
|
||||
"resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "forge",
|
||||
"version": "0.1.0",
|
||||
"version": "3.0.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@monaco-editor/react": "^2.3.0",
|
||||
|
@ -14,6 +14,7 @@
|
|||
"babel-jest": "20.0.3",
|
||||
"babel-loader": "7.1.2",
|
||||
"babel-plugin-syntax-dynamic-import": "^6.18.0",
|
||||
"babel-polyfill": "^6.26.0",
|
||||
"babel-preset-react-app": "^3.1.1",
|
||||
"babel-runtime": "6.26.0",
|
||||
"bizcharts": "^3.5.8",
|
||||
|
@ -92,6 +93,7 @@
|
|||
"react-resizable": "^1.10.1",
|
||||
"react-router": "^4.2.0",
|
||||
"react-router-dom": "^4.2.2",
|
||||
"react-slick": "^0.28.1",
|
||||
"react-split-pane": "^0.1.91",
|
||||
"react-url-query": "^1.5.0",
|
||||
"react-zmage": "^0.8.5-beta.31",
|
||||
|
@ -102,6 +104,7 @@
|
|||
"scroll-into-view": "^1.14.2",
|
||||
"showdown": "^1.9.1",
|
||||
"showdown-katex": "^0.8.0",
|
||||
"slick-carousel": "^1.8.1",
|
||||
"store": "^2.0.12",
|
||||
"style-loader": "0.19.0",
|
||||
"styled-components": "^4.4.1",
|
||||
|
|
|
@ -38,78 +38,6 @@
|
|||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.head-nav ul#header-nav li {
|
||||
float: left;
|
||||
height: 60px;
|
||||
line-height: 60px;
|
||||
margin-right: 30px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
font-size: 16px
|
||||
}
|
||||
|
||||
.head-nav ul#header-nav li a {
|
||||
display: block;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
color: #fff
|
||||
}
|
||||
|
||||
.head-nav ul#header-nav li a:hover {
|
||||
color: #cccccc;
|
||||
}
|
||||
|
||||
.head-nav ul#header-nav li:last-child {
|
||||
margin-right: 0px
|
||||
}
|
||||
|
||||
.head-nav ul#header-nav li.active a {
|
||||
color: #459be5 !important;
|
||||
}
|
||||
|
||||
.head-nav ul#header-nav li.active p {
|
||||
color: #459be5 !important;
|
||||
}
|
||||
|
||||
.head-nav ul#header-nav li p:hover {
|
||||
color: #cccccc;
|
||||
}
|
||||
|
||||
.head-nav ul#header-nav li p {
|
||||
display: block;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
color: #fff
|
||||
}
|
||||
|
||||
.head-nav ul#header-nav li.active div ul li a {
|
||||
color: #000 !important;
|
||||
}
|
||||
|
||||
.head-nav ul#header-nav li.active div ul li a:hover {
|
||||
color: #FFF !important;
|
||||
}
|
||||
|
||||
.head-nav ul#header-nav li.active ul li a {
|
||||
color: #000 !important;
|
||||
}
|
||||
|
||||
.head-nav ul#header-nav li.active ul li a:hover {
|
||||
color: #FFF !important;
|
||||
}
|
||||
|
||||
.head-nav ul#header-nav li.active:after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
top: auto;
|
||||
bottom: 10px;
|
||||
right: auto;
|
||||
height: 2px;
|
||||
width: 14px;
|
||||
background-color: #459be5;
|
||||
}
|
||||
|
||||
.nav-img {
|
||||
position: absolute;
|
||||
top: 2px;
|
||||
|
|
|
@ -3584,42 +3584,6 @@ a.user_bluebg_btn {
|
|||
margin-right: 5px;
|
||||
}
|
||||
|
||||
/*-------------------个人主页:右侧提示区域--------------------------*/
|
||||
.-task-sidebar {
|
||||
position: fixed;
|
||||
width: 40px;
|
||||
height: 180px;
|
||||
right: 0;
|
||||
bottom: 80px;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.-task-sidebar div {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
box-sizing: border-box;
|
||||
width: 40px;
|
||||
background: #4CACFF;
|
||||
color: #fff;
|
||||
font-size: 20px;
|
||||
text-align: center;
|
||||
margin-bottom: 5px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.-task-sidebar div i {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.-task-sidebar div i:hover {
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
.gotop {
|
||||
background-color: rgba(208, 207, 207, 0.5) !important;
|
||||
padding: 0px !important;
|
||||
}
|
||||
|
||||
|
||||
/***** loading ******/
|
||||
/*****载入中******/
|
||||
|
@ -3970,7 +3934,7 @@ html>body #ajax-indicator {
|
|||
cursor: pointer;
|
||||
position: relative;
|
||||
font-size: 16px;
|
||||
padding:0px 20px;
|
||||
padding-right:40px;
|
||||
}
|
||||
|
||||
.head-nav ul#header-nav li a {
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -5,6 +5,27 @@
|
|||
"css_prefix_text": "icon-",
|
||||
"description": "",
|
||||
"glyphs": [
|
||||
{
|
||||
"icon_id": "21568989",
|
||||
"name": "分享",
|
||||
"font_class": "fenxiang1",
|
||||
"unicode": "e89c",
|
||||
"unicode_decimal": 59548
|
||||
},
|
||||
{
|
||||
"icon_id": "21568990",
|
||||
"name": "回到顶部",
|
||||
"font_class": "huidaodingbu1",
|
||||
"unicode": "e89d",
|
||||
"unicode_decimal": 59549
|
||||
},
|
||||
{
|
||||
"icon_id": "21568993",
|
||||
"name": "帮助",
|
||||
"font_class": "bangzhu",
|
||||
"unicode": "e8a0",
|
||||
"unicode_decimal": 59552
|
||||
},
|
||||
{
|
||||
"icon_id": "991344",
|
||||
"name": "提交",
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
10
src/App.js
10
src/App.js
|
@ -17,8 +17,7 @@ import marked from './common/marked';
|
|||
import moment from 'moment'
|
||||
|
||||
import { MuiThemeProvider, createMuiTheme } from 'material-ui/styles';
|
||||
|
||||
import history from './history';
|
||||
import SiderBar from './forge/Component/SiderBar'
|
||||
|
||||
import { SnackbarHOC } from 'educoder'
|
||||
import { initAxiosInterceptors } from './AppConfig'
|
||||
|
@ -124,12 +123,6 @@ class App extends Component {
|
|||
componentDidMount() {
|
||||
document.title = "loading...";
|
||||
this.disableVideoContextMenu();
|
||||
history.listen(() => {
|
||||
this.forceUpdate()
|
||||
const $ = window.$
|
||||
$("html").animate({ scrollTop: $('html').scrollTop() - 0 })
|
||||
});
|
||||
|
||||
initAxiosInterceptors(this.props);
|
||||
this.getAppdata();
|
||||
|
||||
|
@ -212,6 +205,7 @@ class App extends Component {
|
|||
<ConfigProvider locale={zhCN}>
|
||||
<MuiThemeProvider theme={theme}>
|
||||
<LoginDialog {...this.props} {...this.state} Modifyloginvalue={() => this.Modifyloginvalue()}></LoginDialog>
|
||||
<SiderBar />
|
||||
<Router>
|
||||
<Switch>
|
||||
{/*项目*/}
|
||||
|
|
|
@ -32,7 +32,7 @@ export function initAxiosInterceptors(props) {
|
|||
// 判断网络是否连接
|
||||
initOnlineOfflineListener();
|
||||
|
||||
var proxy = "https://testforgeplus.trustie.net";
|
||||
var proxy = "http://192.168.1.37:3000";
|
||||
//响应前的设置
|
||||
axios.interceptors.request.use(
|
||||
config => {
|
||||
|
|
|
@ -192,4 +192,142 @@ li.ant-menu-item{
|
|||
border-right: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------个人主页:右侧提示区域--------------------------*/
|
||||
.-task-sidebar {
|
||||
position: fixed;
|
||||
width: 40px;
|
||||
right: 0;
|
||||
bottom: 80px;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 1920px){
|
||||
.-task-sidebar{
|
||||
right:240px;
|
||||
}
|
||||
}
|
||||
@media screen and (max-width: 1500px){
|
||||
.-task-sidebar{
|
||||
right:100px;
|
||||
}
|
||||
}
|
||||
@media screen and (max-width: 1200px){
|
||||
.-task-sidebar{
|
||||
right:0px;
|
||||
}
|
||||
}
|
||||
.-task-sidebar>div {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
box-sizing: border-box;
|
||||
width: 40px;
|
||||
color: #999;
|
||||
font-size: 20px;
|
||||
text-align: center;
|
||||
margin-bottom: 20px;
|
||||
border-radius: 50%;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0px 0px 10px 1px #F1F1F1;
|
||||
}
|
||||
|
||||
.-task-sidebar>div i {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.-task-sidebar>div:hover i {
|
||||
color: #fff !important;
|
||||
}
|
||||
.-task-sidebar>div:hover{
|
||||
background: #1890FF;
|
||||
box-shadow: 0px 0px 10px 2px #B6D0FC;
|
||||
}
|
||||
.helpBox{
|
||||
width: 260px;
|
||||
z-index: 103;
|
||||
.ant-popover-inner-content{
|
||||
padding:0px;
|
||||
}
|
||||
p.titlecontent{
|
||||
font-size: 18px;
|
||||
color: #333;
|
||||
line-height: 20px;
|
||||
padding:15px 20px;
|
||||
}
|
||||
.faqUl{
|
||||
padding:0px 20px 10px;
|
||||
max-height: 220px;
|
||||
overflow-y: auto;
|
||||
li{
|
||||
background: #F5F5F5;
|
||||
border-radius: 20px;
|
||||
padding:0px 20px;
|
||||
color: #333;
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
margin-bottom: 10px;
|
||||
a{
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
&:hover{
|
||||
background-color: #D1E9FF;
|
||||
a{
|
||||
color: #333!important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
.-task-desc {
|
||||
background: #494949;
|
||||
width: 90px;
|
||||
line-height: 36px;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
color: #fff;
|
||||
font-size: 13px;
|
||||
z-index: 999999;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.-task-desc div {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: -7px;
|
||||
height: 13px;
|
||||
}
|
||||
|
||||
.-task-desc div img {
|
||||
float: left
|
||||
}
|
||||
|
||||
.-task-sidebar .scan_ewm {
|
||||
position: absolute !important;
|
||||
right: 45px !important;
|
||||
bottom: 0px !important;
|
||||
background-color: #494949 !important;
|
||||
-webkit-box-sizing: border-box !important;
|
||||
box-sizing: border-box !important;
|
||||
font-size: 14px !important;
|
||||
line-height: 16px !important;
|
||||
display: none;
|
||||
height: 213px !important;
|
||||
}
|
||||
|
||||
.trangle_right {
|
||||
position: absolute;
|
||||
right: -5px;
|
||||
bottom: 15px;
|
||||
width: 0;
|
||||
height: 0px;
|
||||
border-top: 6px solid transparent;
|
||||
border-left: 5px solid #494949;
|
||||
border-bottom: 6px solid transparent
|
||||
}
|
||||
|
|
|
@ -0,0 +1,79 @@
|
|||
import React, { useEffect, useState } from 'react';
|
||||
import { Popover , Tooltip } from 'antd';
|
||||
import './Component.scss';
|
||||
import axios from 'axios';
|
||||
|
||||
const $ = window.$;
|
||||
|
||||
$(window).scroll(function () {
|
||||
if ($(".gotop").length > 0) {
|
||||
if ($(document).scrollTop() > 0) {
|
||||
$(".-task-sidebar .gotop").show();
|
||||
$(".gotop").click(function () {
|
||||
$("html,body").scrollTop(0);
|
||||
});
|
||||
}
|
||||
if ($(document).scrollTop() === 0) {
|
||||
$(".-task-sidebar .gotop").hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function SiderBar() {
|
||||
const [ data , setData ] = useState([]);
|
||||
|
||||
useEffect(()=>{
|
||||
getFAQ();
|
||||
},[])
|
||||
|
||||
function getFAQ(){
|
||||
const url = `/faqs.json`;
|
||||
axios.get(url).then(result=>{
|
||||
if(result && result.data){
|
||||
setData(result.data);
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}
|
||||
function content(list){
|
||||
return <div>
|
||||
<p className="titlecontent">帮助</p>
|
||||
<ul className="faqUl">
|
||||
{
|
||||
list && list.map((i,k)=>{
|
||||
return(
|
||||
<li><a href={`${i.url}`} title={i.question} target="_blank">{i.question}</a></li>
|
||||
)
|
||||
})
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
}
|
||||
return (
|
||||
<div className={"-task-sidebar"} >
|
||||
{
|
||||
data && data.length > 0 && (data[0] && data[0].question) ?
|
||||
<Popover content={content(data)} overlayClassName="helpBox" placement={"left"}>
|
||||
<div className="feedback">
|
||||
<i className="iconfont icon-bangzhu font-22"></i>
|
||||
</div>
|
||||
</Popover>
|
||||
:""
|
||||
}
|
||||
{/* <div className="scan pr" title="微信扫一扫">
|
||||
<span className="inline erweima"><i className="iconfont icon-erweima color-white font-22 fl"></i></span>
|
||||
</div>
|
||||
<div className="consult" title='在线咨询'>
|
||||
<a target="_blank" className="color_white" href="//shang.qq.com/wpa/qunwpa?idkey=2f2043d88c1bd61d182b98bf1e061c6185e23055bec832c07d8148fe11c5a6cd">
|
||||
<i className="iconfont icon-qqzaixianzixun color-white font-22"></i>
|
||||
</a>
|
||||
</div> */}
|
||||
<div className="gotop">
|
||||
<Tooltip title="返回顶部" placement={"left"}>
|
||||
<a><i className="iconfont icon-huidaodingbu1"></i></a>
|
||||
</Tooltip>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default SiderBar;
|
|
@ -51,7 +51,6 @@ class NewHeader extends Component {
|
|||
}
|
||||
}
|
||||
componentDidMount() {
|
||||
// this.getAppdata();
|
||||
this.geturlsdata();
|
||||
window._header_componentHandler = this;
|
||||
|
||||
|
@ -130,120 +129,6 @@ class NewHeader extends Component {
|
|||
old_url = newProps.Headertop.old_url
|
||||
}
|
||||
}
|
||||
getCookie = (key) => {
|
||||
var arr, reg = RegExp('(^| )' + key + '=([^;]+)(;|$)');
|
||||
if (arr === document.cookie.match(reg))
|
||||
return decodeURIComponent(arr[2]);
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
delCookie = (name) => {
|
||||
var exp = new Date();
|
||||
exp.setTime(exp.getTime() - 1);
|
||||
var cval = this.getCookie(name);
|
||||
if (cval != null) {
|
||||
document.cookie = name + "=" + cval + ";expires=" + exp.toGMTString();
|
||||
}
|
||||
}
|
||||
onLogout = () => {
|
||||
const url = `/accounts/logout.json`
|
||||
this.delCookie("autologin_trustie")
|
||||
axios.get(url, {
|
||||
}).then((response) => {
|
||||
if (response.data.status === 1) {
|
||||
this.setState({
|
||||
user: undefined
|
||||
})
|
||||
window.location.href = "/login"
|
||||
message.success('退出成功');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
tojoinclass = () => {
|
||||
let { user } = this.state;
|
||||
if (user === undefined) {
|
||||
this.setState({
|
||||
isRender: true
|
||||
})
|
||||
return
|
||||
}
|
||||
if (user && user.login === "") {
|
||||
this.setState({
|
||||
isRender: true
|
||||
})
|
||||
return;
|
||||
}
|
||||
if (user && user.profile_completed === false) {
|
||||
this.setState({
|
||||
AccountProfiletype: true
|
||||
})
|
||||
return;
|
||||
}
|
||||
this.setState({
|
||||
Addcoursestypes: true,
|
||||
})
|
||||
}
|
||||
|
||||
tojoinitem = () => {
|
||||
if (this.props.user && this.props.user.email === undefined || this.props.user && this.props.user.email === null || this.props.user && this.props.user.email === "") {
|
||||
this.openNotification("请先绑定邮箱,谢谢");
|
||||
return
|
||||
}
|
||||
let { user } = this.state;
|
||||
if (user === undefined) {
|
||||
this.setState({
|
||||
isRender: true
|
||||
})
|
||||
return
|
||||
}
|
||||
if (user && user.login === "") {
|
||||
this.setState({
|
||||
isRender: true
|
||||
})
|
||||
return;
|
||||
}
|
||||
|
||||
if (user && user.profile_completed === false) {
|
||||
this.setState({
|
||||
AccountProfiletype: true
|
||||
})
|
||||
return;
|
||||
}
|
||||
|
||||
this.setState({
|
||||
tojoinitemtype: true
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
submitstatevalue = (sum, value, data) => {
|
||||
this.setState({
|
||||
Addcoursestypes: false,
|
||||
tojoinitemtype: false,
|
||||
tojoinclasstitle: undefined,
|
||||
rolearr: ["", ""],
|
||||
Checkboxteacherchecked: false,
|
||||
Checkboxstudentchecked: false,
|
||||
Checkboxteachingchecked: false,
|
||||
Checkboxteachertype: false,
|
||||
Checkboxteachingtype: false,
|
||||
code_notice: false,
|
||||
checked_notice: false,
|
||||
submitapplicationssum: sum,
|
||||
submitapplications: true,
|
||||
submitapplicationsvalue: value,
|
||||
submitapplicationsvaluedata: data,
|
||||
RadioGroupvalue: undefined
|
||||
})
|
||||
}
|
||||
|
||||
onChangeRadioGroup = (e) => {
|
||||
this.setState({
|
||||
RadioGroupvalue: e.target.value,
|
||||
});
|
||||
}
|
||||
|
||||
submitsubmitapplications = () => {
|
||||
let {
|
||||
|
@ -402,39 +287,13 @@ class NewHeader extends Component {
|
|||
})
|
||||
}
|
||||
|
||||
getAppdata = () => {
|
||||
try {
|
||||
var chromesettingArray = JSON.parse(localStorage.getItem('chromesetting'));
|
||||
var chromesettingresponseArray = JSON.parse(localStorage.getItem('chromesettingresponse'));
|
||||
this.setState({
|
||||
settings: chromesettingArray
|
||||
});
|
||||
if (chromesettingArray.tab_logo_url) {
|
||||
this.gettablogourldata(chromesettingresponseArray);
|
||||
} else {
|
||||
this.gettablogourlnull();
|
||||
}
|
||||
} catch (e) {
|
||||
this.geturlsdata();
|
||||
}
|
||||
};
|
||||
|
||||
geturlsdata = () => {
|
||||
let url = "/setting.json";
|
||||
axios.get(url).then((response) => {
|
||||
if (response && response.data) {
|
||||
this.setState({ settings: response.data.setting });
|
||||
// localStorage.setItem('chromesetting', JSON.stringify(response.data.setting));
|
||||
// localStorage.setItem('chromesettingresponse', JSON.stringify(response));
|
||||
try {
|
||||
if (response.data.setting.tab_logo_url) {
|
||||
this.gettablogourldata(response);
|
||||
} else {
|
||||
this.gettablogourlnull();
|
||||
}
|
||||
} catch (e) {
|
||||
this.gettablogourlnull();
|
||||
}
|
||||
localStorage.setItem('chromesetting', JSON.stringify(response.data.setting));
|
||||
localStorage.setItem('chromesettingresponse', JSON.stringify(response));
|
||||
} else {
|
||||
this.gettablogourlnull();
|
||||
}
|
||||
|
@ -555,7 +414,7 @@ class NewHeader extends Component {
|
|||
let shixun = "/shixuns";
|
||||
let paths = "/paths";
|
||||
let courses = "/courses";
|
||||
this.props.mygetHelmetapi.navbar.map((item, key) => {
|
||||
this.props.mygetHelmetapi && this.props.mygetHelmetapi.navbar && this.props.mygetHelmetapi.navbar.map((item, key) => {
|
||||
var reg = RegExp(item.link);
|
||||
if (shixun.match(reg)) {
|
||||
if (item.hidden === true) {
|
||||
|
@ -593,19 +452,19 @@ class NewHeader extends Component {
|
|||
{...this.props}
|
||||
{...this.state}
|
||||
/> : ""}
|
||||
{
|
||||
goshowqqgtounp === true ?
|
||||
<GotoQQgroup {...this.state} {...this.props} setgoshowqqgtounp={(bool) => this.setgoshowqqgtounp(bool)}></GotoQQgroup>
|
||||
:""
|
||||
}
|
||||
<a href={settings && settings.new_course.default_url} className={"fl mr30"} style={{minWidth:"45px"}}>
|
||||
{
|
||||
goshowqqgtounp === true ?
|
||||
<GotoQQgroup {...this.state} {...this.props} setgoshowqqgtounp={(bool) => this.setgoshowqqgtounp(bool)}></GotoQQgroup>
|
||||
:""
|
||||
}
|
||||
{
|
||||
settings && settings.nav_logo_url ?
|
||||
<img alt="可控开源社区" className="logoimg" style={{ heigth: "40px" }} src={getImageUrl(`/${settings.nav_logo_url}`)}></img>
|
||||
<a href={settings && settings.new_course.default_url} className={"fl mr50"} style={{minWidth:"45px"}}>
|
||||
<img alt="可控开源社区" className="logoimg" style={{ heigth: "40px" }} src={getImageUrl(`/${settings.nav_logo_url}`)}></img>
|
||||
</a>
|
||||
:
|
||||
<img alt="可控开源社区" className="logoimg" style={{ heigth: "40px" }} src={logo}></img>
|
||||
""
|
||||
}
|
||||
</a>
|
||||
<div className="head-nav pr" id={"head-navpre1"}>
|
||||
{
|
||||
settings && settings.navbar && settings.navbar.length > 0 ?
|
||||
|
|
|
@ -31,6 +31,14 @@ const Infos = Loadable({
|
|||
loading: Loading,
|
||||
});
|
||||
class Index extends Component {
|
||||
|
||||
componentDidUpdate=()=>{
|
||||
this.props.history.listen(()=>{
|
||||
if (document.body.scrollTop || document.documentElement.scrollTop > 0) {
|
||||
window.scrollTo(0, 0)
|
||||
}
|
||||
})
|
||||
}
|
||||
render() {
|
||||
return (
|
||||
<div className="newMain clearfix">
|
||||
|
|
|
@ -389,7 +389,7 @@ function CoderDepot(props){
|
|||
website &&
|
||||
<p className="color-grey-6 df">
|
||||
<i className="iconfont icon-lianjie2 font-15 mr10 color-grey-9"></i>
|
||||
<a href={website} target="_blank" style={{wordBreak:"break-all",lineHeight:"20px",marginTop:"5px",textDecoration:"underline"}}>{website}</a>
|
||||
<a href={website} className="color-grey-6" target="_blank" style={{wordBreak:"break-all",lineHeight:"20px",marginTop:"5px",textDecoration:"underline"}}>{website}</a>
|
||||
</p>
|
||||
}
|
||||
<p>
|
||||
|
@ -397,13 +397,13 @@ function CoderDepot(props){
|
|||
<a href="#readme" className="color-grey-6">README.md</a>
|
||||
</p>
|
||||
<p className="color-grey-6">
|
||||
<i className="iconfont icon-dataBase font-15 mr10 color-grey-9"></i>
|
||||
<i className="iconfont icon-dataBase font-15 mr10 color-grey-6"></i>
|
||||
<span>{projectDetail && projectDetail.size}</span>
|
||||
</p>
|
||||
{
|
||||
projectDetail && projectDetail.license_name &&
|
||||
<p className="color-grey-6">
|
||||
<i className="iconfont icon-tianping font-16 mr10 color-grey-9"></i>
|
||||
<i className="iconfont icon-tianping font-16 mr10 color-grey-3"></i>
|
||||
<span>{projectDetail.license_name}</span>
|
||||
</p>
|
||||
}
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
import React, { Component } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { Menu, Input , Spin, Pagination , Popover , Select } from 'antd';
|
||||
import Slider from "react-slick";
|
||||
import { getImageUrl } from 'educoder';
|
||||
import "slick-carousel/slick/slick.css";
|
||||
import "slick-carousel/slick/slick-theme.css";
|
||||
import '../css/index.scss'
|
||||
import './list.css';
|
||||
import './Index.scss';
|
||||
|
@ -30,6 +33,8 @@ class Index extends Component {
|
|||
categoryList: undefined,
|
||||
recommendList:undefined,
|
||||
|
||||
recommendOriList:undefined,
|
||||
|
||||
languageList:undefined,
|
||||
languageId:undefined
|
||||
}
|
||||
|
@ -47,6 +52,8 @@ class Index extends Component {
|
|||
this.getRecommand();
|
||||
|
||||
this.getLanguage();
|
||||
|
||||
// this.getRecommandOri();
|
||||
}
|
||||
|
||||
// 获取语言列表
|
||||
|
@ -72,6 +79,17 @@ class Index extends Component {
|
|||
}).catch(error=>{})
|
||||
}
|
||||
|
||||
getRecommandOri=()=>{
|
||||
const url = `/organizations/recommend.json`;
|
||||
axios.get(url).then(result=>{
|
||||
if(result){
|
||||
this.setState({
|
||||
recommendOriList:result.data.organizations
|
||||
})
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}
|
||||
|
||||
// 获取列表
|
||||
getListData = (page, limit, search, sort, project_type, category_id,languageId) => {
|
||||
const { current_user } = this.props;
|
||||
|
@ -256,22 +274,56 @@ class Index extends Component {
|
|||
const { current_user } = this.props;
|
||||
|
||||
const { projectsList , recommendList , languageList , languageId ,
|
||||
isSpin, total, search, limit, page, typeList, categoryList } = this.state;
|
||||
isSpin, total, search, limit, page, typeList, categoryList , recommendOriList } = this.state;
|
||||
|
||||
const setting={
|
||||
dots: true,
|
||||
infinite: true,
|
||||
speed: 500,
|
||||
slidesToShow: 5,
|
||||
slidesToScroll: 5,
|
||||
autoplay:false,
|
||||
arrows:false,
|
||||
adaptiveHeight:true
|
||||
}
|
||||
const settings={
|
||||
dots: true,
|
||||
infinite: true,
|
||||
speed: 500,
|
||||
slidesToShow: 6,
|
||||
slidesToScroll: 6,
|
||||
autoplay:false,
|
||||
arrows:false,
|
||||
adaptiveHeight:true
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<p className="t_project_banner">
|
||||
<img src={banner} width="100%" alt=""/>
|
||||
</p>
|
||||
{/* {
|
||||
recommendOriList && recommendOriList.length>0?
|
||||
<Slider {...settings} className="recommandOri">
|
||||
{
|
||||
recommendOriList.map((i,k)=>{
|
||||
return(
|
||||
<li><Link to={''}><img src={getImageUrl(`/${i.avatar_url}`)} alt={i.name} title={i.name} width="80px"/></Link></li>
|
||||
)
|
||||
})
|
||||
}
|
||||
</Slider>
|
||||
:""
|
||||
} */}
|
||||
{
|
||||
recommendList && recommendList.length>0 &&
|
||||
<div className="recommandProjects">
|
||||
<Slider {...setting} className={recommendList.length>5 ? "recommandProjects":"recommandProjects mb20"}>
|
||||
{
|
||||
recommendList.map((item,key)=>{
|
||||
return(
|
||||
<div onClick={()=>this.getoDetail(item.author && item.author.login,item.identifier)}>
|
||||
<div className="items" onClick={()=>this.getoDetail(item.author && item.author.login,item.identifier)}>
|
||||
<div className="mainInfo">
|
||||
<img src={getImageUrl(`/${item.author && item.author.image_url}`)} alt=""/>
|
||||
<img src={getImageUrl(`/${item.author && item.author.image_url}`)} width="50px" height="50px"alt=""/>
|
||||
<p className="school">{item.name}</p>
|
||||
<p className="name">{item.author && item.author.name}</p>
|
||||
</div>
|
||||
|
@ -283,9 +335,8 @@ class Index extends Component {
|
|||
)
|
||||
})
|
||||
}
|
||||
</div>
|
||||
</Slider>
|
||||
}
|
||||
|
||||
<div className="ProjectListIndex">
|
||||
<div className="list-left">
|
||||
<ul className="list-l-Menu">
|
||||
|
|
|
@ -1,57 +1,53 @@
|
|||
.recommandOri.slick-slider{
|
||||
width: 1300px;
|
||||
margin:20px auto 40px;
|
||||
.slick-track{
|
||||
margin-left: 0px;
|
||||
}
|
||||
.slick-slide{
|
||||
li > a{
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* recommandProjects */
|
||||
.recommandProjects{
|
||||
display: flex;
|
||||
max-width: 1200px;
|
||||
margin:20px auto;
|
||||
}
|
||||
.recommandProjects >div{
|
||||
background-color: #fff;
|
||||
border-radius: 10px;
|
||||
width: 220px;
|
||||
margin-right: 25px;
|
||||
cursor: pointer;
|
||||
border: 1px solid #eee;
|
||||
&:last-child{
|
||||
margin-right: 0px;
|
||||
.recommandProjects.slick-slider{
|
||||
width: 1230px;
|
||||
margin:20px auto 40px;
|
||||
.slick-track{
|
||||
margin-left: 0px;
|
||||
}
|
||||
}
|
||||
.recommandProjects > div:hover{
|
||||
box-shadow: 0px 2px 20px 0px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.recommandProjects > div .mainInfo{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 160px;
|
||||
border-bottom: 1px solid #eee;
|
||||
padding:20px;
|
||||
box-sizing: border-box;
|
||||
img{
|
||||
height: 50px;
|
||||
width:50px;
|
||||
border-radius: 50%;
|
||||
.slick-arrow.slick-prev,.slick-arrow.slick-next{
|
||||
&:before{
|
||||
color: #999;
|
||||
}
|
||||
li.slick-active button:before{
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
.name{
|
||||
font-size: 13px;
|
||||
color: #666;
|
||||
height: 18px;
|
||||
line-height: 18px;
|
||||
margin-top:12px;
|
||||
.slick-dots{
|
||||
bottom: -29px;
|
||||
li button:before{
|
||||
color: #909090;
|
||||
}
|
||||
}
|
||||
.school{
|
||||
margin-top:12px;
|
||||
color: #333;
|
||||
font-size: 16px;
|
||||
height: 22px;
|
||||
line-height: 22px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
max-width:100%;
|
||||
.slick-slide{
|
||||
padding:0px 15px;
|
||||
box-sizing: border-box;
|
||||
& > div{
|
||||
background-color: #fff;
|
||||
border-radius: 10px;
|
||||
width: 100%;
|
||||
cursor: pointer;
|
||||
border: 1px solid #eee;
|
||||
&:hover{
|
||||
box-shadow: 0px 2px 20px 0px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.recommandProjects{
|
||||
.baseInfo{
|
||||
padding:18px 15px;
|
||||
display: flex;
|
||||
|
@ -72,6 +68,39 @@
|
|||
text-align: right;
|
||||
}
|
||||
}
|
||||
.mainInfo{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 160px;
|
||||
border-bottom: 1px solid #eee;
|
||||
padding:20px;
|
||||
box-sizing: border-box;
|
||||
img{
|
||||
height: 50px;
|
||||
width:50px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.name{
|
||||
font-size: 13px;
|
||||
color: #666;
|
||||
height: 18px;
|
||||
line-height: 18px;
|
||||
margin-top:12px;
|
||||
}
|
||||
.school{
|
||||
margin-top:12px;
|
||||
color: #333;
|
||||
font-size: 16px;
|
||||
height: 22px;
|
||||
line-height: 22px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
max-width:100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// coderDepot
|
||||
|
|
|
@ -46,11 +46,13 @@ class IndexItem extends Component {
|
|||
: ""
|
||||
}
|
||||
{
|
||||
item.type && item.type !== 0 ?
|
||||
item.type === 2 ?
|
||||
item.type && item.type === 2 ?
|
||||
<Tooltip title="该项目是一个镜像" className="ml5">
|
||||
<i className="iconfont icon-banbenku font-18 color-green" />
|
||||
</Tooltip>:
|
||||
</Tooltip>:""
|
||||
}
|
||||
{
|
||||
item.type && item.type === 1 ?
|
||||
<span className="ml5">
|
||||
<i className="iconfont icon-jingxiang font-18 color-green" />
|
||||
</span>:""
|
||||
|
@ -65,8 +67,6 @@ class IndexItem extends Component {
|
|||
|
||||
<div className="p-r-about">
|
||||
<span className="p-r-detail">
|
||||
{/* <span><label>浏览量:</label>{item.visits}</span> */}
|
||||
{/* {item.category && item.category.id && <span>{item.category.name}</span>} */}
|
||||
{item.last_update_time ? <span><label>更新于</label>{item.time_ago}</span> : ""}
|
||||
{item.language && item.language.id ? <span className="color-grey-3">{item.language.name}</span> : ""}
|
||||
</span>
|
||||
|
|
|
@ -42,7 +42,7 @@ function Contribute(props){
|
|||
<WhiteBack>
|
||||
<Spin spinning={isSpin}>
|
||||
<div className="boxPanel">
|
||||
<p className="font-18 mb20">贡献者列表</p>
|
||||
<p className="font-18 padding10-20" style={{borderBottom:"1px solid #eee"}}>贡献者列表</p>
|
||||
{
|
||||
list && list.length > 0 ?
|
||||
<div className="contrbuteList">
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
.boxPanel{
|
||||
width: 1200px;
|
||||
margin:0px auto;
|
||||
padding:20px 0px;
|
||||
margin:20px auto;
|
||||
border-radius: 4px;
|
||||
border:1px solid #eee;
|
||||
min-height: 500px;
|
||||
.contrbuteList{
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
padding:20px;
|
||||
& > div{
|
||||
width: 20%;
|
||||
}
|
||||
|
|
|
@ -67,6 +67,11 @@ class Infos extends Component {
|
|||
if(prevUser && username && prevUser !== username){
|
||||
this.fetchUser();
|
||||
}
|
||||
this.props.history.listen(()=>{
|
||||
if (document.body.scrollTop || document.documentElement.scrollTop > 0) {
|
||||
window.scrollTo(0, 0)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fetchUser = () => {
|
||||
|
|
|
@ -13,6 +13,7 @@ configureUrlQuery({ history });
|
|||
window.__useKindEditor = false;
|
||||
|
||||
|
||||
|
||||
const render = (Component) => {
|
||||
ReactDOM.render(
|
||||
<AppContainer >
|
||||
|
|
|
@ -1,79 +0,0 @@
|
|||
import React, { Component } from 'react';
|
||||
import './TPMIndex.css';
|
||||
|
||||
const $ = window.$;
|
||||
|
||||
$(window).resize(function () {
|
||||
rightSlider();
|
||||
});
|
||||
|
||||
$(window).scroll(function () {
|
||||
if ($(".gotop").length > 0) {
|
||||
if ($(document).scrollTop() > 0) {
|
||||
$(".-task-sidebar .gotop").show();
|
||||
$(".gotop").click(function () {
|
||||
$("html,body").scrollTop(0);
|
||||
});
|
||||
}
|
||||
if ($(document).scrollTop() == 0) {
|
||||
$(".-task-sidebar .gotop").hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function rightSlider() {
|
||||
var poi = parseInt((parseInt($(window).width()) - 1200) / 2) - 81;
|
||||
// console.log(parseInt($(window).width())+" "+poi);
|
||||
if (poi > 0) {
|
||||
$(".-task-sidebar").css("right", poi);
|
||||
} else {
|
||||
$(".-task-sidebar").css("right", "0px");
|
||||
}
|
||||
$(".-task-sidebar").show();
|
||||
}
|
||||
|
||||
|
||||
class SiderBar extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
|
||||
<div className={"-task-sidebar"} >
|
||||
|
||||
{this.props.mygetHelmetapi && this.props.mygetHelmetapi.main_site === true ? <div>
|
||||
|
||||
<div className="gotop" title="返回顶部">
|
||||
<a>
|
||||
<i className="iconfont icon-shangjiantou color-white"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div className="feedback" title="意见反馈">
|
||||
<a target="_blank" className="color_white" href="/help/feedback">
|
||||
<i className="iconfont icon-yijianfankui color-white font-22"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div className="scan pr" title="微信扫一扫">
|
||||
<span className="inline erweima"><i className="iconfont icon-erweima color-white font-22 fl"></i></span>
|
||||
</div>
|
||||
|
||||
|
||||
<div className="consult" title='在线咨询'>
|
||||
<a target="_blank" className="color_white" href="//shang.qq.com/wpa/qunwpa?idkey=2f2043d88c1bd61d182b98bf1e061c6185e23055bec832c07d8148fe11c5a6cd">
|
||||
<i className="iconfont icon-qqzaixianzixun color-white font-22"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
</div> : ""}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default SiderBar;
|
|
@ -135,88 +135,6 @@ body>.-task-title {
|
|||
height: 60px !important;
|
||||
}
|
||||
|
||||
/*-------------------个人主页:右侧提示区域--------------------------*/
|
||||
.-task-sidebar {
|
||||
position: fixed;
|
||||
width: 40px;
|
||||
height: 180px;
|
||||
right: 0;
|
||||
bottom: 20px !important;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.-task-sidebar>div {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
box-sizing: border-box;
|
||||
width: 40px;
|
||||
background: #4CACFF;
|
||||
color: #fff;
|
||||
font-size: 20px;
|
||||
text-align: center;
|
||||
margin-bottom: 5px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.-task-sidebar>div i {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.-task-sidebar>div i:hover {
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
.gotop {
|
||||
background-color: rgba(208, 207, 207, 0.5) !important;
|
||||
padding: 0px !important;
|
||||
}
|
||||
|
||||
.-task-desc {
|
||||
background: #494949;
|
||||
width: 90px;
|
||||
line-height: 36px;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
color: #fff;
|
||||
font-size: 13px;
|
||||
z-index: 999999;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.-task-desc div {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: -7px;
|
||||
height: 13px;
|
||||
}
|
||||
|
||||
.-task-desc div img {
|
||||
float: left
|
||||
}
|
||||
|
||||
.-task-sidebar .scan_ewm {
|
||||
position: absolute !important;
|
||||
right: 45px !important;
|
||||
bottom: 0px !important;
|
||||
background-color: #494949 !important;
|
||||
-webkit-box-sizing: border-box !important;
|
||||
box-sizing: border-box !important;
|
||||
font-size: 14px !important;
|
||||
line-height: 16px !important;
|
||||
display: none;
|
||||
height: 213px !important;
|
||||
}
|
||||
|
||||
.trangle_right {
|
||||
position: absolute;
|
||||
right: -5px;
|
||||
bottom: 15px;
|
||||
width: 0;
|
||||
height: 0px;
|
||||
border-top: 6px solid transparent;
|
||||
border-left: 5px solid #494949;
|
||||
border-bottom: 6px solid transparent
|
||||
}
|
||||
|
||||
.HeaderSearch {
|
||||
margin-top: 18px;
|
||||
|
|
Loading…
Reference in New Issue