diff --git a/src/common/UrlTool.js b/src/common/UrlTool.js index 3648323dc..6f4adbd3e 100644 --- a/src/common/UrlTool.js +++ b/src/common/UrlTool.js @@ -34,6 +34,21 @@ export function getImage(path) { } } +export function getTestImage(path) { + // https://www.educoder.net + // https://testbdweb.trustie.net + // const local = 'http://localhost:3000' + const local = 'http://117.50.100.12:49999'; + if(path.indexOf("http://")===-1){ + if (isDev) { + return `${local}${path}` + } + return `${path}`; + }else{ + return path; + } +} + export function getLogoImageUrl(path) { const local = 'http://117.50.100.12:49999'; diff --git a/src/common/educoder.js b/src/common/educoder.js index a67a6d441..3756b1d78 100644 --- a/src/common/educoder.js +++ b/src/common/educoder.js @@ -6,7 +6,7 @@ export { getUploadLogoActionUrl as getUploadLogoActionUrl, getImageUrl as getImageUrl,getImage as getImage, getmyUrl as getmyUrl, getRandomNumber as getRandomNumber, getUrl as getUrl, publicSearchs as publicSearchs, getRandomcode as getRandomcode, getUrlmys as getUrlmys, getUrl2 as getUrl2, setImagesUrl as setImagesUrl , getUploadActionUrl as getUploadActionUrl, getUploadActionUrltwo as getUploadActionUrltwo, getUploadActionUrlthree as getUploadActionUrlthree, getUploadActionUrlOfAuth as getUploadActionUrlOfAuth - , getTaskUrlById as getTaskUrlById, TEST_HOST, htmlEncode as htmlEncode, getupload_git_file as getupload_git_file, getcdnImageUrl as getcdnImageUrl,getLogoImageUrl as getLogoImageUrl + , getTaskUrlById as getTaskUrlById, TEST_HOST, htmlEncode as htmlEncode, getupload_git_file as getupload_git_file, getcdnImageUrl as getcdnImageUrl,getTestImage as getTestImage,getLogoImageUrl as getLogoImageUrl } from './UrlTool'; export { setmiyah as setmiyah } from './Component'; diff --git a/src/home/FifthSection/index.jsx b/src/home/FifthSection/index.jsx index 4fee6b129..b6c8bffa3 100644 --- a/src/home/FifthSection/index.jsx +++ b/src/home/FifthSection/index.jsx @@ -14,8 +14,6 @@ for (const item of taskModeIdArr) { } - - let taskArrMock = [ { id: 447, @@ -53,7 +51,7 @@ function getSomeDayAfter(initailDate, nDay) { return moment(new Date(initailDate).setDate(new Date(initailDate).getDate() + nDay)).format('YYYY-MM-DD'); } -function FifthSection({ fifth }) { +function FifthSection({ fifth,history }) { const [taskCategoryArr, setTaskCategoryArr] = useState([]); const [taskArr, serTaskArr] = useState(taskArrMock); @@ -244,7 +242,7 @@ function FifthSection({ fifth }) {
- +
{ const playGlass = document.getElementById("playGlass"); - playGlass.addEventListener("webkitAnimationEnd", () => { - setCirculation('circulation'); - }); + playGlass.addEventListener("webkitAnimationEnd", secondAnimation); return () => { setCirculation(''); - playGlass.removeEventListener("webkitAnimationEnd"); + playGlass.removeEventListener("webkitAnimationEnd",secondAnimation); }; }, []); + + function secondAnimation(){ + setCirculation('circulation'); + } useEffect(() => { setCirculation(''); diff --git a/src/home/FourthSection/index.jsx b/src/home/FourthSection/index.jsx index 17c820fda..8e36ad9f0 100644 --- a/src/home/FourthSection/index.jsx +++ b/src/home/FourthSection/index.jsx @@ -25,7 +25,7 @@ const code = [ // { str: ======END====== }, ] -function FourthSection({ fourth }) { +function FourthSection({ fourth, history }) { return (
@@ -33,7 +33,7 @@ function FourthSection({ fourth }) {

开源项目

开源项目版块集项目托管、版本管理等功能于一体,为开源协作和群智汇聚提供创作环境

- +
diff --git a/src/home/SecondSection/index.jsx b/src/home/SecondSection/index.jsx index 97587e85f..56c829da6 100644 --- a/src/home/SecondSection/index.jsx +++ b/src/home/SecondSection/index.jsx @@ -1,5 +1,6 @@ -import React, { memo } from 'react'; +import React, { memo, useEffect, useState } from 'react'; import { Button } from 'antd'; +import axios from 'axios'; import Slider from 'react-slick'; import "slick-carousel/slick/slick.css"; import "slick-carousel/slick/slick-theme.css"; @@ -23,42 +24,35 @@ let setting = { vertical: true, } -const sliderData = [ - { - id: 1, - type: 1, - tag: '热点资讯', - title: "数字化转型要重视开源", - content: "习主席指出,要紧跟科技强国建设进程,优化国防创新布局和环境条件,用好用足各方面优势力量和资源, sunt in culpa qui officia deserunt mollit id est laborum.", - time: "2021-09-13", - }, - { - id: 2, - type: 1, - tag: '热点资讯', - title: "数字化转型要重视开源数字化转型要重视开源数字化转型要重视开源", - content: "习主席指出,要紧跟科技强国建设进程,优化国防创新布局和环境条件,用好用足各方面优势力量和资源,加快推进国防科技创新加优化国防创新布局和环境条件,用好用足各方面优势力量和资源,大幅加强科研投入,提高科研产出优化国防创新布局和环境条件,用好用足各方面优势力量和资源,大幅加强科研投入,提高科研产出", - time: "2021-09-13", - }, - { - id: 3, - type: 2, - tag: '红山书籍', - title: "数字化转型要重视开源数字化转型要重视开源数字化转型要重视开源", - content: "习主席指出,要紧跟科技强国建设进程,优化国防创新布局和环境条件,用好用足各方面优势力量和资源, sunt in culpa qui officia deserunt mollit id est laborum.", - time: "2021-09-13", - }, - { - id: 4, - type: 3, - tag: '热点资讯', - title: "数字化转型要重视开源", - content: "习主席指出,要紧跟科技强国建设进程,优化国防创新布局和环境条件,用好用足各方面优势力量和资源, sunt in culpa qui officia deserunt mollit id est laborum.", - time: "2021-09-13", - } -] -function SecondSection({ second }) { +function SecondSection({ second ,main_web_site_url}) { + + const [leftItem, setLeftItem] = useState({}); + const [list, setList] = useState([]); + + useEffect(() => { + const url = `/home/platform_communicates.json`; + axios.get(url, { + params: { + limit: 10, + page: 1 + } + }).then(result => { + if (result && result.data) { + let communicates = result.data.communicates; + if (communicates.length) { + setLeftItem(communicates[0]); + setList(communicates.slice(1, 5)); + } + } + }).catch(error => { }); + }, []) + + + function goDetail(id) { + window.open(`${main_web_site_url}/forums/${id}/detail`); + } + return (

社区动态

@@ -76,31 +70,30 @@ function SecondSection({ second }) { -

IDRLnet: 基于内嵌物理知识神经网络的开源求解框架

+

{ goDetail(leftItem.fake_id) }}>{leftItem.title}

- 为解决飞行器设计优化过程中物理场快速仿真问题和运行监测阶段物理场精确反演问题,国防科技创新研究院无人系统技术研究中心智能设计与鲁棒学习团队推出微分方程智能求解框架IDRLnet。 - 该框架是国内首款基于内嵌物理知识神经网络的开源框架。IDRLnet作为该团队自主研发IDaaS平台的一个重要解算单元,与平台其他工具协同提升智能设计水平。IDRLnet已在红山开源平台上发布,旨在助力相关学术成果涌现,推动相关技术迭代,促进相关应用落地。 + {leftItem.content}
- +
{ - sliderData.map((item, i) => { + list.map((item, i) => { return (
-
- {i+1} +
{ goDetail(item.fake_id) }}> + {i + 1}

{item.title}

{item.tag}

{item.content}

- {item.time} + {item.created_time}
) }) diff --git a/src/home/SeventhSection/index.jsx b/src/home/SeventhSection/index.jsx index e80808563..464159cbb 100644 --- a/src/home/SeventhSection/index.jsx +++ b/src/home/SeventhSection/index.jsx @@ -1,17 +1,12 @@ -import React, { memo } from 'react'; +import React, { memo, useEffect, useState } from 'react'; import { Button } from 'antd'; +import axios from 'axios'; import Slider from 'react-slick'; import "slick-carousel/slick/slick.css"; import "slick-carousel/slick/slick-theme.css"; +import { getTestImage } from "educoder"; import Line from '../Line'; -import head1 from '../img/7-head1.png'; -import head2 from '../img/7-head2.png'; -import head3 from '../img/7-head3.png'; -import head4 from '../img/7-head4.png'; -import head5 from '../img/7-head5.png'; -import head6 from '../img/7-head6.png'; -import head7 from '../img/7-head7.png'; import './index.scss'; @@ -29,71 +24,60 @@ let setting = { arrows: false, } -const personArr=[ - { - id:1, - name:"opersou", - head:"/img/head.png", - title:"Linux基金会发布《2021开源职业报告》提出新的方案,促进人才成长合作发展", - content:"新冠疫情的大规模爆发对社会经济、人民生活各方面均造成较大影响,众多企业面临劳动用工、合同履约以及银行信贷三重危机。而今,世界各地经济正逐渐从新冠疫情常态化趋势下复苏,后疫情时代中雇佣模式的转变,对劳动关系领域带来了新挑战,这一变化与挑战在科技领域尤为凸显。当云原生技术的加速应用成为远程化工作的主流,使得相关信息化人才缺口在本次全球化疫情中更加恶化。新冠疫情的大规模爆发对社会经济、人民生活各方面均造成较大影响,众多企业面临劳动用工、合同履约以及银行信贷三重危机。而今,世界各地经济正逐渐从新冠疫情常态化趋势下复苏,后疫情时代中雇佣模式的转变,对劳动关系领域带来了新挑战,这一变化与挑战在科技领域尤为凸显。当云原生技术的加速应用成为远程化工作的主流,使得相关信息化人才缺口在本次全球化疫情中更加恶化。", - }, - { - id:2, - name:"zhaojing", - head:"/img/head.png", - title:"Linux基金会发布《2021开源职业报告》提出新的方案,促进人才成长合作发展", - content:"新冠疫情的大规模爆发对社会经济、人民生活各方面均造成较大影响,众多企业面临劳动用工、合同履约以及银行信贷三重危机。而今,世界各地经济正逐渐从新冠疫情常态化趋势下复苏,后疫情时代中雇佣模式的转变,对劳动关系领域带来了新挑战,这一变化与挑战在科技领域尤为凸显。", - }, - { - id:3, - name:"ligang", - head:"/img/head.png", - title:"Linux基金会发布《2021开源职业报告》提出新的方案,促进人才成长合作发展", - content:"新冠疫情的大规模爆发对社会经济、人民生活各方面均造成较大影响,众多企业面临劳动用工、合同履约以及银行信贷三重危机。而今,世界各地经济正逐渐从新冠疫情常态化趋势下复苏,后疫情时代中雇佣模式的转变,对劳动关系领域带来了新挑战,这一变化与挑战在科技领域尤为凸显。", + +function SeventhSection({main_web_site_url}) { + + const [list, setList] = useState([]); + + useEffect(() => { + const url = `/home/platform_people.json`; + axios.get(url, { + params: { + limit: 6, + page: 1 + } + }).then(result => { + if (result && result.data) { + setList(result.data.people); + } + }).catch(error => { }); + }, []) + + function goDetail(fake_login) { + window.open(`${main_web_site_url}/accounts/${fake_login}`); } - -] - -function SeventhSection() { return (

论坛交流

论坛交流版块通过技术交流、学术探讨等方式,为社区用户提供自主交流空间,实现思维碰撞和智慧融合

-
- images-not_found - images-not_found - images-not_found - images-not_found - images-not_found - images-not_found +
+ { + list.map((item, i) => { + return ( { goDetail(item.fake_login) }} alt="images-not_found" />) + }) + }
-
- - opersou -

Linux基金会发布《2021开源职业报告》提出新的方案,促进人才成长合作发展

-

新冠疫情的大规模爆发对社会经济、人民生活各方面均造成较大影响,众多企业面临劳动用工、合同履约以及银行信贷三重危机。而今,世界各地经济正逐渐从新冠疫情常态化趋势下复苏,后疫情时代中雇佣模式的转变,对劳动关系领域带来了新挑战,这一变化与挑战在科技领域尤为凸显。当云原生技术的加速应用成为远程化工作的主流,使得相关信息化人才缺口在本次全球化疫情中更加恶化。 - 新冠疫情的大规模爆发对社会经济、人民生活各方面均造成较大影响,众多企业面临劳动用工、合同履约以及银行信贷三重危机。而今,世界各地经济正逐渐从新冠疫情常态化趋势下复苏,后疫情时代中雇佣模式的转变,对劳动关系领域带来了新挑战,这一变化与挑战在科技领域尤为凸显。当云原生技术的加速应用成为远程化工作的主流,使得相关信息化人才缺口在本次全球化疫情中更加恶化。

- 2021-09-13 -
- -
- - 李刚 -

Linux基金会发布《2021开源职业报告》

-

新冠疫情的大规模爆发对社会经济、人民生活各方面均造成较大影响,众多企业面临劳动用工、合同履约以及银行信贷三重危机。而今,世界各地经济正逐渐从新冠疫情常态化趋势下复苏,后疫情时代中雇佣模式的转变,对劳动关系领域带来了新挑战,这一变化与挑战在科技领域尤为凸显。当云原生技术的加速应用成为远程化工作的主流,使得相关信息化人才缺口在本次全球化疫情中更加恶化。 - 新冠疫情的大规模爆发对社会经济、人民生活各方面均造成较大影响,众多企业面临劳动用工、合同履约以及银行信贷三重危机。而今,世界各地经济正逐渐从新冠疫情常态化趋势下复苏,后疫情时代中雇佣模式的转变,对劳动关系领域带来了新挑战,这一变化与挑战在科技领域尤为凸显。当云原生技术的加速应用成为远程化工作的主流,使得相关信息化人才缺口在本次全球化疫情中更加恶化。

- 2021-09-13 -
+ { + list.map((item, i) => { + return (
+ { goDetail(item.fake_login) }} alt="images-not_found"/> + { goDetail(item.fake_login) }}>{item.name} +

{item.announcement}

+

{item.content}

+ {item.created_time&&item.created_time.split(' ')[0]} +
) + }) + }
- +
diff --git a/src/home/SixthSection/index.jsx b/src/home/SixthSection/index.jsx index d410990ef..0d4d3a0fb 100644 --- a/src/home/SixthSection/index.jsx +++ b/src/home/SixthSection/index.jsx @@ -1,5 +1,6 @@ -import React, { memo } from 'react'; +import React, { memo, useEffect, useState } from 'react'; import { Button } from 'antd'; +import axios from 'axios'; import Line from '../Line'; import completeIcon1 from '../img/6-completeIcon1.png'; import completeIcon2 from '../img/6-completeIcon2.png'; @@ -12,65 +13,48 @@ import overall from '../img/6-overall.png'; import pillar1 from '../img/6-pillar1.png'; import pillar2 from '../img/6-pillar2.png'; import pillar3 from '../img/6-pillar3.png'; - - import './index.scss'; +let iconArr = [completeIcon1, completeIcon2, completeIcon3]; -const completeArr=[{ - id:1, - name:"CCKS 2021", - timeStart:"2021.05.17", - timeEnd:"2021.07.20", - describe:"本次评测任务,探索能够落地见效的无人机领域知识图谱构建技术,促进技术发展,时代进步,技术进步", -},{ - id:2, - name:"CCKS 2021111", - timeStart:"2021.05.17", - timeEnd:"2021.07.20", - describe:"本次评测任务,探索能够落地见效的无人机领域知识图谱构建技术,促进技术发展,时代进步,技术进步", -},{ - id:3, - name:"CCKS 20211111", - timeStart:"2021.05.17", - timeEnd:"2021.07.20", - describe:"本次评测任务,探索能够落地见效的无人机领域知识图谱构建技术,促进技术发展,时代进步,技术进步", -}]; +function SixthSection({ sixth, main_web_site_url }) { + + const [list, setList] = useState(); + + useEffect(() => { + const url = `/home/competitions.json`; + axios.get(url).then(result => { + if (result && result.data) { + setList(result.data.competitions); + } + }).catch(error => { }); + }, []) + + function goDetail(id) { + window.open(`${main_web_site_url}/competitions/${id}/enroll`); + } -function SixthSection({ sixth }) { return (
-
- -
-

CCKS 2021

-

竞赛时间:2021.05.17-2021.07.20

-

赛事简介: 本次评测任务,探索能够落地见效的无人机领域知识图谱构建技术,促进技术发展,时代进步,技术进步

-
-
- -
- -
-

CCKS 2021

-

竞赛时间:2021.05.17-2021.07.20

-

赛事简介: 本次评测任务,探索能够落地见效的无人机领域知识图谱构建技术,促进技术发展,时代进步,技术进步

-
-
- -
- -
-

CCKS 2021 探索能够落地见效的无人机领域知识图谱构建技术

-

竞赛时间:2021.05.17-2021.07.20

-

赛事简介: 本次评测任务,探索能够落地见效的无人机领域知识图谱构建技术,促进技术发展,时代进步,技术进步

-
-
+ { + list && list.map((item, i) => { + return ( +
+ 竞赛 +
+

{ goDetail(item.id) }}>{item.title}

+

竞赛时间:{item.start_time && item.start_time.split(' ')[0]}-{item.end_time && item.end_time.split(' ')[0]}

+

赛事简介: {item.content}

+
+
+ ) + }) + }
@@ -81,21 +65,21 @@ function SixthSection({ sixth }) {
- - - - - - - - - + images-not_found + images-not_found + images-not_found + images-not_found + images-not_found + images-not_found + images-not_found + images-not_found +
- + diff --git a/src/home/ThirdSection/index.jsx b/src/home/ThirdSection/index.jsx index dc022c233..9109039ec 100644 --- a/src/home/ThirdSection/index.jsx +++ b/src/home/ThirdSection/index.jsx @@ -1,24 +1,28 @@ -import React, { memo } from 'react'; +import React, { memo, useEffect, useState } from 'react'; import CountUp from 'react-countup'; +import axios from 'axios'; import Line from '../Line'; import './index.scss'; -const countUpProps={ - redraw:true, - start:0, - duration:2 +const countUpProps = { + redraw: true, + start: 0, + duration: 1 }; -// 数据统计总量 -const statisticsNum={ - clickCount:23191, - userCount:4493, - projectCount:1526, - taskCount:666, - postCount:2000, -}; -function ThirdSection({third}) { +function ThirdSection({ third }) { + const [statisticsNum, setStatisticsNum] = useState({}); + + useEffect(() => { + const url = `/home/platform_statistics.json`; + axios.get(url).then(result => { + if (result && result.data) { + setStatisticsNum(result.data); + } + }).catch(error => { }); + }, []) + return (

数据统计总览

@@ -26,11 +30,11 @@ function ThirdSection({third}) {
-
- 9999999?'24px':statisticsNum.visits>99999?'36px':'48px'}}> + + end={statisticsNum.visits} + />

平台点击量

@@ -39,7 +43,7 @@ function ThirdSection({third}) {
- +

平台用户数

@@ -48,7 +52,7 @@ function ThirdSection({third}) {
- +

开源项目托管数

@@ -57,7 +61,7 @@ function ThirdSection({third}) {
- +

创客任务发布数

@@ -66,7 +70,7 @@ function ThirdSection({third}) {
- +

论坛发帖数量

diff --git a/src/home/img/7-head1.png b/src/home/img/7-head1.png deleted file mode 100644 index 3860c458a..000000000 Binary files a/src/home/img/7-head1.png and /dev/null differ diff --git a/src/home/img/7-head2.png b/src/home/img/7-head2.png deleted file mode 100644 index 769b98357..000000000 Binary files a/src/home/img/7-head2.png and /dev/null differ diff --git a/src/home/img/7-head3.png b/src/home/img/7-head3.png deleted file mode 100644 index aaaf13571..000000000 Binary files a/src/home/img/7-head3.png and /dev/null differ diff --git a/src/home/img/7-head4.png b/src/home/img/7-head4.png deleted file mode 100644 index ecbd40700..000000000 Binary files a/src/home/img/7-head4.png and /dev/null differ diff --git a/src/home/img/7-head5.png b/src/home/img/7-head5.png deleted file mode 100644 index 8d8804f5a..000000000 Binary files a/src/home/img/7-head5.png and /dev/null differ diff --git a/src/home/img/7-head6.png b/src/home/img/7-head6.png deleted file mode 100644 index 2e2068fed..000000000 Binary files a/src/home/img/7-head6.png and /dev/null differ diff --git a/src/home/img/7-head7.png b/src/home/img/7-head7.png deleted file mode 100644 index 24f8c5917..000000000 Binary files a/src/home/img/7-head7.png and /dev/null differ diff --git a/src/home/index.jsx b/src/home/index.jsx index be4eda344..2f54ade5d 100644 --- a/src/home/index.jsx +++ b/src/home/index.jsx @@ -12,13 +12,14 @@ import SeventhSection from './SeventhSection'; import Footer from './Footer'; -function HomePage(props) { + +function HomePage({ history }) { useEffect(() => { - window.addEventListener("scroll", scrollListener); + window.addEventListener("scroll", scrollListener, false); return () => { - window.removeEventListener("scroll"); - }; + window.removeEventListener("scroll", scrollListener, false); + } }, []); const [first, setFirst] = useState(true); @@ -28,6 +29,9 @@ function HomePage(props) { const [fifth, setFifth] = useState(false); const [sixth, setSixth] = useState(false); + let settings = JSON.parse(localStorage.chromesetting); + let main_web_site_url = settings.main_web_site_url; + function scrollListener() { let clientHeight = document.body.clientHeight; @@ -107,7 +111,7 @@ function HomePage(props) {
- +
@@ -116,19 +120,19 @@ function HomePage(props) {
- +
- +
- +
- +