forked from Gitlink/forgeplus-react
合并首页修改
This commit is contained in:
commit
7ad822ba0f
|
|
@ -1,6 +1,6 @@
|
|||
import React from "react";
|
||||
import md5 from 'md5';
|
||||
import {Input} from "antd";
|
||||
import { Input } from "antd";
|
||||
const { Search } = Input;
|
||||
|
||||
const $ = window.$;
|
||||
|
|
@ -24,14 +24,14 @@ export function getImageUrl(path) {
|
|||
export function getImage(path) {
|
||||
// https://www.educoder.net
|
||||
// https://testbdweb.trustie.net
|
||||
// const local = 'http://localhost:3000'
|
||||
// const local = 'http://localhost:3000'
|
||||
const local = 'http://39.105.176.215:49999';
|
||||
if(path.indexOf("http://")===-1){
|
||||
if (path&&path.indexOf("http://") === -1) {
|
||||
if (isDev) {
|
||||
return `${local}/images/${path}`
|
||||
}
|
||||
return `/${path}`;
|
||||
}else{
|
||||
} else {
|
||||
return path;
|
||||
}
|
||||
}
|
||||
|
|
@ -39,14 +39,14 @@ export function getImage(path) {
|
|||
export function getTestImage(path) {
|
||||
// https://www.educoder.net
|
||||
// https://testbdweb.trustie.net
|
||||
// const local = 'http://localhost:3000'
|
||||
// const local = 'http://localhost:3000'
|
||||
const local = 'http://117.50.100.12:49999';
|
||||
if(path.indexOf("http://")===-1){
|
||||
if (path && path.indexOf("http://") === -1) {
|
||||
if (isDev) {
|
||||
return `${local}${path}`
|
||||
}
|
||||
return `${path}`;
|
||||
}else{
|
||||
} else {
|
||||
return path;
|
||||
}
|
||||
}
|
||||
|
|
@ -63,33 +63,33 @@ export function getLogoImageUrl(path) {
|
|||
export function getcdnImageUrl(path) {
|
||||
// https://www.educoder.net
|
||||
// https://testbdweb.trustie.net
|
||||
// const local = 'http://localhost:3000'
|
||||
const testlocal = 'https://testali-cdn.educoder.net'
|
||||
const local='https://ali-cdn.educoder.net'
|
||||
let firstStr=path.substr(0,1);
|
||||
// const local = 'http://localhost:3000'
|
||||
const testlocal = 'https://testali-cdn.educoder.net'
|
||||
const local = 'https://ali-cdn.educoder.net'
|
||||
let firstStr = path.substr(0, 1);
|
||||
if (isdev2) {
|
||||
return `${local}/${path}`;
|
||||
}else{
|
||||
if(firstStr=="/"){
|
||||
} else {
|
||||
if (firstStr == "/") {
|
||||
return `${path}`
|
||||
}else{
|
||||
} else {
|
||||
return `/${path}`
|
||||
}
|
||||
}
|
||||
// return `${local}/${path}`;
|
||||
}
|
||||
|
||||
export function setcndImagesUrl(path){
|
||||
export function setcndImagesUrl(path) {
|
||||
const testlocal = 'https://testali-cdn.educoder.net'
|
||||
const local='https://ali-cdn.educoder.net'
|
||||
let firstStr=path.substr(0,1);
|
||||
if(firstStr=="/"){
|
||||
const local = 'https://ali-cdn.educoder.net'
|
||||
let firstStr = path.substr(0, 1);
|
||||
if (firstStr == "/") {
|
||||
if (!isdev2) {
|
||||
return `${path}`
|
||||
}
|
||||
return `${local}${path}`;
|
||||
//return isDev?`${testlocal}${path}`:`${local}${path}`;
|
||||
}else{
|
||||
//return isDev?`${testlocal}${path}`:`${local}${path}`;
|
||||
} else {
|
||||
if (!isdev2) {
|
||||
return `/${path}`
|
||||
}
|
||||
|
|
@ -100,31 +100,31 @@ export function setcndImagesUrl(path){
|
|||
|
||||
|
||||
|
||||
export function setImagesUrl(path){
|
||||
export function setImagesUrl(path) {
|
||||
const testlocal = 'https://testali-cdn.educoder.net'
|
||||
const local='https://ali-cdn.educoder.net'
|
||||
let firstStr=path.substr(0,1);
|
||||
if(firstStr=="/"){
|
||||
const local = 'https://ali-cdn.educoder.net'
|
||||
let firstStr = path.substr(0, 1);
|
||||
if (firstStr == "/") {
|
||||
if (!isdev2) {
|
||||
return `${path}`
|
||||
}
|
||||
return `${local}${path}`;
|
||||
// return isDev?`${testlocal}${path}`:`${path}`;
|
||||
}else{
|
||||
} else {
|
||||
if (!isdev2) {
|
||||
return `/${path}`
|
||||
}
|
||||
return `${local}/${path}`;
|
||||
//return isDev?`${testlocal}/${path}`:`/${path}`;
|
||||
//return isDev?`${testlocal}/${path}`:`/${path}`;
|
||||
}
|
||||
}
|
||||
|
||||
export function getUrl(path, goTest) {
|
||||
const local = 'http://39.105.176.215:49999'
|
||||
if (isDev) {
|
||||
return `${local}${path?path:''}`
|
||||
return `${local}${path ? path : ''}`
|
||||
}
|
||||
return `${path ? path: ''}`;
|
||||
return `${path ? path : ''}`;
|
||||
}
|
||||
|
||||
export function getUrlmys(path, goTest) {
|
||||
|
|
@ -138,9 +138,9 @@ export function getUrlmys(path, goTest) {
|
|||
// const local = 'https://testeduplus2.educoder.net'
|
||||
const local = 'https://test-jupyterweb.educoder.net'
|
||||
if (isDev) {
|
||||
return `${local}${path?path:''}`
|
||||
return `${local}${path ? path : ''}`
|
||||
}
|
||||
return `${path ? path: ''}`;
|
||||
return `${path ? path : ''}`;
|
||||
}
|
||||
export function getStaticUrl() {
|
||||
const local = TEST_HOST;
|
||||
|
|
@ -151,27 +151,29 @@ export function getStaticUrl() {
|
|||
return ''
|
||||
}
|
||||
export function getUrl2(path, goTest) {
|
||||
const local = 'http://localhost:3000'
|
||||
const local = 'http://localhost:3000'
|
||||
if (isDev) {
|
||||
return `${local}${path?path:''}`
|
||||
return `${local}${path ? path : ''}`
|
||||
}
|
||||
return `${path ? path: ''}`;
|
||||
return `${path ? path : ''}`;
|
||||
}
|
||||
const newopens ="79e33abd4b6588941ab7622aed1e67e8";
|
||||
const newopens = "79e33abd4b6588941ab7622aed1e67e8";
|
||||
let newtimestamp;
|
||||
let checkSubmitFlgs = false;
|
||||
function railsgettimess(proxy) {
|
||||
if(checkSubmitFlgs===false){
|
||||
$.ajax({url:proxy,
|
||||
async:false,success:function(data){
|
||||
if(data.status===0){
|
||||
newtimestamp=data.message;
|
||||
if (checkSubmitFlgs === false) {
|
||||
$.ajax({
|
||||
url: proxy,
|
||||
async: false, success: function (data) {
|
||||
if (data.status === 0) {
|
||||
newtimestamp = data.message;
|
||||
checkSubmitFlgs = true;
|
||||
}
|
||||
}})
|
||||
}
|
||||
})
|
||||
|
||||
window.setTimeout(function () {
|
||||
checkSubmitFlgs=false;
|
||||
checkSubmitFlgs = false;
|
||||
}, 2500);
|
||||
}
|
||||
}
|
||||
|
|
@ -214,8 +216,8 @@ export function getUploadActionUrlOfAuth(id) {
|
|||
}
|
||||
|
||||
export function getRandomNumber(type) {
|
||||
let anewopens=md5(newopens+newtimestamp);
|
||||
return type===true?`randomcode=${newtimestamp}&client_key=${anewopens}`:`?randomcode=${newtimestamp}&client_key=${anewopens}`
|
||||
let anewopens = md5(newopens + newtimestamp);
|
||||
return type === true ? `randomcode=${newtimestamp}&client_key=${anewopens}` : `?randomcode=${newtimestamp}&client_key=${anewopens}`
|
||||
}
|
||||
|
||||
export function test(path) {
|
||||
|
|
@ -249,20 +251,20 @@ export function htmlEncode(str) {
|
|||
return s;
|
||||
}
|
||||
|
||||
export function publicSearchs(Placeholder,onSearch,onInputs,onChanges,loadings) {
|
||||
return(<Search
|
||||
placeholder= { Placeholder || "请输入内容进行搜索" }
|
||||
export function publicSearchs(Placeholder, onSearch, onInputs, onChanges, loadings) {
|
||||
return (<Search
|
||||
placeholder={Placeholder || "请输入内容进行搜索"}
|
||||
onSearch={onSearch}
|
||||
// value={searchValue}
|
||||
onInput={onInputs}
|
||||
onChange={onChanges}
|
||||
loading={loadings||false}
|
||||
loading={loadings || false}
|
||||
allowClear={true}
|
||||
></Search>)
|
||||
}
|
||||
|
||||
export function getUrlToken(name, str) {
|
||||
const reg = new RegExp(`(^|&)${ name}=([^&]*)(&|$)`);
|
||||
const r = str.substr(1).match(reg);
|
||||
if (r != null) return decodeURIComponent(r[2]); return null;
|
||||
const reg = new RegExp(`(^|&)${name}=([^&]*)(&|$)`);
|
||||
const r = str.substr(1).match(reg);
|
||||
if (r != null) return decodeURIComponent(r[2]); return null;
|
||||
}
|
||||
|
|
@ -5,7 +5,7 @@ import './Component.scss';
|
|||
export default (()=>{
|
||||
return(
|
||||
<div className="handleBox">
|
||||
<a href="https://forum.trustie.net/forums/3075/detail" target="_blank" >
|
||||
<a href="https://www.osredm.com/forums/594/detail" target="_blank" >
|
||||
<img src={Handbook} alt=""/>
|
||||
</a>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ function FifthSection({ fifth, history }) {
|
|||
|
||||
<div className="task-main">
|
||||
<h2 className="homePage-blue-tit">创客空间</h2>
|
||||
<h4 className="homePage-subhead">开源项目版块集项目托管、版本管理等功能于一体,为开源协作和群智汇聚提供创作环境</h4>
|
||||
<h4 className="homePage-subhead">创客空间版块面向大众智慧群体征集技术成果、创意概念和解决方案,实现供需高效对接</h4>
|
||||
<Line />
|
||||
<Collapse
|
||||
accordion
|
||||
|
|
|
|||
|
|
@ -9,18 +9,18 @@ $bgcolorlist:#254dea #e33230 #0766fb #f02c66 #6038ff #f85e55 #c13cff #2cb840 #57
|
|||
|
||||
.fifth-main {
|
||||
display: flex;
|
||||
margin: 5vh auto 3vh;
|
||||
margin: 5vh auto 0;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.homepage-btn {
|
||||
margin-bottom: 10vh;
|
||||
margin-bottom: 8vh;
|
||||
}
|
||||
|
||||
.circle-wave {
|
||||
position: relative;
|
||||
width: 37.5em;
|
||||
height: 43.75em;
|
||||
height: 42.75em;
|
||||
flex: none;
|
||||
|
||||
&:hover .icon-circle {
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ let setting = {
|
|||
}
|
||||
|
||||
|
||||
function SecondSection({ second ,main_web_site_url}) {
|
||||
function SecondSection({ second ,main_web_site_url ,btnUrl}) {
|
||||
|
||||
const [leftItem, setLeftItem] = useState({});
|
||||
const [list, setList] = useState([]);
|
||||
|
|
@ -56,7 +56,7 @@ function SecondSection({ second ,main_web_site_url}) {
|
|||
return (
|
||||
<React.Fragment>
|
||||
<h2 className="homePage-blue-tit">社区动态</h2>
|
||||
<h4 className="homePage-subhead">为社区用户提供自主交流空间,实现思维碰撞和智慧融合</h4>
|
||||
<h4 className="homePage-subhead">关注开源热点资讯与技术,分享红山观点与活动</h4>
|
||||
<Line />
|
||||
<div className="homepage-main community-main">
|
||||
|
||||
|
|
@ -77,7 +77,7 @@ function SecondSection({ second ,main_web_site_url}) {
|
|||
</div>
|
||||
|
||||
<div className="text-center">
|
||||
<Button className="homepage-btn" type="primary" onClick={() => { window.open(`${main_web_site_url}/forums`)}}>更多动态 <i className="iconfont icon-gengduoicon"></i></Button>
|
||||
<Button className="homepage-btn" type="primary" onClick={() => { window.open(btnUrl)}}>更多动态 <i className="iconfont icon-gengduoicon"></i></Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ let setting = {
|
|||
}
|
||||
|
||||
|
||||
function SeventhSection({ main_web_site_url }) {
|
||||
function SeventhSection({ main_web_site_url,btnUrl }) {
|
||||
|
||||
const [list, setList] = useState([]);
|
||||
|
||||
|
|
@ -79,7 +79,7 @@ function SeventhSection({ main_web_site_url }) {
|
|||
|
||||
</Slider>
|
||||
|
||||
<Button className="homepage-btn" type="primary" onClick={() => { window.open(`${main_web_site_url}/forums`) }}>参与交流 <i className="iconfont icon-gengduoicon"></i></Button>
|
||||
<Button className="homepage-btn" type="primary" onClick={() => { window.open(btnUrl) }}>参与交流 <i className="iconfont icon-gengduoicon"></i></Button>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -159,21 +159,21 @@
|
|||
.issue-content {
|
||||
text-align: left;
|
||||
text-indent: 2em;
|
||||
font-size: 15px;
|
||||
font-size: 0.95em;
|
||||
font-weight: 400;
|
||||
color: #3c476e;
|
||||
line-height: 28px;
|
||||
line-height: 1.75em;
|
||||
}
|
||||
.issue-time {
|
||||
height: 28px;
|
||||
font-size: 15px;
|
||||
height: 1.75em;
|
||||
font-size: 0.95em;
|
||||
color: #3c476e;
|
||||
line-height: 28px;
|
||||
line-height: 1.75em;
|
||||
}
|
||||
}
|
||||
|
||||
.homepage-btn {
|
||||
margin-top: 50px;
|
||||
margin-top: 3.125em;
|
||||
}
|
||||
|
||||
@keyframes zoomin {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ import './index.scss';
|
|||
let iconArr = [completeIcon1, completeIcon2, completeIcon3];
|
||||
|
||||
|
||||
function SixthSection({ sixth, main_web_site_url }) {
|
||||
function SixthSection({ sixth, main_web_site_url,btnUrl }) {
|
||||
|
||||
const [list, setList] = useState();
|
||||
|
||||
|
|
@ -78,7 +78,7 @@ function SixthSection({ sixth, main_web_site_url }) {
|
|||
|
||||
</div>
|
||||
|
||||
<Button className="homepage-btn" type="primary" onClick={() => { window.open(`${main_web_site_url}/competitions`) }}>我要参赛 <i className="iconfont icon-gengduoicon"></i></Button>
|
||||
<Button className="homepage-btn" type="primary" onClick={() => { window.open(btnUrl) }}>我要参赛 <i className="iconfont icon-gengduoicon"></i></Button>
|
||||
<svg className="waves"
|
||||
viewBox="0 24 150 28" preserveAspectRatio="none" shapeRendering="auto">
|
||||
<defs>
|
||||
|
|
|
|||
|
|
@ -33,6 +33,18 @@ function HomePage({ history }) {
|
|||
|
||||
let settings = JSON.parse(localStorage.chromesetting);
|
||||
let main_web_site_url = settings.main_web_site_url;
|
||||
let forumUrl ="";
|
||||
let competitionUrl ="";
|
||||
if(settings.navbar){
|
||||
for (const item of settings.navbar){
|
||||
if(item.name.indexOf("论坛")>-1){
|
||||
forumUrl=item.link;
|
||||
}
|
||||
if(item.name.indexOf("竞赛")>-1){
|
||||
competitionUrl=item.link;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function scrollListener() {
|
||||
|
|
@ -120,7 +132,7 @@ function HomePage({ history }) {
|
|||
|
||||
|
||||
<div id="home-second-section" className="home-second-section">
|
||||
<SecondSection second={second} main_web_site_url={main_web_site_url} />
|
||||
<SecondSection second={second} main_web_site_url={main_web_site_url} btnUrl={forumUrl}/>
|
||||
</div>
|
||||
|
||||
|
||||
|
|
@ -137,11 +149,11 @@ function HomePage({ history }) {
|
|||
</div>
|
||||
|
||||
<div id="home-sixth-section" className="home-sixth-section">
|
||||
<SixthSection sixth={sixth} main_web_site_url={main_web_site_url} />
|
||||
<SixthSection sixth={sixth} main_web_site_url={main_web_site_url} btnUrl={competitionUrl}/>
|
||||
</div>
|
||||
|
||||
<div id="home-seventh-section" className="home-seventh-section">
|
||||
<SeventhSection main_web_site_url={main_web_site_url} />
|
||||
<SeventhSection main_web_site_url={main_web_site_url} btnUrl={forumUrl}/>
|
||||
</div>
|
||||
|
||||
<Footer />
|
||||
|
|
|
|||
Loading…
Reference in New Issue