From 1014c5ef608eb80fb5364368dbf2ecdc2bee70b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 30 Oct 2019 09:45:41 +0800 Subject: [PATCH 01/19] =?UTF-8?q?=E7=AB=9E=E8=B5=9B=E8=AF=81=E4=B9=A6?= =?UTF-8?q?=E4=B8=8B=E8=BD=BDand=E5=AE=8C=E5=96=84=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E8=B5=84=E6=96=99start?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Competitioncommon/CompetitionCommon.js | 32 +++++++++--- .../CompetitionContents.js | 2 +- .../CompetitionContentsChart.js | 2 +- .../CompetitionContentsMd.js | 2 +- .../CompetitionContentspdf.js | 50 +++++++++++++++++++ .../CompetitionContentspdfdownload.js | 35 +++++++++++++ .../CompetitionContentspdfpeopledata.js | 34 +++++++++++++ 7 files changed, 148 insertions(+), 9 deletions(-) rename public/react/src/modules/competitions/Competitioncommon/{ => CompetitionCommonChild}/CompetitionContents.js (93%) rename public/react/src/modules/competitions/Competitioncommon/{ => CompetitionCommonChild}/CompetitionContentsChart.js (99%) rename public/react/src/modules/competitions/Competitioncommon/{ => CompetitionCommonChild}/CompetitionContentsMd.js (98%) create mode 100644 public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdf.js create mode 100644 public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfdownload.js create mode 100644 public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js index 2d1aae16f..e92dd66cc 100644 --- a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js @@ -3,9 +3,10 @@ import { Breadcrumb,Layout,Table, Divider, Tag,Badge,Row, Col,Button, Menu, Icon import { Link } from 'react-router-dom'; import axios from 'axios'; import {markdownToHTML,getImageUrl} from 'educoder'; -import CompetitionContents from './CompetitionContents'; -import CompetitionContentsChart from './CompetitionContentsChart'; -import CompetitionContentsMd from './CompetitionContentsMd'; +import CompetitionContents from './CompetitionCommonChild/CompetitionContents'; +import CompetitionContentsChart from './CompetitionCommonChild/CompetitionContentsChart'; +import CompetitionContentsMd from './CompetitionCommonChild/CompetitionContentsMd'; +import CompetitionContentspdf from './CompetitionCommonChild/CompetitionContentspdf'; import NoneData from "../../courses/shixunHomework/shixunHomework"; import './CompetitionCommon.css'; @@ -253,6 +254,13 @@ class CompetitionCommon extends Component{ } + isdownloadpdf=()=>{ + + this.setState({ + isdownloadpdftype:true + }) + + } render() { let {data,thiskeys,Competitionedittype}=this.state; @@ -365,9 +373,15 @@ class CompetitionCommon extends Component{ } })} + + this.isdownloadpdf(e)}> + + 证书下载 + + - + {this.state.isdownloadpdftype===true?"": {this.state.module_type==="chart"?Competitionedittype===false?:""} - - + } + + {this.state.isdownloadpdftype===true? + + :""} diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionContents.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContents.js similarity index 93% rename from public/react/src/modules/competitions/Competitioncommon/CompetitionContents.js rename to public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContents.js index 909479c2a..43213b457 100644 --- a/public/react/src/modules/competitions/Competitioncommon/CompetitionContents.js +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContents.js @@ -2,7 +2,7 @@ import React, { Component } from 'react'; import {Button,Layout} from 'antd'; import axios from 'axios'; import {markdownToHTML,getImageUrl,AttachmentList} from 'educoder'; -import NoneData from "../../courses/shixunHomework/shixunHomework"; +// import NoneData from "../../../courses/shixunHomework/shixunHomework"; const { Header, Footer, Sider, Content } = Layout; class CompetitionContents extends Component{ diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionContentsChart.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentsChart.js similarity index 99% rename from public/react/src/modules/competitions/Competitioncommon/CompetitionContentsChart.js rename to public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentsChart.js index ac09b2e6c..759508581 100644 --- a/public/react/src/modules/competitions/Competitioncommon/CompetitionContentsChart.js +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentsChart.js @@ -2,7 +2,7 @@ import React, { Component } from 'react'; import {Button,Layout,Tabs,Icon, Card, Avatar, Row, Col ,Table} from 'antd'; import {markdownToHTML,getImageUrl} from 'educoder'; import axios from 'axios'; -import NoneData from "../../courses/shixunHomework/shixunHomework"; +// import NoneData from "../../../courses/shixunHomework/shixunHomework"; const { Content } = Layout; const { TabPane } = Tabs; diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionContentsMd.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentsMd.js similarity index 98% rename from public/react/src/modules/competitions/Competitioncommon/CompetitionContentsMd.js rename to public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentsMd.js index aae9283c4..049f2bab1 100644 --- a/public/react/src/modules/competitions/Competitioncommon/CompetitionContentsMd.js +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentsMd.js @@ -2,7 +2,7 @@ import React, { Component } from 'react'; import {Button, Card, Row, Col ,Upload,Icon,message,Tabs} from 'antd'; import axios from 'axios'; import {getImageUrl,getUrl,appendFileSizeToUploadFileAll,appendFileSizeToUploadFile} from 'educoder'; -import TPMMDEditor from '../../tpm/challengesnew/TPMMDEditor'; +import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor'; const { TabPane } = Tabs; class CompetitionContentsMd extends Component{ constructor(props) { diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdf.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdf.js new file mode 100644 index 000000000..177356400 --- /dev/null +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdf.js @@ -0,0 +1,50 @@ +import React, { Component } from 'react'; +import {Tabs} from 'antd'; +import axios from 'axios'; +import {markdownToHTML,getImageUrl,AttachmentList} from 'educoder'; +import CompetitionContentspdfdownload from './CompetitionContentspdfChild/CompetitionContentspdfdownload'; +import CompetitionContentspdfpeopledata from './CompetitionContentspdfChild/CompetitionContentspdfpeopledata'; +// import NoneData from "../../../courses/shixunHomework/shixunHomework"; + +const { TabPane } = Tabs; +class CompetitionContentspdf extends Component{ + constructor(props) { + super(props) + this.state={ + + } + } + + componentDidMount(){ + window.document.title = '竞赛'; + + } + + render() { + + + return ( + +
+
+ + + + + + + + +
+
+ + ) + } +} +export default CompetitionContentspdf; \ No newline at end of file diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfdownload.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfdownload.js new file mode 100644 index 000000000..598217a15 --- /dev/null +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfdownload.js @@ -0,0 +1,35 @@ +import React, { Component } from 'react'; +import {Button,Layout} from 'antd'; +import axios from 'axios'; +import {getImageUrl} from 'educoder'; +// import NoneData from "../../../courses/shixunHomework/shixunHomework"; + + +class CompetitionContentspdfdownload extends Component{ + constructor(props) { + super(props) + this.state={ + + } + } + + componentDidMount(){ + window.document.title = '竞赛'; + + } + + render() { + + + return ( + +
+
+ 123123 +
+
+ + ) + } +} +export default CompetitionContentspdfdownload; \ No newline at end of file diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js new file mode 100644 index 000000000..41002d5f3 --- /dev/null +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js @@ -0,0 +1,34 @@ +import React, { Component } from 'react'; +import {Button,Layout} from 'antd'; +import axios from 'axios'; +import {getImageUrl} from 'educoder'; +// import NoneData from "../../../courses/shixunHomework/shixunHomework"; + +class CompetitionContentspdfpeopledata extends Component{ + constructor(props) { + super(props) + this.state={ + + } + } + + componentDidMount(){ + window.document.title = '竞赛'; + + } + + render() { + + + return ( + +
+
+ 123123 +
+
+ + ) + } +} +export default CompetitionContentspdfpeopledata; \ No newline at end of file From 2351c90862251da04cdc56a9ce4de8986c490c71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 30 Oct 2019 09:46:50 +0800 Subject: [PATCH 02/19] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CompetitionContentspdfdownload.js | 4 +--- .../CompetitionContentspdfpeopledata.js | 6 +----- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfdownload.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfdownload.js index 598217a15..2fcd8d052 100644 --- a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfdownload.js +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfdownload.js @@ -23,10 +23,8 @@ class CompetitionContentspdfdownload extends Component{ return ( -
-
+
123123 -
) diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js index 41002d5f3..4a139611c 100644 --- a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js @@ -21,13 +21,9 @@ class CompetitionContentspdfpeopledata extends Component{ return ( - -
-
+
123123 -
- ) } } From 78a6a777cf9fc0de379583e3d296923aefa4b3ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 30 Oct 2019 09:49:07 +0800 Subject: [PATCH 03/19] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CompetitionContentspdfdownload.js | 4 ++-- .../CompetitionContentspdfpeopledata.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfdownload.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfdownload.js index 2fcd8d052..fc461bcb2 100644 --- a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfdownload.js +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfdownload.js @@ -15,11 +15,11 @@ class CompetitionContentspdfdownload extends Component{ componentDidMount(){ window.document.title = '竞赛'; - + console.log(this.props.match.params.identifier) } render() { - + console.log(this.props) return ( diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js index 4a139611c..45a5ab939 100644 --- a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js @@ -14,11 +14,11 @@ class CompetitionContentspdfpeopledata extends Component{ componentDidMount(){ window.document.title = '竞赛'; - + console.log(this.props.match.params.identifier) } render() { - + console.log(this.props) return (
From d9a3511eccee59ecf58426a61a6fc08615a5b430 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 31 Oct 2019 09:47:53 +0800 Subject: [PATCH 04/19] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CompetitionContentspdfpeopledata.js | 4 +- .../mycompetotionchild.css | 74 +++++++++++++++++++ 2 files changed, 76 insertions(+), 2 deletions(-) create mode 100644 public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/mycompetotionchild.css diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js index 45a5ab939..69ab5413b 100644 --- a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js @@ -22,9 +22,9 @@ class CompetitionContentspdfpeopledata extends Component{ return (
- 123123 + 345345
) } } -export default CompetitionContentspdfpeopledata; \ No newline at end of file +export default CompetitionContentspdfpeopledata; diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/mycompetotionchild.css b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/mycompetotionchild.css new file mode 100644 index 000000000..7f9652f44 --- /dev/null +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/mycompetotionchild.css @@ -0,0 +1,74 @@ +/*垂直布局 + + 一 + 二 + 三 +*/ +.flexdirectionjust{ + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + + +.directstwebkitflex{ + display: flex; + display: -webkit-flex; + flex-direction: column; + align-items: center; +} + +.diredisplayitflex{ + display: flex; + display: -webkit-flex; + align-items: center; +} +/*垂直布局*/ +/*靠左侧 +一 二 三 四 五 六 七 八 +*/ +.flexdirection{ + display: flex; + flex-direction:row; +} + +.flexdirections{ + display: flex; + flex-direction:initial; +} +/*靠左侧 +*/ + + + + /*靠右侧八 七 六 五 四 三 二 一*/ + .flexdirectionss{ + display: flex; + flex-direction:row-reverse; + } + + +/*垂直布局 +一 +二 +三 +四 +*/ +.flexdidirectionss{ + display: flex; + flex-direction:column; +} + +/*垂直布局 +四 +三 +二 +一 +*/ + .flexdidireverses{ + display: flex; + flex-direction:column-reverse; + } + + From 6c987ce6f9193e197710d0dc77de3b9b21338cc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 31 Oct 2019 10:25:34 +0800 Subject: [PATCH 05/19] =?UTF-8?q?=E7=AB=9E=E8=B5=9B=E8=AF=81=E4=B9=A6?= =?UTF-8?q?=E4=B8=8B=E8=BD=BDstart?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CompetitionContentspdfdownload.css | 12 ++++++++ .../CompetitionContentspdfdownload.js | 30 ++++++++++++++++--- 2 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfdownload.css diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfdownload.css b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfdownload.css new file mode 100644 index 000000000..eb41e7c05 --- /dev/null +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfdownload.css @@ -0,0 +1,12 @@ +.pdfdownload{ + max-width: 791px; + height: 40px; + background: rgba(249,249,249,1); + line-height: 40px; + padding-left: 15px; +} + +.pdfpicture{ + font-size:16px; + color:rgba(0,0,0,1); +} \ No newline at end of file diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfdownload.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfdownload.js index fc461bcb2..cf0482ff9 100644 --- a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfdownload.js +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfdownload.js @@ -1,7 +1,8 @@ import React, { Component } from 'react'; -import {Button,Layout} from 'antd'; +import {Button,Layout,Row, Col,Divider} from 'antd'; import axios from 'axios'; import {getImageUrl} from 'educoder'; +import './CompetitionContentspdfdownload.css'; // import NoneData from "../../../courses/shixunHomework/shixunHomework"; @@ -22,11 +23,32 @@ class CompetitionContentspdfdownload extends Component{ console.log(this.props) return ( + + + 温馨提示:填写的个人信息经审批后,将提供个人获奖证书下载;团队队员信息全部审批后,将提供团队获奖证书下载。 + -
- 123123 -
+ + 证书情况 + + + 个人证书: 暂未生成 原因:还未认证个人信息,立即认证 + + + + 团队证书: 暂未生成 + 立即下载 + + + + + + XXXXXX战队信息填报概况 + + + +
) } } From 8d71763adc92bb208cbc6fa05ad93508f7c88303 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 31 Oct 2019 16:23:00 +0800 Subject: [PATCH 06/19] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=AB=9E=E8=B5=9B?= =?UTF-8?q?=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CompetitionContentspdfpeopledata.js | 101 +++++++++++++++- .../mycompetotionchild.css | 109 ++++++++++++++++++ 2 files changed, 204 insertions(+), 6 deletions(-) diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js index 69ab5413b..9b5f13050 100644 --- a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js @@ -1,8 +1,8 @@ import React, { Component } from 'react'; -import {Button,Layout} from 'antd'; +import {Button,Layout,Input} from 'antd'; import axios from 'axios'; import {getImageUrl} from 'educoder'; -// import NoneData from "../../../courses/shixunHomework/shixunHomework"; +import mycompetotionchild from './mycompetotionchild.css'; class CompetitionContentspdfpeopledata extends Component{ constructor(props) { @@ -14,15 +14,104 @@ class CompetitionContentspdfpeopledata extends Component{ componentDidMount(){ window.document.title = '竞赛'; - console.log(this.props.match.params.identifier) } render() { - console.log(this.props) return ( -
- 345345 +
+
+

*实名信息

+

通过实名认证后才能获得证书

+

立即认证

+
+
+

姓名:

+

胡志勇

已认证

待审核!

撤销认证

+
+ +
+

性别:

+

+
+ +
+

*职业信息

+

通过职业认证后才能获得证书

+

立即认证

+
+ +
+

职业:

+

教师

已认证

待审核!

撤销认证

+
+
+

职称:

+

副教授

+
+
+

学校:

+

国防科技大学

+
+
+

院系:

+

计算机学院

+
+ +
+

*联系方式

+
+
+

手机号:

+

未绑定

+

立即绑定

+
+
+

Email:

+

163@163.com

+

更换

+
+ +
+

签/领/开户行及银行卡号

+

为保障奖金的及时发放,请队长如实填写你名下的银行卡信息

+
+ + + +
+

开户行:

+ +
+ +
+

支行:

+ +
+ +
+

账号:

+ +
+ +
+

+
+

取消

+

确认

+ +
+
+
) } diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/mycompetotionchild.css b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/mycompetotionchild.css index 7f9652f44..bf73dc59d 100644 --- a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/mycompetotionchild.css +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/mycompetotionchild.css @@ -71,4 +71,113 @@ flex-direction:column-reverse; } +.fontcolorsysl{ + color:#FF0000 +} +.fontcolorsyslhei{ + color:#000000 +} +.fontcolorsyslhui{ + color:#888888 +} +.fontcolorsyslhui1{ + color:#666666; +} +.fontcolorsysllan{ + color:#4CACFF +} +.fontcolorsysljin{ + color:#DD7600 +} + +.w200{ + width: 200px; +} +.w64{ + width: 64px; +} + +.w60{ + width: 60px; +} +.w98{ + width: 98px; +} + +.myysllineheight{ + line-height: 40px; +} +.myyslminwidth{ + min-width: 60px; +} +.myyslminwidth276{ + width: 276px; +} + +.buttongo{ + background: #E7E7E7; + border: 1px solid #E7E7E7; + width: 60px; + height: 30px; + border-radius: 4px; + color: #999999; + font-size: 16px; +} + +.buttongo2{ + background: #4CACFF; + border: 1px solid #4CACFF; + width: 60px; + height: 30px; + border-radius: 4px; + color: #FFFFFF; + font-size: 16px; +} + +.fontwenzi{ + text-align: center; + line-height: 30px; +} + +.mt17{ + margin-top: 17px; +} +.mt36{ + margin-top: 36px; +} +.mt23{ + margin-top: 23px; +} +.mt19{ + margin-top: 19px; +} +.mt23{ + margin-top: 23px; +} +.mt34{ + margin-top: 34px; +} +.ml11{ + margin-left: 11px; +} +.ml38{ + margin-left: 38px; +} +.ml7{ + margin-left: 7px; +} + +.colorgreenlight{ + color:#6EC76E +} + +.colorgreenorg{ + color: #FF7300; +} + +.borcolors{ + border: 1px solid #4CACFF; + + text-align: center; +} From 5418fb7ae1fc05768d01f0abeddfcdce2f552cf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 1 Nov 2019 10:26:52 +0800 Subject: [PATCH 07/19] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/competition/RegistrationSearch.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/competition/RegistrationSearch.js b/public/react/src/modules/competition/RegistrationSearch.js index 02d4fa861..a1f0b9ac3 100644 --- a/public/react/src/modules/competition/RegistrationSearch.js +++ b/public/react/src/modules/competition/RegistrationSearch.js @@ -54,11 +54,11 @@ class RegistrationSearch extends React.Component { />

战队总数: Date: Fri, 1 Nov 2019 11:19:27 +0800 Subject: [PATCH 08/19] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Competitioncommon/CompetitionCommon.js | 42 ++++++++++++++----- 1 file changed, 31 insertions(+), 11 deletions(-) mode change 100644 => 100755 public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js old mode 100644 new mode 100755 index d5461b627..e92dd66cc --- a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js @@ -3,9 +3,11 @@ import { Breadcrumb,Layout,Table, Divider, Tag,Badge,Row, Col,Button, Menu, Icon import { Link } from 'react-router-dom'; import axios from 'axios'; import {markdownToHTML,getImageUrl} from 'educoder'; -import CompetitionContents from './CompetitionContents'; -import CompetitionContentsChart from './CompetitionContentsChart'; -import CompetitionContentsMd from './CompetitionContentsMd'; +import CompetitionContents from './CompetitionCommonChild/CompetitionContents'; +import CompetitionContentsChart from './CompetitionCommonChild/CompetitionContentsChart'; +import CompetitionContentsMd from './CompetitionCommonChild/CompetitionContentsMd'; +import CompetitionContentspdf from './CompetitionCommonChild/CompetitionContentspdf'; +import NoneData from "../../courses/shixunHomework/shixunHomework"; import './CompetitionCommon.css'; @@ -252,6 +254,13 @@ class CompetitionCommon extends Component{ } + isdownloadpdf=()=>{ + + this.setState({ + isdownloadpdftype:true + }) + + } render() { let {data,thiskeys,Competitionedittype}=this.state; @@ -264,11 +273,10 @@ class CompetitionCommon extends Component{

- + {data.competition_status==="nearly_published"? - data && data.permission.editable === true ? "" : -
即将发布 敬请期待
: ""} + data&&data.permission.editable===true?"":
即将发布 敬请期待
:""} @@ -334,7 +342,7 @@ class CompetitionCommon extends Component{ :data.enroll_end===true?: data.competition_status==="progressing"?
@@ -398,4 +418,4 @@ class CompetitionCommon extends Component{ ) } } -export default CompetitionCommon; +export default CompetitionCommon; \ No newline at end of file From 3a0bf1ab44ebe83e3e20b1bad4b8127c9d9b49c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 1 Nov 2019 11:45:51 +0800 Subject: [PATCH 09/19] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Competitioncommon/CompetitionCommon.js | 335 +++++++++--------- 1 file changed, 177 insertions(+), 158 deletions(-) diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js index d5461b627..52060ada1 100644 --- a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js @@ -3,9 +3,10 @@ import { Breadcrumb,Layout,Table, Divider, Tag,Badge,Row, Col,Button, Menu, Icon import { Link } from 'react-router-dom'; import axios from 'axios'; import {markdownToHTML,getImageUrl} from 'educoder'; -import CompetitionContents from './CompetitionContents'; -import CompetitionContentsChart from './CompetitionContentsChart'; -import CompetitionContentsMd from './CompetitionContentsMd'; +import CompetitionContents from './CompetitionCommonChild/CompetitionContents'; +import CompetitionContentsChart from './CompetitionCommonChild/CompetitionContentsChart'; +import CompetitionContentsMd from './CompetitionCommonChild/CompetitionContentsMd'; +import CompetitionContentspdf from './CompetitionCommonChild/CompetitionContentspdf'; import './CompetitionCommon.css'; @@ -15,14 +16,14 @@ class CompetitionCommon extends Component{ constructor(props) { super(props) this.state={ - data:undefined, - bannerdata:undefined, - module_type:undefined, - mdContentdata:undefined, - chart_rules:undefined, - Competitionedittype:false, - chartdata:undefined, - has_url:false + data:undefined, + bannerdata:undefined, + module_type:undefined, + mdContentdata:undefined, + chart_rules:undefined, + Competitionedittype:false, + chartdata:undefined, + has_url:false } } @@ -52,8 +53,8 @@ class CompetitionCommon extends Component{ axios.get(url).then((response) => { if(response.status===200){ this.setState({ - data:response.data, - thiskeys:menuid===undefined||menuid===""?response.data.competition_modules[0].id:menuid + data:response.data, + thiskeys:menuid===undefined||menuid===""?response.data.competition_modules[0].id:menuid }) if(menuid===undefined||menuid===""){ this.getrightdata( @@ -80,27 +81,27 @@ class CompetitionCommon extends Component{ console.log(error) }) - if(this.props.user&&this.props.user.login!= ""){ - const zul = `/competitions/${this.props.match.params.identifier}/competition_staff.json`; - axios.get((zul)).then((result) => { - if (result) { - if (result.data) { - this.setState({ - signupdata:result.data - }) - } - } - }).catch((error) => { - //console.log(error); - }) - } + if(this.props.user&&this.props.user.login!= ""){ + const zul = `/competitions/${this.props.match.params.identifier}/competition_staff.json`; + axios.get((zul)).then((result) => { + if (result) { + if (result.data) { + this.setState({ + signupdata:result.data + }) + } + } + }).catch((error) => { + //console.log(error); + }) + } } getrightdatas=(e)=>{ - let keys=parseInt(e.key); - this.getlistdata(keys) - this.props.history.replace(`?menu=${keys}`); + let keys=parseInt(e.key); + this.getlistdata(keys) + this.props.history.replace(`?menu=${keys}`); } getlistdata=(keys,listkey)=>{ @@ -127,7 +128,7 @@ class CompetitionCommon extends Component{ if(response.status===200){ this.setState({ chart_rules:response.data, - tabkey:tabkey===undefined?response.data.stages[0].id===null?"0":`${response.data.stages[0].id}`:tabkey + tabkey:tabkey===undefined?response.data.stages[0].id===null?"0":`${response.data.stages[0].id}`:tabkey }) @@ -142,10 +143,10 @@ class CompetitionCommon extends Component{ // if(typeid==="enroll"){ // this.props.history.replace(`/competitions/${this.props.match.params.identifier}/enroll`); - // return + // return // } - this.getnewchartdata(typeid,listkey) + this.getnewchartdata(typeid,listkey) if(has_url===false){ let url=`${module_url}`; @@ -167,11 +168,11 @@ class CompetitionCommon extends Component{ console.log(error) }) }else{ - if(module_url.substring(0,7)=='http://'||module_url.substring(0,8)=='https://') { + if(module_url.substring(0,7)=='http://'||module_url.substring(0,8)=='https://') { // window.location.href= module_url - window.open(module_url) + window.open(module_url) }else{ - window.open(`https://${module_url}`) + window.open(`https://${module_url}`) // window.location.href=; } return @@ -186,9 +187,9 @@ class CompetitionCommon extends Component{ } Competitionedit=()=>{ - this.setState({ - Competitionedittype:true - }) + this.setState({ + Competitionedittype:true + }) } hideCompetitionedit=()=>{ @@ -215,10 +216,10 @@ class CompetitionCommon extends Component{ if(data.member_of_course===true){ this.props.history.replace(`/courses/${data.course_id}`); }else{ - // 以学生身份调用加入课堂 进入课堂首页 + // 以学生身份调用加入课堂 进入课堂首页 let url="/courses/apply_to_join_course.json" axios.post(url, { - invite_code:data.invite_code, + invite_code:data.invite_code, student:1 } ).then((response) => { @@ -234,7 +235,7 @@ class CompetitionCommon extends Component{ } Competitioncallback=(key)=>{ - this.setState({ + this.setState({ tabkey:key }) let url=`/competitions/${this.props.match.params.identifier}/charts.json`; @@ -252,150 +253,168 @@ class CompetitionCommon extends Component{ } + isdownloadpdf=()=>{ + + this.setState({ + isdownloadpdftype:true + }) + + } render() { let {data,thiskeys,Competitionedittype}=this.state; return ( data===undefined?"":
- - 在线竞赛 - {data&&data.name} - - -
- - - {data.competition_status==="nearly_published"? - data && data.permission.editable === true ? "" : -
即将发布 敬请期待
: ""} - - - - - + + 在线竞赛 + {data&&data.name} + + +
+ + + {data.competition_status==="nearly_published"? + data&&data.permission.editable===true?"":
即将发布 敬请期待
:""} + + + + + - 15?"competitionbannerdiv mt30":"competitionbannerdiv mt30"}>{data&&data.name} + 15?"competitionbannerdiv mt30":"competitionbannerdiv mt30"}>{data&&data.name} - - 竞赛时间:{data&&data.start_time}~{data&&data.end_time} - {/**/} + + 竞赛时间:{data&&data.start_time}~{data&&data.end_time} + {/**/} + + + + + +
奖金
+ + +
浏览数
+ +
报名数
+ +
- - - -
奖金
- - -
浏览数
- - -
报名数
- -
- - - -
¥{data&&data.bonus}
- - -
{data.competition_status==="nearly_published"?"--":data&&data.visits_count}
- - -
this.gotocourse(`/competitions/${this.props.match.params.identifier}/enroll`)}>{data.competition_status==="nearly_published"?"--":data&&data.member_count}
- -
+ + +
¥{data&&data.bonus}
+ + +
{data.competition_status==="nearly_published"?"--":data&&data.visits_count}
+ +
this.gotocourse(`/competitions/${this.props.match.params.identifier}/enroll`)}>{data.competition_status==="nearly_published"?"--":data&&data.member_count}
+ +
+ - {data.competition_status==="ended"?::} - - {data.competition_status==="ended"? - :data.enroll_end===true?: - data.competition_status==="progressing"?:data.enroll_end===true?: + data.competition_status==="progressing"?:""} - - {data&&data.enroll_end_time===null?"":`报名截止时间:${data&&data.enroll_end_time}`} -
-
- - - - this.getrightdatas(e)}> - {data&&data.competition_modules.map((item,key)=>{ - if(item.module_type!="enroll"){ - return( - - {/*{item.has_url===false?this.getrightdata(item.id,item.module_type,item.module_url,item.has_url)}*/} - {/*>{item.name}:this.getrightdata(item.id,item.module_type)}*/} - {/*>{item.name}}*/} - {item.name} - - ) - } - })} - - - - - {this.state.module_type==="chart"?Competitionedittype===false?this.Competitionedit()} - Competitioncallback={(e)=>this.Competitioncallback(e)} - />:"":Competitionedittype===false?this.Competitionedit()} - {...this.props} - {...this.state} - />:""} - {/**/} - {Competitionedittype===true?this.hideCompetitionedit()} - getlistdata={(keys,listkey)=>this.getlistdata(keys,listkey)} - Competitioncallback={(e)=>this.Competitioncallback(e)} - {...this.props} - {...this.state} - />:""} - - - + {data&&data.enroll_end_time===null?"":`报名截止时间:${data&&data.enroll_end_time}`} + +
+
+ + + + this.getrightdatas(e)}> + {data&&data.competition_modules.map((item,key)=>{ + if(item.module_type!="enroll"){ + return( + + {/*{item.has_url===false?this.getrightdata(item.id,item.module_type,item.module_url,item.has_url)}*/} + {/*>{item.name}:this.getrightdata(item.id,item.module_type)}*/} + {/*>{item.name}}*/} + {item.name} + + ) + } + })} + + + this.isdownloadpdf(e)}> + + 证书下载 + + + + + {this.state.isdownloadpdftype===true?"": + {this.state.module_type==="chart"?Competitionedittype===false?this.Competitionedit()} + Competitioncallback={(e)=>this.Competitioncallback(e)} + />:"":Competitionedittype===false?this.Competitionedit()} + {...this.props} + {...this.state} + />:""} + {/**/} + {Competitionedittype===true?this.hideCompetitionedit()} + getlistdata={(keys,listkey)=>this.getlistdata(keys,listkey)} + Competitioncallback={(e)=>this.Competitioncallback(e)} + {...this.props} + {...this.state} + />:""} + } + + {this.state.isdownloadpdftype===true? + + :""} +
) } } -export default CompetitionCommon; +export default CompetitionCommon; \ No newline at end of file From aa63b997dddfe1455d24cf2cf6984587d4b55e93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 1 Nov 2019 16:01:33 +0800 Subject: [PATCH 10/19] =?UTF-8?q?=E8=8E=B7=E5=A5=96=E8=AF=81=E4=B9=A6?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Competitioncommon/CompetitionCommon.js | 22 +++++++------------ .../CompetitionContentspdfdownload.js | 18 ++++++++++++--- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js index 52060ada1..43a41694c 100644 --- a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js @@ -253,15 +253,9 @@ class CompetitionCommon extends Component{ } - isdownloadpdf=()=>{ - this.setState({ - isdownloadpdftype:true - }) - - } render() { - let {data,thiskeys,Competitionedittype}=this.state; + let {data,module_type,Competitionedittype}=this.state; return ( data===undefined?"":
@@ -373,14 +367,14 @@ class CompetitionCommon extends Component{ })} - this.isdownloadpdf(e)}> - - 证书下载 - - + {/*this.isdownloadpdf(e)}>*/} + {/**/} + {/*证书下载*/} + {/**/} + {/**/} - {this.state.isdownloadpdftype===true?"": + {module_type==="certificate"?"": {this.state.module_type==="chart"?Competitionedittype===false?:""} } - {this.state.isdownloadpdftype===true? + {module_type==="certificate"? { + if(response.status===200){ + this.setState({ + data:response.data, + }) + + console.log(response.data) + } + }).catch((error) => { + console.log(error) + }) } render() { console.log(this.props) - + let {data}=this.state; return ( @@ -33,7 +45,7 @@ class CompetitionContentspdfdownload extends Component{ - 个人证书: 暂未生成 原因:还未认证个人信息,立即认证 + {data&&data.personal_certifications.length===0?个人证书:暂未生成 原因:还未认证个人信息,立即查看:""} From b3f43afa432bdd8dd3bfad2cc0cd7edbca8360bf Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Fri, 1 Nov 2019 16:48:30 +0800 Subject: [PATCH 11/19] =?UTF-8?q?=E5=AE=9E=E5=90=8D=E8=AE=A4=E8=AF=81?= =?UTF-8?q?=E5=92=8C=E8=81=8C=E4=B8=9A=E8=AE=A4=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/user/account/AccountBasicEdit.js | 235 ++---- .../user/account/AccountBasicEditItem.js | 199 +++++ .../user/modal/RealNameCertificationModal.js | 763 +++++++++++++----- 3 files changed, 825 insertions(+), 372 deletions(-) create mode 100644 public/react/src/modules/user/account/AccountBasicEditItem.js diff --git a/public/react/src/modules/user/account/AccountBasicEdit.js b/public/react/src/modules/user/account/AccountBasicEdit.js index 1f87454a5..033f433b0 100644 --- a/public/react/src/modules/user/account/AccountBasicEdit.js +++ b/public/react/src/modules/user/account/AccountBasicEdit.js @@ -4,6 +4,7 @@ import { SnackbarHOC, getImageUrl, City, ConditionToolTip } from 'educoder'; import { Form, Button, Input, Radio, Select, Tooltip, Icon, AutoComplete } from 'antd' import ApplyForAddOrgModal from '../modal/ApplyForAddOrgModal' import ApplyForAddChildOrgModal from '../modal/ApplyForAddChildOrgModal' +import AccountBasicEditItem from './AccountBasicEditItem'; import axios from 'axios' import { identityMap } from './AccountBasic' const RadioGroup = Radio.Group; @@ -282,7 +283,9 @@ class AccountBasic extends Component { getDepartments=(e,flag)=>{ let arr=this.state.schoolList.filter(function(item){ - return item.name == e; + if(item.name.indexOf(e) > -1){ + return item.name; + } }); if (!arr[0]) { if (!e) { @@ -354,20 +357,7 @@ class AccountBasic extends Component { }) } - // 切换职称 - changeJob=(e)=>{ - - this.setState({ - identity:e - }) - let {basicInfo}=this.props; - if(basicInfo){ - this.props.form.setFieldsValue({ - job1:basicInfo && basicInfo.identity=="teacher" ? basicInfo.technical_title:"教授", - job2:basicInfo && basicInfo.identity=="professional" ? basicInfo.technical_title:"企业管理者", - }) - } - } + addOrgSuccess = (name) => { // const schoolList = this.state.schoolList.slice(0) @@ -407,6 +397,19 @@ class AccountBasic extends Component { } callback(`请输入真实姓名,最大限制${MAX_NAME_LENGTH}个字符`); } + // 切换职称 + changeJob=(e)=>{ + this.setState({ + identity:e + }) + let {basicInfo}=this.props; + if(basicInfo){ + this.props.form.setFieldsValue({ + job1:basicInfo && basicInfo.identity=="teacher" ? basicInfo.technical_title:"教授", + job2:basicInfo && basicInfo.identity=="professional" ? basicInfo.technical_title:"企业管理者", + }) + } + } render() { let{ @@ -422,10 +425,17 @@ class AccountBasic extends Component { }=this.state; const { getFieldDecorator } = this.props.form; let{ basicInfo }=this.props - - // 已职业认证的账户不能修改职业,学校/单位,院系/部门,产品还未确定,先默认为false--可以更改 - // basicInfo && basicInfo.professional_certification == "certified" - const professionalFlag = false; + let common = { + changeJob:this.changeJob, + filterList:this.filterList, + changeList:this.changeList, + searchDepartment:this.searchDepartment, + changeDepartment:this.changeDepartment, + showApplyForAddOrgModal:this.showApplyForAddOrgModal, + showApplyForAddChildOrgModal:this.showApplyForAddChildOrgModal + } + // 已职业认证的账户不能修改职业,学校/单位,院系/部门(true为disable) + const professionalFlag = basicInfo && basicInfo.professional_certification == "certified" ; // form合并了 const propsWithoutForm = Object.assign({}, this.props) @@ -599,177 +609,22 @@ class AccountBasic extends Component { )} -
- - {getFieldDecorator('job', { - rules: [{ - initialValue:"teacher", - required: true, - message: '请先选择职业', - }], - })( - - )} - - { - identity && identity=="student" && - - {getFieldDecorator('student_No', { - rules: [{ - required: true, - message: '请先输入学号', - }], - })( - - )} - - } - { - identity && identity=="teacher" && - - {getFieldDecorator('job1', { - rules: [{ - initialValue:"教授", - required: true, - message: '请先选择职称', - }], - })( - - )} - - } - { - identity && identity=="professional" && - - {getFieldDecorator('job2', { - rules: [{ - initialValue:"企业管理者", - required: true, - message: '请先选择职称', - }], - })( - - )} - - } -
- - - {getFieldDecorator('org', { - rules: [{ - // initialValue: this.state.cityDefaultValue, - // type: 'array', - required: true, - message: '请先选择学校/单位', - - // 做不了,输入时和submit时都会执行这里 - // validator: (rule, value, callback) => { - // if (this.this_school_id) { - // callback(); - // return; - // } - // callback('请先选择学校/单位'); - // } - - }], - })( - - { - filterSchoolList && filterSchoolList.map((item,key)=>{ - return() - }) - } - - )} - - - {!filterSchoolList || (filterSchoolList && filterSchoolList.length==0 )&& school && -
- - 未找到包含“{school}”的高校, - 申请新增 - -
- } - - {getFieldDecorator('org2', { - rules: [{ - // initialValue: this.state.cityDefaultValue, - // type: 'array', - required: true, - message: '请先选择院系/部门', - // validator: (rule, value, callback) => { - // if (this.this_department_id) { - // callback(); - // return; - // } - // callback('请先选择院系/部门'); - // } - }], - })( - - { - filterDepartments && filterDepartments.map((item,key)=>{ - return( - - ) - }) - } - - )} - - - { - filterDepartments != undefined && ( (filterDepartments && filterDepartments.length==0 ) - || (departmentsName == '' && !this.state.department_id - && (!departments || departments.length == 0) )) && -
- - {departmentsName ? `未找到包含“${departmentsName}”的院系/部门` : '未找到院系'}, - 申请新增 - -
- } - - + {/* htmlType="submit" */} {/*
*/} diff --git a/public/react/src/modules/user/account/AccountBasicEditItem.js b/public/react/src/modules/user/account/AccountBasicEditItem.js new file mode 100644 index 000000000..28988ebf3 --- /dev/null +++ b/public/react/src/modules/user/account/AccountBasicEditItem.js @@ -0,0 +1,199 @@ +import React, { Component } from 'react'; + +import { SnackbarHOC, getImageUrl, City, ConditionToolTip } from 'educoder'; +import { Form, Button, Input, Radio, Select, Tooltip, Icon, AutoComplete } from 'antd' +const RadioGroup = Radio.Group; +const Option = Select.Option; +class AccpimtBasicEditItem extends Component { + constructor(props){ + super(props); + } + + render(){ + let { + professionalFlag , + getFieldDecorator , + identity , + filterSchoolList , + filterDepartments, + departmentsName, + school, + departments, + department_id + } = this.props + return( +
+
+ + {getFieldDecorator('job', { + rules: [{ + initialValue:"teacher", + required: true, + message: '请先选择职业', + }], + })( + + )} + + { + identity && identity=="student" && + + {getFieldDecorator('student_No', { + rules: [{ + required: true, + message: '请先输入学号', + }], + })( + + )} + + } + { + identity && identity=="teacher" && + + {getFieldDecorator('job1', { + rules: [{ + initialValue:"教授", + required: true, + message: '请先选择职称', + }], + })( + + )} + + } + { + identity && identity=="professional" && + + {getFieldDecorator('job2', { + rules: [{ + initialValue:"企业管理者", + required: true, + message: '请先选择职称', + }], + })( + + )} + + } +
+ + {getFieldDecorator('org', { + rules: [{ + // initialValue: this.state.cityDefaultValue, + // type: 'array', + required: true, + message: '请先选择学校/单位', + + // 做不了,输入时和submit时都会执行这里 + // validator: (rule, value, callback) => { + // if (this.this_school_id) { + // callback(); + // return; + // } + // callback('请先选择学校/单位'); + // } + + }], + })( + + { + filterSchoolList && filterSchoolList.map((item,key)=>{ + return() + }) + } + + )} + + + {!filterSchoolList || (filterSchoolList && filterSchoolList.length==0 )&& school && +
+ + 未找到包含“{school}”的高校, + 申请新增 + +
+ } + + + {getFieldDecorator('org2', { + rules: [{ + // initialValue: this.state.cityDefaultValue, + // type: 'array', + required: true, + message: '请先选择院系/部门', + // validator: (rule, value, callback) => { + // if (this.this_department_id) { + // callback(); + // return; + // } + // callback('请先选择院系/部门'); + // } + }], + })( + + { + filterDepartments && filterDepartments.map((item,key)=>{ + return( + + ) + }) + } + + )} + + + { + filterDepartments != undefined && ( (filterDepartments && filterDepartments.length==0 ) + || (departmentsName == '' && ! department_id + && (!departments || departments.length == 0) )) && +
+ + {departmentsName ? `未找到包含“${departmentsName}”的院系/部门` : '未找到院系'}, + 申请新增 + +
+ } +
+ ) + } +} +export default AccpimtBasicEditItem; \ No newline at end of file diff --git a/public/react/src/modules/user/modal/RealNameCertificationModal.js b/public/react/src/modules/user/modal/RealNameCertificationModal.js index 9af082fea..8076b0649 100644 --- a/public/react/src/modules/user/modal/RealNameCertificationModal.js +++ b/public/react/src/modules/user/modal/RealNameCertificationModal.js @@ -1,15 +1,19 @@ import React, { Component } from "react"; -import { message, Icon, Input, Form, Upload} from "antd"; +import { message, Icon, Input, Form, Upload,Radio ,Tooltip} from "antd"; import axios from 'axios' import ModalWrapper from "../../courses/common/ModalWrapper" -import { City, getUploadActionUrl, getImageUrl, ImageLayer2, getUploadActionUrlOfAuth } from 'educoder' +import { City, getUploadActionUrl, getImageUrl, ImageLayer2, getUploadActionUrlOfAuth ,ConditionToolTip } from 'educoder' import '../account/common.css' +import AccountBasicEditItem from '../account/AccountBasicEditItem' +import ApplyForAddOrgModal from './ApplyForAddOrgModal' +import ApplyForAddChildOrgModal from './ApplyForAddChildOrgModal' import authImg from '../../../images/account/auth.png' import jobImg from '../../../images/account/job.png' -const { TextArea } = Input; +const RadioGroup = Radio.Group; const Dragger = Upload.Dragger; +const MAX_NAME_LENGTH = 10 function getBase64(img, callback) { const reader = new FileReader(); reader.addEventListener('load', () => callback(reader.result)); @@ -26,16 +30,230 @@ function beforeUpload(file) { } return isJPG && isLt2M; } +export function getHiddenName(name) { + if (!name) return '' + let len=parseInt(name.length)-1; + let str=""; + for(var i = 0; i < len; i++){ str += "*"; } + const newName = name.substr(0,1)+str; + return newName +} class RealNameCertificationModal extends Component{ constructor(props){ super(props); this.state={ + identity:"teacher", + departmentsName:undefined, + filterSchoolList:undefined, + filterDepartments :undefined, + school:undefined, + school_id:undefined, + department_id:undefined, + schoolList:undefined, + departments:undefined, + showRealName:true, } } componentDidMount() { - + if(this.props.basicInfo){ + this.setValue(this.props.basicInfo); + this.getSchoolList(this.props.basicInfo); + } + } + + setValue=(basicInfo)=>{ + if(basicInfo){ + this.props.form.setFieldsValue({ + nickname:basicInfo.nickname, + name:!basicInfo.show_realname ? this.hideRealName(basicInfo.name) : basicInfo.name, + sex:String(basicInfo.gender), + job:basicInfo.identity, + org:basicInfo.school_name, + + // city:[basicInfo.location,basicInfo.location_city] + }) + setTimeout(() => { + // 等显示后再set + this.props.form.setFieldsValue({ + job:basicInfo.identity, + student_No:basicInfo.student_id, + org2:basicInfo.department_name, + job1:basicInfo && basicInfo.identity=="teacher" ? basicInfo.technical_title:"教授", + job2:basicInfo && basicInfo.identity=="professional" ? basicInfo.technical_title:"企业管理者", + }) + }, 100) + //if(basicInfo.nickname){ + this.setState({ + forDisable: true, + nameLength:basicInfo.nickname?basicInfo.nickname.length:0, + showRealName:basicInfo.show_realname, + realName: basicInfo.name, + identity:basicInfo.identity, + school_id:basicInfo.school_id, + department_id:basicInfo.department_id + }) + //} + } + } + + getSchoolList=(basicInfo, selectedName)=>{ + let url=`/schools/for_option.json`; + axios.get(url).then((result)=>{ + if(result){ + this.setState({ + schoolList:result.data.schools + }) + if (selectedName) { + let school_id + result.data.schools.reverse().some( item => { + if (item.name == selectedName) { + school_id = item.id + return true; + } + }) + this.props.form.setFieldsValue({ + org: selectedName + }) + this.setState({ + school_id, + school: selectedName + }, () => { + this.filterList(selectedName) + }) + } else if(basicInfo && basicInfo.school_name){ + this.setState({ + school:basicInfo.school_name, + filterSchoolList:this.state.schoolList.filter(function(item){ + return item.name.indexOf(basicInfo.school_name)>-1; + }) + }) + this.getDepartments(basicInfo.school_name,false); + } + } + }).catch((error)=>{ + console.log(error); + }) + } + + // 将名字隐藏起来 + hideRealName=(name)=>{ + this.setState({ realName: name }) + const newName = getHiddenName(name) + + this.props.form.setFieldsValue({ + name: newName + }) + return newName + } + + getDepartments=(e,flag)=>{ + let arr=this.state.schoolList.filter(function(item){ + if(item.name.indexOf(e) > -1){ + return item.name; + } + }); + if (!arr[0]) { + if (!e) { + this.setState({ + filterSchoolList: [] + }) + } + // 没找到学校,清空部门 + this.setState({ + departments: [], + filterDepartments: [], + departmentsName: '', + school_id: '', + department_id: '', + }) + this.this_school_id = '' + this.props.form.setFieldsValue({ + org2: '' + }) + return; + } + this.props.form.setFieldsValue({ + org: arr[0].name + }) + this.filterList(e) + // 保存选择的学校id + this.this_school_id = arr[0].id + this.setState({ + school_id: arr[0].id, + school:e, + }) + this._getDepartments(arr[0].id, flag) + } + _getDepartments = (schoolId, flag, selectedName) => { + let url=`/schools/${schoolId || this.state.school_id}/departments/for_option.json`; + axios.get(url).then((result)=>{ + if(result){ + this.setState({ + departments:result.data.departments, + filterDepartments:result.data.departments + }) + if (selectedName) { + let department_id + result.data.departments.reverse().some( item => { + if (item.name == selectedName) { + department_id = item.id + return true; + } + }) + this.props.form.setFieldsValue({ + org2: selectedName + }) + this.setState({ + department_id, + // school: selectedName + }) + } else if(result.data.departments && result.data.departments.length>0 && flag==true){ + // 切换学校后,部门默认选择第一个 + this.props.form.setFieldsValue({ + org2:result.data.departments[0].name + }) + this.setState({ + department_id: result.data.departments[0].id + }) + }else if(result.data.departments && result.data.departments.length == 0 && flag==true){ + this.props.form.setFieldsValue({ + org2:'' + }) + } + } + }).catch((error)=>{ + console.log(error); + }) + } + + filterList =(e)=>{ + const inputVal = e.trim() + let arr=[]; + if(inputVal){ + arr= this.state.schoolList.filter(function(item){ + return item.name.indexOf(inputVal)>-1; + }); + this.props.form.setFieldsValue({ + org: inputVal + }) + this.setState({ + school: inputVal, + filterSchoolList: arr + }) + } else { + this.setState({ + school: '', + }) + } + // else{ + // let {school}=this.state; + // arr= this.state.schoolList.filter(function(item){ + // return item.name.indexOf(school)>-1; + // }); + // } } + setVisible = (visible) => { this.refs.modalWrapper.setVisible(visible) } @@ -53,6 +271,7 @@ class RealNameCertificationModal extends Component{ let url = `/users/accounts/${current_user && current_user.login}/authentication_apply.json` axios.post((url),{ name:basicInfo.name, + gender:parseInt(values.sex), id_number:values.credentials }).then((result)=>{ if(result){ @@ -65,12 +284,13 @@ class RealNameCertificationModal extends Component{ }) }else{ // 职业认证 + // console.log(values.job == "student" ? values.student_No : values.job == "teacher" ? values.job1 : values.job2); let url = `/users/accounts/${current_user && current_user.login}/professional_auth_apply.json` axios.post((url),{ - school_id:basicInfo && basicInfo.school_id, - department_id:basicInfo && basicInfo.department_id, - identity:basicInfo && basicInfo.identity, - extra:basicInfo && basicInfo.identity == "student" ? basicInfo.student_id:basicInfo.technical_title + school_id:this.state.school_id, + department_id:this.state.department_id, + identity:this.state.identity, + extra: values.job == "student" ? values.student_No : values.job == "teacher" ? values.job1 : values.job2 }).then((result)=>{ if(result){ this.props.showNotification("申请已提交,请等待审核!"); @@ -119,13 +339,99 @@ class RealNameCertificationModal extends Component{ })); } } + // 切换职称 + changeJob=(e)=>{ + this.setState({ + identity:e + }) + let {basicInfo}=this.props; + if(basicInfo){ + this.props.form.setFieldsValue({ + job1:basicInfo && basicInfo.identity=="teacher" ? basicInfo.technical_title:"教授", + job2:basicInfo && basicInfo.identity=="professional" ? basicInfo.technical_title:"企业管理者", + }) + } + } + // 选择学校(获取对应学校的学院、部门) + changeList=(e)=>{ + this.getDepartments(e.trim(),true); + } + + showApplyForAddOrgModal = () => { + this.applyForAddOrgForm.setVisible(true) + } + showApplyForAddChildOrgModal = () => { + let{school,schoolList}=this.state; + let arr=schoolList.filter(function(item){ + return item.name == school; + }); + if(arr.length > 0){ + this.applyForAddChildOrgForm.setVisible(true) + }else{ + this.props.showNotification("请先选择正确的单位或者学校!"); + } + } + addOrgSuccess = (name) => { + // const schoolList = this.state.schoolList.slice(0) + // schoolList.push({ id: schoolList.length + 2000, name: name}) + // this.setState({ schoolList }) + + this.getSchoolList(this.props.basicInfo, name); + this.props.form.setFieldsValue({ + org: name + }) + } + + addChildOrgSuccess = (deptName) => { + + this._getDepartments(this.state.school_id, false, deptName); + + } + + // 隐藏或显示真实姓名 + showOrHide=(flag)=>{ + const name = this.props.form.getFieldsValue().name || this.props.basicInfo.name + this.setState({ + showRealName:flag==true?false:true + }) + if(flag==true){ // 隐藏真实姓名 + this.hideRealName(name); + }else{ // 显示 + this.props.form.setFieldsValue({ + name: this.state.realName + }) + } + } render(){ - const { course_lists, checkBoxValues, searchValue, loading, imageUrl, imageUrl2 } = this.state + const { course_lists, checkBoxValues, searchValue, loading, imageUrl, imageUrl2, + identity, + departmentsName , + filterSchoolList , + filterDepartments , + school, + department_id, + departments, + school_id, + + showRealName + } = this.state const { moduleName } = this.props const { getFieldDecorator } = this.props.form; let {certification}=this.props; // /api/users/accounts/${this.props.current_user.login}/auth_attachment.json + + // 已职业认证的账户不能修改职业,学校/单位,院系/部门(true为disable) + const professionalFlag = basicInfo && basicInfo.professional_certification == "certified" ; + + let{ basicInfo }=this.props + let common={ + changeJob:this.changeJob, + filterList:this.filterList, + changeList:this.changeList, + showApplyForAddOrgModal:this.showApplyForAddOrgModal, + showApplyForAddChildOrgModal:this.showApplyForAddChildOrgModal + } const uploadProps2 = { name: 'image', data:{type:certification == 1 ? "real_name" : "professional"}, @@ -136,190 +442,283 @@ class RealNameCertificationModal extends Component{ className: 'idPic-uploader', onChange: this.handleChange2, }; + + // form合并了 + const propsWithoutForm = Object.assign({}, this.props) + delete propsWithoutForm.form return( - 实名认证: - 职业认证 - } - {...this.props } - onOk={this.onOk} - okText="保存" - className="applyForModal certificationModal courseNormalForm" - bottomRender={ - certification && certification == 1? -
-

认证须知:

-

- 1.你需要准备有效的身份证正面(人像面)的证件照照片,请确保证件照片清晰可见,严禁PS; -

- 2.我们将在你提交认证信息后的24小时(不包含节假日)内完成审核,审核结果将会以系统消息的形式发送给你; -

- 3.实名认证审核完成后,无法删除,请谨慎填写; -

- 4.实名认证审核完成后,系统将自动发放500个金币作为奖励; -

- 5.我们会确保你所提供的信息均处于严格的保密状态,不会泄露; -

- 6.如存在恶意乱填写姓名,证件号,及上传与实名认证证件无关图片者,一经发现将冻结EduCoder账号。 -

-
: -
-

认证须知:

-

- 1.根据职业上传相应的证件照:教师(教师证),专业人士(员工证)、学生(学生证),请确保证件照内容完整并且清晰可见,严禁PS; -

- 2.我们将在你提交职业证信息后的24小时(不包含节假日)内完成审核,审核结果将会以系统消息的形式发送给你; -

- 3.职业认证审核完成后,无法删除,请谨慎填写;职业变更请选择重新认证; -

- 4.职业认证审核完成后,系统将自动发放500个金币作为奖励; -

- 5.我们会确保你所提供的信息均处于严格的保密状态,不会泄露; -

- 6.如存在恶意乱填写姓名,学号,及上传与职业证件无关图片者,一经发现将冻结EduCoder账号。 -

-
- } - > - -
- { - certification && certification ==1 && - - {getFieldDecorator('credentials', { - rules: [{ - // initialValue: this.state.cityDefaultValue, - required: true, - message: '请输入证件号', - }], - })( - - )} - - } -
+ span.idPic-uploader.demoImg { + width:160px; + background:rgba(240,240,240,1); + border:1px solid rgba(218,218,218,1); + border-radius:4px; + padding:0px 5px; + justify-content: center; + align-items: center; + display: -webkit-flex; + } + .formItemInline.ant-form-item { + display: -ms-flexbox; + display: flex; + } + .formItemInline { + display: flex; + margin-bottom: 10px; + position: relative; + } + .formItemInline .ant-form-explain{ + position:absolute; + bottom:-20px; + left:0px; + width:100%; + } + .yslgraduainputedit{ + width:295px; + } + `} + + + { certification && certification == 1 ?
- { certification && certification == 1 ? "身份证(人像面)上传":"职业证照片上传" } - (png/jpg/bmp格式,不超过2MB) -
- -
- - avatar - - - {imageUrl2 ? - // - avatar - : - -

- -

-

点击或拖拽上传图片

- {/*

Support for a single or bulk upload. Strictly prohibit from uploading company data or other band files

*/} -
+ + { basicInfo.authentication == 'uncertified' ? {getFieldDecorator('name', { + rules: [{ + // initialValue: this.state.cityDefaultValue, + required: true, + message: `请输入真实姓名,最大限制${MAX_NAME_LENGTH}个字符`, + validator: this.checkNameLength + }], + })( + this.showOrHide(showRealName)}> + }> + )} + { showRealName ? '(显示:平台将显示您的真实姓名)' : '(隐藏:平台将显示你的昵称)' } + : +
+ + {showRealName ? this.props.basicInfo.name : getHiddenName(this.props.basicInfo.name)} + + this.showOrHide(showRealName)}> + { showRealName ? '(显示:平台将显示您的真实姓名)' : '(隐藏:平台将显示你的昵称)' } +
} -
+ + + + {getFieldDecorator('sex', { + rules: [{ + required: true, + message: '请选择性别', + }], + })( + + + + + + + )} + + + {getFieldDecorator('credentials', { + rules: [{ + // initialValue: this.state.cityDefaultValue, + required: true, + message: '请输入证件号', + }], + })( + + )} +
-
- 示例图片 - - - 查看大图 + : + + } +
+
+ { certification && certification == 1 ? "身份证上传:":"职业证上传:" } +
+ + avatar + + + {imageUrl2 ? + // + avatar + : + +

+ +

+

点击或拖拽上传图片

+ {/*

Support for a single or bulk upload. Strictly prohibit from uploading company data or other band files

*/} +
+ } +
+
+
+
+ +

示例图片

+

(png/jpg/bmp格式,不超过2MB)

+ + + 查看大图 + +
-
- + - - - + + +
) } } From d615be0346dd8339c67d70f7d8018e8461c6d83e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 1 Nov 2019 17:31:24 +0800 Subject: [PATCH 12/19] =?UTF-8?q?=E7=AB=9E=E8=B5=9B=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CompetitionContentspdf.js | 13 +- .../CompetitionContentspdfdownload.css | 10 ++ .../CompetitionContentspdfdownload.js | 131 ++++++++++++++++-- 3 files changed, 140 insertions(+), 14 deletions(-) diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdf.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdf.js index 177356400..3f059ce41 100644 --- a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdf.js +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdf.js @@ -11,7 +11,7 @@ class CompetitionContentspdf extends Component{ constructor(props) { super(props) this.state={ - + Tabskey:"1" } } @@ -20,6 +20,12 @@ class CompetitionContentspdf extends Component{ } + Competitioncallback=(key)=>{ + this.setState({ + Tabskey:key + }) + } + render() { @@ -27,11 +33,12 @@ class CompetitionContentspdf extends Component{
- - + this.Competitioncallback(e)} activeKey={this.state.Tabskey}> + this.Competitioncallback(e)} /> diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfdownload.css b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfdownload.css index eb41e7c05..b8d6812f1 100644 --- a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfdownload.css +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfdownload.css @@ -9,4 +9,14 @@ .pdfpicture{ font-size:16px; color:rgba(0,0,0,1); +} +.pdfdownloadfont4CACFF{ + color: #4CACFF; +} + +.pdfdownloadfont00CC5F{ + color:#00CC5F; +} +.pdfdownloadfontFF6602{ + color:#FF6602; } \ No newline at end of file diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfdownload.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfdownload.js index 1e4d520d4..c83cefe7f 100644 --- a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfdownload.js +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfdownload.js @@ -1,5 +1,5 @@ import React, { Component } from 'react'; -import {Button,Layout,Row, Col,Divider} from 'antd'; +import {Button,Layout,Row, Col,Divider,Table} from 'antd'; import axios from 'axios'; import {getImageUrl} from 'educoder'; import './CompetitionContentspdfdownload.css'; @@ -16,15 +16,12 @@ class CompetitionContentspdfdownload extends Component{ componentDidMount(){ window.document.title = '竞赛'; - console.log(this.props.match.params.identifier) let url=`/competitions/${this.props.match.params.identifier}/prize.json`; axios.get(url).then((response) => { if(response.status===200){ this.setState({ data:response.data, }) - - console.log(response.data) } }).catch((error) => { console.log(error) @@ -32,8 +29,100 @@ class CompetitionContentspdfdownload extends Component{ } render() { - console.log(this.props) + + // email_binded: true + // name: "伍逸凡" + // phone_binded: true + // professional_auth: "authed" + // real_name_auth: "authed" + // role: "队长" + let {data}=this.state; + let bank_account=[]; + {data&&data.teams.map((item,key)=>{ + bank_account.push(item.bank_account) + }) + } + const columns = [ + { + title: '角色', + dataIndex: 'type', + key: 'type', + render: (text, record) => ( + + {record.role} + + ), + }, + { + title: '姓名', + dataIndex: 'name', + key: 'name', + render: (text, record) => ( + + {record.name} + + ), + }, + { + title: '实名认证', + dataIndex: 'namecertify', + key: 'namecertify', + render: (text, record) => ( + + {record.real_name_auth==="authed"?已认证:record.real_name_auth==="authing"?待审核:record.real_name_auth==="not_authed"?未认证:""} + + ), + }, + { + title: '职业认证', + key: 'certify', + dataIndex: 'certify', + render: (text, record) => ( + + {record.professional_auth==="authed"?已认证:record.real_name_auth==="authing"?待审核:record.real_name_auth==="not_authed"?未认证:""} + + ), + }, + { + title: '手机绑定', + key: 'mobile', + dataIndex: 'mobile', + render: (text, record) => ( + + {record.phone_binded===true?已绑定:未绑定} + + ), + }, + { + title: '邮箱绑定', + key: 'mail', + dataIndex: 'mail', + render: (text, record) => ( + + {record.email_binded===true?已绑定:未绑定} + + ), + }, + { + title: '开户行及银行卡号信息(队长填写)', + key: 'idcard', + dataIndex: 'idcard', + render: (value, row, index,record) => { + console.log(row) + console.log(record) + console.log(value) + const obj = { + children: bank_account[index], + props: {}, + }; + + obj.props.rowSpan = 0; + return obj + }, + }, + ]; + return ( @@ -45,19 +134,39 @@ class CompetitionContentspdfdownload extends Component{ - {data&&data.personal_certifications.length===0?个人证书:暂未生成 原因:还未认证个人信息,立即查看:""} + {data&&data.personal_certifications.length===0?个人证书:暂未生成 原因:还未认证个人信息,this.props.Competitioncallback("2")}>立即查看:""} - 团队证书: 暂未生成 - 立即下载 + 团队证书: + {data&&data.team_certifications.length===0?暂未生成 + :立即下载} + + {data&&data.teams.map((item,key)=>{ + return( + + {item.name}战队信息填报概况 - - XXXXXX战队信息填报概况 - + + + ) + }) + } From b7bedb5da85463d2f9e9c233dba58a571b30f334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 1 Nov 2019 20:59:09 +0800 Subject: [PATCH 13/19] =?UTF-8?q?=E7=AB=9E=E8=B5=9B=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=AE=8C=E5=96=84=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CompetitionContentspdfpeopledata.js | 799 ++++++++++++++++-- .../mycompetotionchild.css | 118 ++- 2 files changed, 866 insertions(+), 51 deletions(-) diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js index 9b5f13050..906c4a7bb 100644 --- a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js @@ -1,119 +1,820 @@ import React, { Component } from 'react'; -import {Button,Layout,Input} from 'antd'; +import {Button, Layout, Input, Form} from 'antd'; import axios from 'axios'; import {getImageUrl} from 'educoder'; import mycompetotionchild from './mycompetotionchild.css'; +import {getHiddenName} from "../../../../user/account/AccountBasicEdit"; +import '../../../../courses/css/Courses.css' +import RealNameCertificationModal from "../../../../user/modal/RealNameCertificationModal"; +export const identityMap = {"teacher": "教师", "student": "学生", "professional": "专业人士"} class CompetitionContentspdfpeopledata extends Component{ constructor(props) { super(props) - this.state={ - + this.state = { + basicInfo: {}, + updating: '', + secondsFlag: false, + seconds: 60, + phonebool: false, + emailbool: false, + formationdata: [], + bank_account_editable: false, + leader: false, + bank_account: undefined, + certification: 1 } } componentDidMount(){ window.document.title = '竞赛'; + console.log("获取用户信息"); + console.log(this.props); + this.getdata(); + this.GetawardinformationAPI(); } - render() { + GetawardinformationAPI = () => { + let url = `/competitions/${this.props.match.params.identifier}/prize.json`; + axios.get(url).then((result) => { + if (result.data) { + this.setState({ + formationdata: result.data.formationdata, + bank_account_editable: result.data.bank_account_editable, //队长是否可以编辑 + leader: result.data.leader, //是否是队长 + bank_account: result.data.bank_account, //队长银行卡号信息 + }) + } + }).catch((error) => { + console.log(error); + }) + } + + + getdata = () => { + let url = `/users/accounts/${this.props.current_user.login}.json`; + axios.get(url).then((result) => { + if (result.data) { + // if(result.data && result.data.base_info_completed == false){ + // this.props.history.push(`/account/profile/edit`); + // } + // "authentication": "uncertified", // "uncertified" | "applying" | "certified" + this.setState({ + basicInfo: Object.assign({}, {...result.data}, { + avatar_url: `${result.data.avatar_url}`, + gender: result.data.gender == null || result.data.gender == undefined ? 0 : result.data.gender + }) + }) + } + }).catch((error) => { + console.log(error); + }) + }; + // 绑定手机 + onPhoneSubmit = () => { + this.props.form.validateFieldsAndScroll((err, values) => { + if (!err) { + let {login} = this.props.current_user; + let reg = /^1\d{10}$/; + if (reg.test(values.phone)) { + let url = `/users/accounts/${login}/phone_bind.json` + axios.post((url), { + phone: values.phone, + code: values.phoneValidateCode + }).then((result) => { + if (result) { + this.props.showNotification("手机号码绑定成功!"); + this.setState({ + phonebool: false + }) + this.getdata(); + } + }).catch((error) => { + console.log(error); + }) + } else { + this.props.showNotification("请输入有效的11位手机号码"); + } + } + }) + } + // 绑定邮箱 + onEmailSubmit = () => { + this.props.form.validateFieldsAndScroll((err, values) => { + if (!err) { + let {login} = this.props.current_user; + let reg = /^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/; + if (reg.test(values.email)) { + let url = `/users/accounts/${login}/email_bind.json` + axios.post((url), { + email: values.email, + code: values.emailValidateCode + }).then((result) => { + if (result) { + this.props.showNotification("邮箱地址绑定成功!"); + this.setState({ + updating: '' + }) + this.getdata(); + } + }).catch((error) => { + console.log(error); + }) + } else { + this.props.showNotification("请输入正确的邮箱地址"); + } + } + }) + } + //取消编辑 + hideUpdating = (i) => { + if (i === 1) { + this.setState({ + phonebool: false + }) + } else if (i === 2) { + this.setState({ + emailbool: false + }) + + } else if (i === 3) { + + } + + } + + // 获取验证码 + getCode = (index) => { + let url = `/accounts/get_verification_code.json` + let login = ''; + let values = this.props.form.getFieldsValue(); + if (index == 3) { + //绑定手机号码 + login = values.phone; + let reg = /^1\d{10}$/; + if (reg.test(login) == false) { + this.props.showNotification(`请先输入正确的手机号码`); + return; + } + } else if (index == 4) { + // 绑定邮箱 + login = values.email; + let reg = /^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/; + if (reg.test(login) == false) { + this.props.showNotification(`请先输入正确的邮箱地址`); + return; + } + } + let type = index; + if (!login) { + this.props.showNotification(`请先输入${index == 3 ? "手机号码" : "邮箱地址"}`); + return; + } + axios.get((url), { + params: { + login, type + } + }).then((result) => { + if (result) { + // 倒计时 + this.setState({ + secondsFlag: true + }) + this.remainTime(); + } + }).catch((error) => { + console.log(error); + }) + } + + // 获取验证码倒计时 + remainTime = () => { + this.setState({ + seconds: 60 + }) + this.timer = setInterval(() => { + let {seconds} = this.state; + let s = parseInt(seconds) - 1; + if (s > -1) { + this.setState({ + seconds: s + }) + } else { + this.setState({ + secondsFlag: false + }) + clearInterval(this.timer); + } + }, 1000) + } + + phonebools = () => { + this.setState({ + phonebool: true + }) + } + + emailbools = () => { + console.log("点击了邮箱"); + this.setState({ + emailbool: true + }) + } + + //立即认证 + checkBasicInfo = (index) => { + if (this.state.basicInfo.base_info_completed == true) { + this.showRealNameCertificationModal(index) + } else { + this.props.confirm({ + okText: `立即完善`, + content: `请先完善基本信息`, + onOk: () => { + this.props.history.push('/account/profile/edit') + } + }) + } + + } + showRealNameCertificationModal = (index) => { + this.setState({ + certification: index, + }, () => { + if (index == 1) { + this.realNameCertificationModal1.setVisible(true) + } else if (index == 2) { + this.realNameCertificationModal2.setVisible(true) + } + }) + } + //绑定银行确认 + yhBankstrue = () => { + this.props.form.validateFieldsAndScroll((err, values) => { + if (!err) { + let url = `/competitions/${this.props.match.params.identifier}/prize_leader_account.json`; + axios.patch(url, { + bank: values.openingbank, + second_bank: values.subbranchs, + card_no: values.subbranch + }) + .then((result) => { + try { + if (result.data.status == 0) { + // console.log(JSON.stringify(result)); + this.props.showNotification(`提交成功成功`); + this.getdata(); + this.GetawardinformationAPI(); + } + } catch (e) { + + } + + }).catch((error) => { + console.log(error); + }) + } + }) + + } + //撤销认证 + Cancellationofapplication = (index) => { + let url = "" + if (index === 1) { + url = `/users/accounts/${this.props.user.user_id}/authentication_apply.json`; + } else if (index === 2) { + url = `/users/accounts/${this.props.user.user_id}/professional_auth_apply.json`; + } + axios.delete(url) + .then((response) => { + try { + if (response.data.status == 0) { + if (index === 1) { + this.props.showNotification('撤销实名认证成功') + } else if (index === 2) { + this.props.showNotification('撤销职业认证成功') + } + + + } + } catch (e) { + + } + + }) + .catch(function (error) { + console.log(error); + }); + } + + + render() { + const {getFieldDecorator} = this.props.form; + const {updating, seconds, secondsFlag, basicInfo, phonebool, emailbool, certification, formationdata, bank_account_editable, leader, bank_account} = this.state + console.log(emailbool); return (
+ {this.state.certification === 1 ? this.realNameCertificationModal1 = form} + certification={certification} + > : ""} + + {this.state.certification === 2 ? this.realNameCertificationModal2 = form} + certification={certification} + > : ""}

*实名信息

-

通过实名认证后才能获得证书

-

立即认证

+ {basicInfo && basicInfo.authentication == "uncertified" ? +

通过实名认证后才能获得证书

: "" + } + {basicInfo && basicInfo.authentication == "uncertified" ? +

this.checkBasicInfo(1)}>立即认证

: "" + } +

姓名:

-

胡志勇

已认证

待审核!

撤销认证

+

{basicInfo && basicInfo.name} + + { + basicInfo && basicInfo.authentication == "uncertified" ? "" : + basicInfo && basicInfo.authentication == "applying" ? +

待审核!

this.Cancellationofapplication(1)}>撤销认证

+ : +

+

已认证

+

+ } +

性别:

-

+

{basicInfo && basicInfo.gender == 0 ? "男" : "女"}

*职业信息

-

通过职业认证后才能获得证书

-

立即认证

+ { + basicInfo && basicInfo.professional_certification == "uncertified" ? +

通过职业认证后才能获得证书

+ + : ""} + { + basicInfo && basicInfo.professional_certification == "uncertified" ? +

this.checkBasicInfo(2)}>立即认证

+ + : ""}

职业:

-

教师

已认证

待审核!

撤销认证

+

{basicInfo && basicInfo.identity && identityMap[basicInfo.identity]} + { + basicInfo && basicInfo.professional_certification == "uncertified" ? + "" : + basicInfo && basicInfo.professional_certification == "applying" ? +

+

待审核!

this.Cancellationofapplication(2)}>撤销认证

+

+ : +

+

已认证

+

this.checkBasicInfo(2)}>重新认证

+ +

+ } +

职称:

-

副教授

+

{basicInfo && basicInfo.technical_title}

学校:

-

国防科技大学

+

{basicInfo && basicInfo.school_name}

院系:

-

计算机学院

+

{basicInfo && basicInfo.department_name}

-

*联系方式

手机号:

-

未绑定

-

立即绑定

+ { + basicInfo && basicInfo.phone ? +

{basicInfo && basicInfo.phone}

+ : +

未绑定

+ } +

this.phonebools()}>{basicInfo && basicInfo.phone ? (phonebool === false ? "更换" : "") : (phonebool === false ? "立即绑定" : "")}

+ {/*手机号绑定*/} + { + phonebool === true ? +
+ +
+ + + {getFieldDecorator('phone', { + rules: [{ + // initialValue: this.state.cityDefaultValue, + required: true, + message: `请输入要${basicInfo.phone ? '更换' : '绑定'}的手机号码`, + }], + })( + + )} + + + + {getFieldDecorator('phoneValidateCode', { + rules: [{ + // initialValue: this.state.cityDefaultValue, + required: true, + message: '请输入手机获取的验证码', + }], + })( + + )} + + + +
+ + +
+
+
+
+ : "" + } + +

Email:

-

163@163.com

-

更换

+

{basicInfo && basicInfo.mail}

+

this.emailbools()}>{basicInfo && basicInfo.mail ? (emailbool === false ? "更换" : "") : (emailbool === false ? "立即绑定" : "")}

+ { + emailbool === false ? "" : +
+ +
+ + + {getFieldDecorator('email', { + rules: [{ + // initialValue: this.state.cityDefaultValue, + required: true, + message: basicInfo && basicInfo.mail ? '请输入要更换的新邮箱地址' : '请输入邮箱地址', + }], + })( + + )} + + + + {getFieldDecorator('emailValidateCode', { + rules: [{ + // initialValue: this.state.cityDefaultValue, + required: true, + message: '请输入邮箱收到的验证码', + }], + })( + + )} + + -
-

签/领/开户行及银行卡号

-

为保障奖金的及时发放,请队长如实填写你名下的银行卡信息

+
+ + +
+ +
+ } + { + leader === true ? +
+ { + bank_account_editable === true ? +
+
+

签/领/开户行及银行卡号

+

为保障奖金的及时发放,请队长如实填写你名下的银行卡信息

+
+
+ + + // class="ant-col ant-form-item-label" + `} +
+ + + {getFieldDecorator('openingbank', { + rules: [{ + // initialValue: this.state.cityDefaultValue, + required: true, + message: '请输入开户行', + }], + })( + + )} + -
-

开户行:

- -
+ + {getFieldDecorator('subbranch', { + rules: [{ + // initialValue: this.state.cityDefaultValue, + required: true, + message: '请输入支行', + }], + })( + + )} + -
-

支行:

- -
+ + {getFieldDecorator('subbranchs', { + rules: [{ + // initialValue: this.state.cityDefaultValue, + required: true, + message: '请输入账号', + }], + })( + + )} + -
-

账号:

- -
+
+

+
+ {/*
this.yhBanksfalse()}>

取消

*/} + +
+
+
+
-
-

-
-

取消

-

确认

+
+
+ + : +
+
+

签/领/开户行及银行卡号

+

为保障奖金的及时发放,请队长如实填写你名下的银行卡信息

+
+ { + bank_account && bank_account ? +
+
+

开户行:

+

{bank_account && bank_account.bank}

+
+
+

支行:

+

{bank_account && bank_account.second_bank}

+
+
+

账号:

+

{bank_account && bank_account.card_no}

+
+
+ : + "" + } + +
+ } + +
+ : "" + } -
-
) } } -export default CompetitionContentspdfpeopledata; + +const CompetitionContentspdfpeopledatas = Form.create({name: 'CompetitionContentspdfpeopledata'})(CompetitionContentspdfpeopledata); + +export default CompetitionContentspdfpeopledatas; + diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/mycompetotionchild.css b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/mycompetotionchild.css index bf73dc59d..9f62759df 100644 --- a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/mycompetotionchild.css +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/mycompetotionchild.css @@ -128,8 +128,8 @@ .buttongo2{ background: #4CACFF; border: 1px solid #4CACFF; - width: 60px; - height: 30px; + width: 64px; + height: 32px; border-radius: 4px; color: #FFFFFF; font-size: 16px; @@ -181,3 +181,117 @@ text-align: center; } + +.mycompitcursor { + cursor: pointer; +} + +.basicForm { + background: #fff; + padding: 30px; + margin-bottom: 10px; + box-sizing: border-box; + width: 100%; + min-height: 390px; +} + +.basicForm .title { + font-size: 16px; + padding-left: 30px; + margin-bottom: 10px; +} + +.flexTable { + display: flex; + flex-direction: column; +} + +.flexRow { + display: flex; +} + +.mb15 { + margin-bottom: 15px !important; +} + +/* BUTTOn */ +.ant-btn { + border-radius: 2px; +} + +button.ant-btn.ant-btn-primary.grayBtn { + background: #CBCBCB; + border-color: #CBCBCB; +} + +.borderBottom { + border-bottom: 1px solid #4CACFF; +} + +/* form ---------------- START */ +.formItemInline { + display: flex; +} + +.formItemInline .ant-form-item-control-wrapper { + display: inline-block; +} + +.hideRequireTag .ant-form-item-required:before { + display: none; +} + + +/* .basicForm .ant-form-item-label { + width: 100px; + padding-right: 10px; +} + .basicForm .ant-form-item-label label { + color: #979797 + } */ + + +.courseNormalForm .ant-select-show-search { + height: 40px; +} + +.courseNormalForm .ant-select-auto-complete.ant-select .ant-input { + height: 40px; +} + +.courseNormalForm .ant-select-search__field__mirror { + height: 40px; +} + +.courseNormalForm .ant-input-lg { + height: 40px; +} + +.courseNormalForm .ant-select-selection--single { + height: 40px; +} + +.courseNormalForm .ant-select-auto-complete.ant-select .ant-select-selection--single { + height: 40px +} + +.courseNormalForm .ant-input-affix-wrapper { + height: 40px; +} + +/* 职业 */ +.courseNormalForm .ant-select-selection-selected-value { + line-height: 38px +} + +.courseNormalForm input { + height: 40px; +} + +.w300 { + width: 300px; +} + +.w56 { + width: 56px; +} From ab502dbaf330efd5c6e781ab0415498521ea9304 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 1 Nov 2019 22:58:47 +0800 Subject: [PATCH 14/19] =?UTF-8?q?=E7=AB=9E=E8=B5=9B=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CompetitionContentspdfdownload.css | 2 +- .../CompetitionContentspdfdownload.js | 84 ++++++++++++------- .../modules/courses/statistics/Statistics.js | 2 +- 3 files changed, 57 insertions(+), 31 deletions(-) diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfdownload.css b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfdownload.css index b8d6812f1..27ce04e99 100644 --- a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfdownload.css +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfdownload.css @@ -11,7 +11,7 @@ color:rgba(0,0,0,1); } .pdfdownloadfont4CACFF{ - color: #4CACFF; + color: #4CACFF !important; } .pdfdownloadfont00CC5F{ diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfdownload.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfdownload.js index c83cefe7f..55d7fd239 100644 --- a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfdownload.js +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfdownload.js @@ -10,7 +10,8 @@ class CompetitionContentspdfdownload extends Component{ constructor(props) { super(props) this.state={ - data:undefined + data:undefined, + teams:undefined } } @@ -19,8 +20,23 @@ class CompetitionContentspdfdownload extends Component{ let url=`/competitions/${this.props.match.params.identifier}/prize.json`; axios.get(url).then((response) => { if(response.status===200){ + + let datas=response.data.teams; + if(datas.length>0){ + datas.map((item,key)=>{ + let lista=item.team_members; + if(lista.length>0){ + console.log(lista) + lista.map((i,k)=>{ + i["bank_account"]=item.bank_account; + }) + } + }) + } + this.setState({ data:response.data, + teams:datas, }) } }).catch((error) => { @@ -30,19 +46,10 @@ class CompetitionContentspdfdownload extends Component{ render() { - // email_binded: true - // name: "伍逸凡" - // phone_binded: true - // professional_auth: "authed" - // real_name_auth: "authed" - // role: "队长" - - let {data}=this.state; - let bank_account=[]; - {data&&data.teams.map((item,key)=>{ - bank_account.push(item.bank_account) - }) - } + + + let {data,teams}=this.state; + const columns = [ { title: '角色', @@ -108,21 +115,20 @@ class CompetitionContentspdfdownload extends Component{ title: '开户行及银行卡号信息(队长填写)', key: 'idcard', dataIndex: 'idcard', - render: (value, row, index,record) => { - console.log(row) - console.log(record) - console.log(value) - const obj = { - children: bank_account[index], - props: {}, - }; - - obj.props.rowSpan = 0; - return obj + render: (value, record, index) => { + if (index === 0&&record.bank_account!=null) { + return { + children: {record.bank_account.bank + record.bank_account.second_bank + record.bank_account.card_no}, + }; + } + }, }, ]; + + let people=[ { url: '/api/competitions/xxxxx/certificates/1/personal' }, + { url: '/api/competitions/xxxxx/certificates/2/personal' },] return ( @@ -134,13 +140,30 @@ class CompetitionContentspdfdownload extends Component{ - {data&&data.personal_certifications.length===0?
个人证书:暂未生成原因:还未认证个人信息,this.props.Competitioncallback("2")}>立即查看:""} + 个人证书: {data&&data.personal_certifications.length===0?暂未生成 原因:还未认证个人信息,this.props.Competitioncallback("2")}>立即查看: + data&&data.personal_certifications.map((item,key)=>{ + return( + + + 立即下载 + + ) + })} 团队证书: {data&&data.team_certifications.length===0?暂未生成 - :立即下载} + :data&&data.team_certifications.map((item,key)=>{ + return( + + + 立即下载 + + ) + })} @@ -152,12 +175,15 @@ class CompetitionContentspdfdownload extends Component{ } .pdfdownloadTable .ant-table-tbody > tr > td{ color:#666666; - // border-bottom: 1px solid transparent; + border-bottom: 1px solid transparent; } + .pdfdownloadTable .ant-table-thead > tr > th, .ant-table-tbody > tr > td{ + text-align: center; + } ` } - {data&&data.teams.map((item,key)=>{ + {teams&&teams.map((item,key)=>{ return( {item.name}战队信息填报概况 diff --git a/public/react/src/modules/courses/statistics/Statistics.js b/public/react/src/modules/courses/statistics/Statistics.js index 3ba159dbf..d11df0b6a 100644 --- a/public/react/src/modules/courses/statistics/Statistics.js +++ b/public/react/src/modules/courses/statistics/Statistics.js @@ -438,7 +438,7 @@ class Statistics extends Component{ return(
  • - + From 7b7c44fd18657a839b1620b53d9ae0e377f14ac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 1 Nov 2019 23:34:27 +0800 Subject: [PATCH 15/19] =?UTF-8?q?=E7=AB=9E=E8=B5=9B=E6=8A=A5=E5=90=8D?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Competitioncommon/CompetitionCommon.js | 43 +++++++++++++++++-- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js index de1924975..ed5d2649b 100755 --- a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js @@ -23,7 +23,8 @@ class CompetitionCommon extends Component{ chart_rules:undefined, Competitionedittype:false, chartdata:undefined, - has_url:false + has_url:false, + signupdata:undefined } } @@ -230,10 +231,44 @@ class CompetitionCommon extends Component{ } } }else{ - this.props.history.replace(url); + + if(url==="personal"){ + this.Personalregistration() + }else{ + this.props.history.replace(url); + } + } } + + Personalregistration = () => { + + let {signupdata} = this.state; + let urls=`/competitions/${this.props.match.params.identifier}/enroll`; + if (signupdata.enroll_ended === true) { + //已截止 + this.props.showNotification(`报名已截止`); + return; + } + if (signupdata.enrolled === true) { + this.props.showNotification(`你已经报名,不能重复报名!`); + return; + } + const url = `/competitions/${this.props.match.params.identifier}/competition_teams.json`; + axios.post(url).then((response) => { + if (response) { + if (response.data) { + this.props.showNotification(`报名成功,预祝您夺得桂冠!`); + this.props.history.replace(urls); + } + } + }).catch((error) => { + + }); + } + + Competitioncallback=(key)=>{ this.setState({ tabkey:key @@ -255,7 +290,7 @@ class CompetitionCommon extends Component{ render() { - let {data,module_type,Competitionedittype}=this.state; + let {data,module_type,Competitionedittype,signupdata}=this.state; return ( data===undefined?"":
    @@ -338,7 +373,7 @@ class CompetitionCommon extends Component{ {data.competition_status==="nearly_published"?"未发布":"报名截止"} : data.competition_status==="progressing"?:""}
  • {data&&data.enroll_end_time===null?"":`报名截止时间:${data&&data.enroll_end_time}`} From 30e0c87fddc0499b332f4e98a855b0dfcd39ad13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sat, 2 Nov 2019 10:24:53 +0800 Subject: [PATCH 16/19] =?UTF-8?q?=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/config/webpack.config.dev.js | 6 +- .../CompetitionContentspdfpeopledata.js | 4 +- .../user/modal/RealNameCertificationModal.js | 1459 +++++++++-------- 3 files changed, 735 insertions(+), 734 deletions(-) diff --git a/public/react/config/webpack.config.dev.js b/public/react/config/webpack.config.dev.js index 63324c35f..f335f1705 100644 --- a/public/react/config/webpack.config.dev.js +++ b/public/react/config/webpack.config.dev.js @@ -32,7 +32,7 @@ module.exports = { // See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.s // devtool: "cheap-module-eval-source-map", // 开启调试 - //devtool: "source-map", // 开启调试 + devtool: "source-map", // 开启调试 // These are the "entry points" to our application. // This means they will be the "root" imports that are included in JS bundle. // The first two entry points enable "hot" CSS and auto-refreshes for JS. @@ -153,8 +153,8 @@ module.exports = { include: paths.appSrc, loader: require.resolve('babel-loader'), options: { - - // This is a feature of `babel-loader` for webpack (not Babel itself). + + // This is a feature of `babel-loader` for webpack (not Babel itself). // It enables caching results in ./node_modules/.cache/babel-loader/ // directory for faster rebuilds. cacheDirectory: true, diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js index 2c2bcb6d3..dc4c3f971 100644 --- a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js @@ -315,12 +315,12 @@ class CompetitionContentspdfpeopledata extends Component { console.log(emailbool); return (
    - {this.state.certification === 1 ? this.realNameCertificationModal1 = form} certification={certification} > : ""} - {this.state.certification === 2 ? this.realNameCertificationModal2 = form} certification={certification} > : ""} diff --git a/public/react/src/modules/user/modal/RealNameCertificationModal.js b/public/react/src/modules/user/modal/RealNameCertificationModal.js index 8076b0649..7ec18a2c6 100644 --- a/public/react/src/modules/user/modal/RealNameCertificationModal.js +++ b/public/react/src/modules/user/modal/RealNameCertificationModal.js @@ -1,729 +1,730 @@ -import React, { Component } from "react"; -import { message, Icon, Input, Form, Upload,Radio ,Tooltip} from "antd"; -import axios from 'axios' -import ModalWrapper from "../../courses/common/ModalWrapper" -import { City, getUploadActionUrl, getImageUrl, ImageLayer2, getUploadActionUrlOfAuth ,ConditionToolTip } from 'educoder' -import '../account/common.css' -import AccountBasicEditItem from '../account/AccountBasicEditItem' -import ApplyForAddOrgModal from './ApplyForAddOrgModal' -import ApplyForAddChildOrgModal from './ApplyForAddChildOrgModal' - -import authImg from '../../../images/account/auth.png' -import jobImg from '../../../images/account/job.png' - -const RadioGroup = Radio.Group; -const Dragger = Upload.Dragger; -const MAX_NAME_LENGTH = 10 -function getBase64(img, callback) { - const reader = new FileReader(); - reader.addEventListener('load', () => callback(reader.result)); - reader.readAsDataURL(img); -} -function beforeUpload(file) { - const isJPG = file.type === 'image/jpeg'; - if (!isJPG) { - message.error('You can only upload JPG file!'); - } - const isLt2M = file.size / 1024 / 1024 < 2; - if (!isLt2M) { - message.error('Image must smaller than 2MB!'); - } - return isJPG && isLt2M; -} -export function getHiddenName(name) { - if (!name) return '' - let len=parseInt(name.length)-1; - let str=""; - for(var i = 0; i < len; i++){ str += "*"; } - const newName = name.substr(0,1)+str; - return newName -} -class RealNameCertificationModal extends Component{ - constructor(props){ - super(props); - this.state={ - identity:"teacher", - departmentsName:undefined, - filterSchoolList:undefined, - filterDepartments :undefined, - school:undefined, - school_id:undefined, - department_id:undefined, - schoolList:undefined, - departments:undefined, - showRealName:true, - } - } - - componentDidMount() { - if(this.props.basicInfo){ - this.setValue(this.props.basicInfo); - this.getSchoolList(this.props.basicInfo); - } - } - - setValue=(basicInfo)=>{ - if(basicInfo){ - this.props.form.setFieldsValue({ - nickname:basicInfo.nickname, - name:!basicInfo.show_realname ? this.hideRealName(basicInfo.name) : basicInfo.name, - sex:String(basicInfo.gender), - job:basicInfo.identity, - org:basicInfo.school_name, - - // city:[basicInfo.location,basicInfo.location_city] - }) - setTimeout(() => { - // 等显示后再set - this.props.form.setFieldsValue({ - job:basicInfo.identity, - student_No:basicInfo.student_id, - org2:basicInfo.department_name, - job1:basicInfo && basicInfo.identity=="teacher" ? basicInfo.technical_title:"教授", - job2:basicInfo && basicInfo.identity=="professional" ? basicInfo.technical_title:"企业管理者", - }) - }, 100) - //if(basicInfo.nickname){ - this.setState({ - forDisable: true, - nameLength:basicInfo.nickname?basicInfo.nickname.length:0, - showRealName:basicInfo.show_realname, - realName: basicInfo.name, - identity:basicInfo.identity, - school_id:basicInfo.school_id, - department_id:basicInfo.department_id - }) - //} - } - } - - getSchoolList=(basicInfo, selectedName)=>{ - let url=`/schools/for_option.json`; - axios.get(url).then((result)=>{ - if(result){ - this.setState({ - schoolList:result.data.schools - }) - if (selectedName) { - let school_id - result.data.schools.reverse().some( item => { - if (item.name == selectedName) { - school_id = item.id - return true; - } - }) - this.props.form.setFieldsValue({ - org: selectedName - }) - this.setState({ - school_id, - school: selectedName - }, () => { - this.filterList(selectedName) - }) - } else if(basicInfo && basicInfo.school_name){ - this.setState({ - school:basicInfo.school_name, - filterSchoolList:this.state.schoolList.filter(function(item){ - return item.name.indexOf(basicInfo.school_name)>-1; - }) - }) - this.getDepartments(basicInfo.school_name,false); - } - } - }).catch((error)=>{ - console.log(error); - }) - } - - // 将名字隐藏起来 - hideRealName=(name)=>{ - this.setState({ realName: name }) - const newName = getHiddenName(name) - - this.props.form.setFieldsValue({ - name: newName - }) - return newName - } - - getDepartments=(e,flag)=>{ - let arr=this.state.schoolList.filter(function(item){ - if(item.name.indexOf(e) > -1){ - return item.name; - } - }); - if (!arr[0]) { - if (!e) { - this.setState({ - filterSchoolList: [] - }) - } - // 没找到学校,清空部门 - this.setState({ - departments: [], - filterDepartments: [], - departmentsName: '', - school_id: '', - department_id: '', - }) - this.this_school_id = '' - this.props.form.setFieldsValue({ - org2: '' - }) - return; - } - this.props.form.setFieldsValue({ - org: arr[0].name - }) - this.filterList(e) - // 保存选择的学校id - this.this_school_id = arr[0].id - this.setState({ - school_id: arr[0].id, - school:e, - }) - this._getDepartments(arr[0].id, flag) - } - _getDepartments = (schoolId, flag, selectedName) => { - let url=`/schools/${schoolId || this.state.school_id}/departments/for_option.json`; - axios.get(url).then((result)=>{ - if(result){ - this.setState({ - departments:result.data.departments, - filterDepartments:result.data.departments - }) - if (selectedName) { - let department_id - result.data.departments.reverse().some( item => { - if (item.name == selectedName) { - department_id = item.id - return true; - } - }) - this.props.form.setFieldsValue({ - org2: selectedName - }) - this.setState({ - department_id, - // school: selectedName - }) - } else if(result.data.departments && result.data.departments.length>0 && flag==true){ - // 切换学校后,部门默认选择第一个 - this.props.form.setFieldsValue({ - org2:result.data.departments[0].name - }) - this.setState({ - department_id: result.data.departments[0].id - }) - }else if(result.data.departments && result.data.departments.length == 0 && flag==true){ - this.props.form.setFieldsValue({ - org2:'' - }) - } - } - }).catch((error)=>{ - console.log(error); - }) - } - - filterList =(e)=>{ - const inputVal = e.trim() - let arr=[]; - if(inputVal){ - arr= this.state.schoolList.filter(function(item){ - return item.name.indexOf(inputVal)>-1; - }); - this.props.form.setFieldsValue({ - org: inputVal - }) - this.setState({ - school: inputVal, - filterSchoolList: arr - }) - } else { - this.setState({ - school: '', - }) - } - // else{ - // let {school}=this.state; - // arr= this.state.schoolList.filter(function(item){ - // return item.name.indexOf(school)>-1; - // }); - // } - } - - setVisible = (visible) => { - this.refs.modalWrapper.setVisible(visible) - } - - onSendOk = () => { - this.props.form.validateFieldsAndScroll((err, values) => { - console.log(values); - if(!err){ - let{imageUrl2}=this.state; - let{current_user,basicInfo}=this.props; - if(imageUrl2){ - let { certification } = this.props; - if(certification == 1){ - // 实名认证 - let url = `/users/accounts/${current_user && current_user.login}/authentication_apply.json` - axios.post((url),{ - name:basicInfo.name, - gender:parseInt(values.sex), - id_number:values.credentials - }).then((result)=>{ - if(result){ - this.props.showNotification("申请已提交,请等待审核!"); - this.props.getBasicInfo(); - this.setVisible(false); - } - }).catch((error)=>{ - console.log(error); - }) - }else{ - // 职业认证 - // console.log(values.job == "student" ? values.student_No : values.job == "teacher" ? values.job1 : values.job2); - let url = `/users/accounts/${current_user && current_user.login}/professional_auth_apply.json` - axios.post((url),{ - school_id:this.state.school_id, - department_id:this.state.department_id, - identity:this.state.identity, - extra: values.job == "student" ? values.student_No : values.job == "teacher" ? values.job1 : values.job2 - }).then((result)=>{ - if(result){ - this.props.showNotification("申请已提交,请等待审核!"); - this.props.getBasicInfo(); - this.setVisible(false); - } - }).catch((error)=>{ - console.log(error); - }) - } - }else{ - this.props.showNotification("请先上传照片!"); - } - } - }) - } - - onOk = () => { - const { course_lists, checkBoxValues } = this.state - this.onSendOk() - } - - handleChange = (info) => { - if (info.file.status === 'uploading') { - this.setState({ loading: true }); - return; - } - if (info.file.status === 'done') { - // Get this url from response in real world. - getBase64(info.file.originFileObj, imageUrl => this.setState({ - imageUrl, - loading: false, - })); - } - } - handleChange2 = (info) => { - if (info.file.status === 'uploading') { - this.setState({ loading: true }); - return; - } - if (info.file.status === 'done') { - // Get this url from response in real world. - getBase64(info.file.originFileObj, imageUrl2 => this.setState({ - imageUrl2, - loading: false, - })); - } - } - // 切换职称 - changeJob=(e)=>{ - this.setState({ - identity:e - }) - let {basicInfo}=this.props; - if(basicInfo){ - this.props.form.setFieldsValue({ - job1:basicInfo && basicInfo.identity=="teacher" ? basicInfo.technical_title:"教授", - job2:basicInfo && basicInfo.identity=="professional" ? basicInfo.technical_title:"企业管理者", - }) - } - } - // 选择学校(获取对应学校的学院、部门) - changeList=(e)=>{ - this.getDepartments(e.trim(),true); - } - - showApplyForAddOrgModal = () => { - this.applyForAddOrgForm.setVisible(true) - } - showApplyForAddChildOrgModal = () => { - let{school,schoolList}=this.state; - let arr=schoolList.filter(function(item){ - return item.name == school; - }); - if(arr.length > 0){ - this.applyForAddChildOrgForm.setVisible(true) - }else{ - this.props.showNotification("请先选择正确的单位或者学校!"); - } - } - addOrgSuccess = (name) => { - // const schoolList = this.state.schoolList.slice(0) - // schoolList.push({ id: schoolList.length + 2000, name: name}) - // this.setState({ schoolList }) - - this.getSchoolList(this.props.basicInfo, name); - this.props.form.setFieldsValue({ - org: name - }) - } - - addChildOrgSuccess = (deptName) => { - - this._getDepartments(this.state.school_id, false, deptName); - - } - - // 隐藏或显示真实姓名 - showOrHide=(flag)=>{ - const name = this.props.form.getFieldsValue().name || this.props.basicInfo.name - this.setState({ - showRealName:flag==true?false:true - }) - if(flag==true){ // 隐藏真实姓名 - this.hideRealName(name); - }else{ // 显示 - this.props.form.setFieldsValue({ - name: this.state.realName - }) - } - } - - render(){ - const { course_lists, checkBoxValues, searchValue, loading, imageUrl, imageUrl2, - identity, - departmentsName , - filterSchoolList , - filterDepartments , - school, - department_id, - departments, - school_id, - - showRealName - } = this.state - const { moduleName } = this.props - const { getFieldDecorator } = this.props.form; - let {certification}=this.props; - // /api/users/accounts/${this.props.current_user.login}/auth_attachment.json - - // 已职业认证的账户不能修改职业,学校/单位,院系/部门(true为disable) - const professionalFlag = basicInfo && basicInfo.professional_certification == "certified" ; - - let{ basicInfo }=this.props - let common={ - changeJob:this.changeJob, - filterList:this.filterList, - changeList:this.changeList, - showApplyForAddOrgModal:this.showApplyForAddOrgModal, - showApplyForAddChildOrgModal:this.showApplyForAddChildOrgModal - } - const uploadProps2 = { - name: 'image', - data:{type:certification == 1 ? "real_name" : "professional"}, - multiple: true, - showUploadList: false, - // https://newweb.educoder.net - action: this.props.current_user ? `${getUploadActionUrlOfAuth(this.props.current_user.login)}` : '', - className: 'idPic-uploader', - onChange: this.handleChange2, - }; - - // form合并了 - const propsWithoutForm = Object.assign({}, this.props) - delete propsWithoutForm.form - return( -
    - this.applyForAddOrgForm = form} schoolName={school} - {...propsWithoutForm} addOrgSuccess={this.addOrgSuccess} - > - this.applyForAddChildOrgForm = form} - addChildOrgSuccess={this.addChildOrgSuccess} - > - 实名认证: - 职业认证 - } - {...this.props } - onOk={this.onOk} - okText="保存" - className="applyForModal certificationModal courseNormalForm" - width="660px" - bottomRender={ - certification && certification == 1? -
    -

    认证须知:

    -

    - 1.你需要准备有效的身份证正面(人像面)的证件照照片,请确保证件照片清晰可见,严禁PS; -

    - 2.我们将在你提交认证信息后的24小时(不包含节假日)内完成审核,审核结果将会以系统消息的形式发送给你; -

    - 3.实名认证审核完成后,无法删除,请谨慎填写; -

    - 4.实名认证审核完成后,系统将自动发放500个金币作为奖励; -

    - 5.我们会确保你所提供的信息均处于严格的保密状态,不会泄露; -

    - 6.如存在恶意乱填写姓名,证件号,及上传与实名认证证件无关图片者,一经发现将冻结EduCoder账号。 -

    -
    : -
    -

    认证须知:

    -

    - 1.根据职业上传相应的证件照:教师(教师证),专业人士(员工证)、学生(学生证),请确保证件照内容完整并且清晰可见,严禁PS; -

    - 2.我们将在你提交职业证信息后的24小时(不包含节假日)内完成审核,审核结果将会以系统消息的形式发送给你; -

    - 3.职业认证审核完成后,无法删除,请谨慎填写;职业变更请选择重新认证; -

    - 4.职业认证审核完成后,系统将自动发放500个金币作为奖励; -

    - 5.我们会确保你所提供的信息均处于严格的保密状态,不会泄露; -

    - 6.如存在恶意乱填写姓名,学号,及上传与职业证件无关图片者,一经发现将冻结EduCoder账号。 -

    -
    - } - > - - -
    - { certification && certification == 1 ? -
    - - { basicInfo.authentication == 'uncertified' ? {getFieldDecorator('name', { - rules: [{ - // initialValue: this.state.cityDefaultValue, - required: true, - message: `请输入真实姓名,最大限制${MAX_NAME_LENGTH}个字符`, - validator: this.checkNameLength - }], - })( - this.showOrHide(showRealName)}> - }> - )} - { showRealName ? '(显示:平台将显示您的真实姓名)' : '(隐藏:平台将显示你的昵称)' } - : -
    - - {showRealName ? this.props.basicInfo.name : getHiddenName(this.props.basicInfo.name)} - - this.showOrHide(showRealName)}> - { showRealName ? '(显示:平台将显示您的真实姓名)' : '(隐藏:平台将显示你的昵称)' } -
    - } -
    - - - {getFieldDecorator('sex', { - rules: [{ - required: true, - message: '请选择性别', - }], - })( - - - - - - - )} - - - {getFieldDecorator('credentials', { - rules: [{ - // initialValue: this.state.cityDefaultValue, - required: true, - message: '请输入证件号', - }], - })( - - )} - -
    - : - - } -
    -
    - { certification && certification == 1 ? "身份证上传:":"职业证上传:" } -
    - - avatar - - - {imageUrl2 ? - // - avatar - : - -

    - -

    -

    点击或拖拽上传图片

    - {/*

    Support for a single or bulk upload. Strictly prohibit from uploading company data or other band files

    */} -
    - } -
    -
    -
    -
    - -

    示例图片

    -

    (png/jpg/bmp格式,不超过2MB)

    -
    - - - 查看大图 - -
    -
    - - - -
    - -
    - ) - } -} -const WrappedRealNameCertificationModal = Form.create({ name: 'RealNameCertificationModal' })(RealNameCertificationModal); - -export default WrappedRealNameCertificationModal; - - +import React, { Component } from "react"; +import { message, Icon, Input, Form, Upload,Radio ,Tooltip} from "antd"; +import axios from 'axios' +import ModalWrapper from "../../courses/common/ModalWrapper" +import { City, getUploadActionUrl, getImageUrl, ImageLayer2, getUploadActionUrlOfAuth ,ConditionToolTip } from 'educoder' +import '../account/common.css' +import AccountBasicEditItem from '../account/AccountBasicEditItem' +import ApplyForAddOrgModal from './ApplyForAddOrgModal' +import ApplyForAddChildOrgModal from './ApplyForAddChildOrgModal' + +import authImg from '../../../images/account/auth.png' +import jobImg from '../../../images/account/job.png' + +const RadioGroup = Radio.Group; +const Dragger = Upload.Dragger; +const MAX_NAME_LENGTH = 10 +function getBase64(img, callback) { + const reader = new FileReader(); + reader.addEventListener('load', () => callback(reader.result)); + reader.readAsDataURL(img); +} +function beforeUpload(file) { + const isJPG = file.type === 'image/jpeg'; + if (!isJPG) { + message.error('You can only upload JPG file!'); + } + const isLt2M = file.size / 1024 / 1024 < 2; + if (!isLt2M) { + message.error('Image must smaller than 2MB!'); + } + return isJPG && isLt2M; +} +export function getHiddenName(name) { + if (!name) return '' + let len=parseInt(name.length)-1; + let str=""; + for(var i = 0; i < len; i++){ str += "*"; } + const newName = name.substr(0,1)+str; + return newName +} +class RealNameCertificationModal extends Component{ + constructor(props){ + super(props); + this.state={ + identity:"teacher", + departmentsName:undefined, + filterSchoolList:undefined, + filterDepartments :undefined, + school:undefined, + school_id:undefined, + department_id:undefined, + schoolList:undefined, + departments:undefined, + showRealName:true, + } + } + + componentDidMount() { + if(this.props.basicInfo){ + this.setValue(this.props.basicInfo); + this.getSchoolList(this.props.basicInfo); + } + } + + setValue=(basicInfo)=>{ + if(basicInfo){ + this.props.form.setFieldsValue({ + nickname:basicInfo.nickname, + name:!basicInfo.show_realname ? this.hideRealName(basicInfo.name) : basicInfo.name, + sex:String(basicInfo.gender), + job:basicInfo.identity, + org:basicInfo.school_name, + + // city:[basicInfo.location,basicInfo.location_city] + }) + setTimeout(() => { + // 等显示后再set + this.props.form.setFieldsValue({ + job:basicInfo.identity, + student_No:basicInfo.student_id, + org2:basicInfo.department_name, + job1:basicInfo && basicInfo.identity=="teacher" ? basicInfo.technical_title:"教授", + job2:basicInfo && basicInfo.identity=="professional" ? basicInfo.technical_title:"企业管理者", + }) + }, 100) + //if(basicInfo.nickname){ + this.setState({ + forDisable: true, + nameLength:basicInfo.nickname?basicInfo.nickname.length:0, + showRealName:basicInfo.show_realname, + realName: basicInfo.name, + identity:basicInfo.identity, + school_id:basicInfo.school_id, + department_id:basicInfo.department_id + }) + //} + } + } + + getSchoolList=(basicInfo, selectedName)=>{ + let url=`/schools/for_option.json`; + axios.get(url).then((result)=>{ + if(result){ + this.setState({ + schoolList:result.data.schools + }) + if (selectedName) { + let school_id + result.data.schools.reverse().some( item => { + if (item.name == selectedName) { + school_id = item.id + return true; + } + }) + this.props.form.setFieldsValue({ + org: selectedName + }) + this.setState({ + school_id, + school: selectedName + }, () => { + this.filterList(selectedName) + }) + } else if(basicInfo && basicInfo.school_name){ + this.setState({ + school:basicInfo.school_name, + filterSchoolList:this.state.schoolList.filter(function(item){ + return item.name.indexOf(basicInfo.school_name)>-1; + }) + }) + this.getDepartments(basicInfo.school_name,false); + } + } + }).catch((error)=>{ + console.log(error); + }) + } + + // 将名字隐藏起来 + hideRealName=(name)=>{ + this.setState({ realName: name }) + const newName = getHiddenName(name) + + this.props.form.setFieldsValue({ + name: newName + }) + return newName + } + + getDepartments=(e,flag)=>{ + let arr=this.state.schoolList.filter(function(item){ + if(item.name.indexOf(e) > -1){ + return item.name; + } + }); + if (!arr[0]) { + if (!e) { + this.setState({ + filterSchoolList: [] + }) + } + // 没找到学校,清空部门 + this.setState({ + departments: [], + filterDepartments: [], + departmentsName: '', + school_id: '', + department_id: '', + }) + this.this_school_id = '' + this.props.form.setFieldsValue({ + org2: '' + }) + return; + } + this.props.form.setFieldsValue({ + org: arr[0].name + }) + this.filterList(e) + // 保存选择的学校id + this.this_school_id = arr[0].id + this.setState({ + school_id: arr[0].id, + school:e, + }) + this._getDepartments(arr[0].id, flag) + } + _getDepartments = (schoolId, flag, selectedName) => { + let url=`/schools/${schoolId || this.state.school_id}/departments/for_option.json`; + axios.get(url).then((result)=>{ + if(result){ + this.setState({ + departments:result.data.departments, + filterDepartments:result.data.departments + }) + if (selectedName) { + let department_id + result.data.departments.reverse().some( item => { + if (item.name == selectedName) { + department_id = item.id + return true; + } + }) + this.props.form.setFieldsValue({ + org2: selectedName + }) + this.setState({ + department_id, + // school: selectedName + }) + } else if(result.data.departments && result.data.departments.length>0 && flag==true){ + // 切换学校后,部门默认选择第一个 + this.props.form.setFieldsValue({ + org2:result.data.departments[0].name + }) + this.setState({ + department_id: result.data.departments[0].id + }) + }else if(result.data.departments && result.data.departments.length == 0 && flag==true){ + this.props.form.setFieldsValue({ + org2:'' + }) + } + } + }).catch((error)=>{ + console.log(error); + }) + } + + filterList =(e)=>{ + const inputVal = e.trim() + let arr=[]; + if(inputVal){ + arr= this.state.schoolList.filter(function(item){ + return item.name.indexOf(inputVal)>-1; + }); + this.props.form.setFieldsValue({ + org: inputVal + }) + this.setState({ + school: inputVal, + filterSchoolList: arr + }) + } else { + this.setState({ + school: '', + }) + } + // else{ + // let {school}=this.state; + // arr= this.state.schoolList.filter(function(item){ + // return item.name.indexOf(school)>-1; + // }); + // } + } + + setVisible = (visible) => { + this.refs.modalWrapper.setVisible(visible) + } + + onSendOk = () => { + this.props.form.validateFieldsAndScroll((err, values) => { + console.log(values); + if(!err){ + let{imageUrl2}=this.state; + let{current_user,basicInfo}=this.props; + if(imageUrl2){ + let { certification } = this.props; + if(certification == 1){ + // 实名认证 + let url = `/users/accounts/${current_user && current_user.login}/authentication_apply.json` + axios.post((url),{ + name:basicInfo.name, + gender:parseInt(values.sex), + id_number:values.credentials + }).then((result)=>{ + if(result){ + this.props.showNotification("申请已提交,请等待审核!"); + this.props.getBasicInfo(); + this.setVisible(false); + } + }).catch((error)=>{ + console.log(error); + }) + }else{ + // 职业认证 + // console.log(values.job == "student" ? values.student_No : values.job == "teacher" ? values.job1 : values.job2); + let url = `/users/accounts/${current_user && current_user.login}/professional_auth_apply.json` + axios.post((url),{ + school_id:this.state.school_id, + department_id:this.state.department_id, + identity:this.state.identity, + extra: values.job == "student" ? values.student_No : values.job == "teacher" ? values.job1 : values.job2 + }).then((result)=>{ + if(result){ + this.props.showNotification("申请已提交,请等待审核!"); + this.props.getBasicInfo(); + this.setVisible(false); + } + }).catch((error)=>{ + console.log(error); + }) + } + }else{ + this.props.showNotification("请先上传照片!"); + } + } + }) + } + + onOk = () => { + const { course_lists, checkBoxValues } = this.state + this.onSendOk() + } + + handleChange = (info) => { + if (info.file.status === 'uploading') { + this.setState({ loading: true }); + return; + } + if (info.file.status === 'done') { + // Get this url from response in real world. + getBase64(info.file.originFileObj, imageUrl => this.setState({ + imageUrl, + loading: false, + })); + } + } + handleChange2 = (info) => { + if (info.file.status === 'uploading') { + this.setState({ loading: true }); + return; + } + if (info.file.status === 'done') { + // Get this url from response in real world. + getBase64(info.file.originFileObj, imageUrl2 => this.setState({ + imageUrl2, + loading: false, + })); + } + } + // 切换职称 + changeJob=(e)=>{ + this.setState({ + identity:e + }) + let {basicInfo}=this.props; + if(basicInfo){ + this.props.form.setFieldsValue({ + job1:basicInfo && basicInfo.identity=="teacher" ? basicInfo.technical_title:"教授", + job2:basicInfo && basicInfo.identity=="professional" ? basicInfo.technical_title:"企业管理者", + }) + } + } + // 选择学校(获取对应学校的学院、部门) + changeList=(e)=>{ + this.getDepartments(e.trim(),true); + } + + showApplyForAddOrgModal = () => { + this.applyForAddOrgForm.setVisible(true) + } + showApplyForAddChildOrgModal = () => { + let{school,schoolList}=this.state; + let arr=schoolList.filter(function(item){ + return item.name == school; + }); + if(arr.length > 0){ + this.applyForAddChildOrgForm.setVisible(true) + }else{ + this.props.showNotification("请先选择正确的单位或者学校!"); + } + } + addOrgSuccess = (name) => { + // const schoolList = this.state.schoolList.slice(0) + // schoolList.push({ id: schoolList.length + 2000, name: name}) + // this.setState({ schoolList }) + + this.getSchoolList(this.props.basicInfo, name); + this.props.form.setFieldsValue({ + org: name + }) + } + + addChildOrgSuccess = (deptName) => { + + this._getDepartments(this.state.school_id, false, deptName); + + } + + // 隐藏或显示真实姓名 + showOrHide=(flag)=>{ + const name = this.props.form.getFieldsValue().name || this.props.basicInfo.name + this.setState({ + showRealName:flag==true?false:true + }) + if(flag==true){ // 隐藏真实姓名 + this.hideRealName(name); + }else{ // 显示 + this.props.form.setFieldsValue({ + name: this.state.realName + }) + } + } + + render(){ + const { course_lists, checkBoxValues, searchValue, loading, imageUrl, imageUrl2, + identity, + departmentsName , + filterSchoolList , + filterDepartments , + school, + department_id, + departments, + school_id, + + showRealName + } = this.state + const { moduleName } = this.props + const { getFieldDecorator } = this.props.form; + let {certification}=this.props; + // /api/users/accounts/${this.props.current_user.login}/auth_attachment.json + + // 已职业认证的账户不能修改职业,学校/单位,院系/部门(true为disable) + const professionalFlag = basicInfo && basicInfo.professional_certification == "certified" ; + + let{ basicInfo }=this.props + let common={ + changeJob:this.changeJob, + filterList:this.filterList, + changeList:this.changeList, + showApplyForAddOrgModal:this.showApplyForAddOrgModal, + showApplyForAddChildOrgModal:this.showApplyForAddChildOrgModal + } + const uploadProps2 = { + name: 'image', + data: {type: certification == 1 ? "real_name" : "professional"}, + multiple: true, + showUploadList: false, + // https://newweb.educoder.net + action: this.props.current_user ? `${getUploadActionUrlOfAuth(this.props.current_user.login)}` : '', + className: 'idPic-uploader', + onChange: this.handleChange2, + }; + + // form合并了 + const propsWithoutForm = Object.assign({}, this.props) + delete propsWithoutForm.form + return( +
    + this.applyForAddOrgForm = form} schoolName={school} + {...propsWithoutForm} addOrgSuccess={this.addOrgSuccess} + > + this.applyForAddChildOrgForm = form} + addChildOrgSuccess={this.addChildOrgSuccess} + > + 实名认证: + 职业认证 + } + {...this.props } + onOk={this.onOk} + okText="保存" + className="applyForModal certificationModal courseNormalForm" + width="660px" + bottomRender={ + certification && certification == 1? +
    +

    认证须知:

    +

    + 1.你需要准备有效的身份证正面(人像面)的证件照照片,请确保证件照片清晰可见,严禁PS; +

    + 2.我们将在你提交认证信息后的24小时(不包含节假日)内完成审核,审核结果将会以系统消息的形式发送给你; +

    + 3.实名认证审核完成后,无法删除,请谨慎填写; +

    + 4.实名认证审核完成后,系统将自动发放500个金币作为奖励; +

    + 5.我们会确保你所提供的信息均处于严格的保密状态,不会泄露; +

    + 6.如存在恶意乱填写姓名,证件号,及上传与实名认证证件无关图片者,一经发现将冻结EduCoder账号。 +

    +
    : +
    +

    认证须知:

    +

    + 1.根据职业上传相应的证件照:教师(教师证),专业人士(员工证)、学生(学生证),请确保证件照内容完整并且清晰可见,严禁PS; +

    + 2.我们将在你提交职业证信息后的24小时(不包含节假日)内完成审核,审核结果将会以系统消息的形式发送给你; +

    + 3.职业认证审核完成后,无法删除,请谨慎填写;职业变更请选择重新认证; +

    + 4.职业认证审核完成后,系统将自动发放500个金币作为奖励; +

    + 5.我们会确保你所提供的信息均处于严格的保密状态,不会泄露; +

    + 6.如存在恶意乱填写姓名,学号,及上传与职业证件无关图片者,一经发现将冻结EduCoder账号。 +

    +
    + } + > + + +
    + {certification && certification == 1 ? +
    + + {basicInfo && basicInfo.authentication == 'uncertified' ? {getFieldDecorator('name', { + rules: [{ + // initialValue: this.state.cityDefaultValue, + required: true, + message: `请输入真实姓名,最大限制${MAX_NAME_LENGTH}个字符`, + validator: this.checkNameLength + }], + })( + this.showOrHide(showRealName)}> + }> + )} + { showRealName ? '(显示:平台将显示您的真实姓名)' : '(隐藏:平台将显示你的昵称)' } + : +
    + + {showRealName ? this.props.basicInfo.name : getHiddenName(this.props.basicInfo.name)} + + this.showOrHide(showRealName)}> + { showRealName ? '(显示:平台将显示您的真实姓名)' : '(隐藏:平台将显示你的昵称)' } +
    + } +
    + + + {getFieldDecorator('sex', { + rules: [{ + required: true, + message: '请选择性别', + }], + })( + + + + + + + )} + + + {getFieldDecorator('credentials', { + rules: [{ + // initialValue: this.state.cityDefaultValue, + required: true, + message: '请输入证件号', + }], + })( + + )} + +
    + : + + } +
    +
    + { certification && certification == 1 ? "身份证上传:":"职业证上传:" } +
    + + avatar + + + {imageUrl2 ? + // + avatar + : + +

    + +

    +

    点击或拖拽上传图片

    + {/*

    Support for a single or bulk upload. Strictly prohibit from uploading company data or other band files

    */} +
    + } +
    +
    +
    +
    + +

    示例图片

    +

    (png/jpg/bmp格式,不超过2MB)

    +
    + + + 查看大图 + +
    +
    + + + +
    + +
    + ) + } +} +const WrappedRealNameCertificationModal = Form.create({ name: 'RealNameCertificationModal' })(RealNameCertificationModal); + +export default WrappedRealNameCertificationModal; + + From 37f3fae030fee47417d3fbf4b6da2340628e12ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sat, 2 Nov 2019 10:32:20 +0800 Subject: [PATCH 17/19] =?UTF-8?q?=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CompetitionContentspdfpeopledata.js | 2 ++ .../user/modal/RealNameCertificationModal.js | 24 +++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js index dc4c3f971..c24a95725 100644 --- a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js @@ -318,11 +318,13 @@ class CompetitionContentspdfpeopledata extends Component { {this.state.certification === 1 ? this.realNameCertificationModal1 = form} certification={certification} + Getdata={() => this.getdata()} > : ""} {this.state.certification === 2 ? this.realNameCertificationModal2 = form} certification={certification} + Getdata={() => this.getdata()} > : ""}

    *实名信息 diff --git a/public/react/src/modules/user/modal/RealNameCertificationModal.js b/public/react/src/modules/user/modal/RealNameCertificationModal.js index 7ec18a2c6..461b2a4e7 100644 --- a/public/react/src/modules/user/modal/RealNameCertificationModal.js +++ b/public/react/src/modules/user/modal/RealNameCertificationModal.js @@ -276,8 +276,18 @@ class RealNameCertificationModal extends Component{ }).then((result)=>{ if(result){ this.props.showNotification("申请已提交,请等待审核!"); - this.props.getBasicInfo(); + try { + this.props.getBasicInfo(); + } catch (e) { + } + try { + this.props.Getdata(); + } catch (e) { + + } this.setVisible(false); + + } }).catch((error)=>{ console.log(error); @@ -294,8 +304,18 @@ class RealNameCertificationModal extends Component{ }).then((result)=>{ if(result){ this.props.showNotification("申请已提交,请等待审核!"); - this.props.getBasicInfo(); + try { + this.props.getBasicInfo(); + } catch (e) { + + } + try { + this.props.Getdata(); + } catch (e) { + + } this.setVisible(false); + } }).catch((error)=>{ console.log(error); From df6f4aeb0996d42d186bab3abdd55717dc27aad3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sat, 2 Nov 2019 10:45:04 +0800 Subject: [PATCH 18/19] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CompetitionContentspdfpeopledata.js | 37 ++++++++++++++----- .../user/modal/RealNameCertificationModal.js | 3 ++ 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js index c24a95725..65adc7e51 100644 --- a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js @@ -53,6 +53,9 @@ class CompetitionContentspdfpeopledata extends Component { getdata = () => { + this.setState({ + certification: 3 + }) let url = `/users/accounts/${this.props.current_user.login}.json`; axios.get(url).then((result) => { if (result.data) { @@ -64,7 +67,8 @@ class CompetitionContentspdfpeopledata extends Component { basicInfo: Object.assign({}, {...result.data}, { avatar_url: `${result.data.avatar_url}`, gender: result.data.gender == null || result.data.gender == undefined ? 0 : result.data.gender - }) + }), + certification: 3 }) } }).catch((error) => { @@ -277,6 +281,14 @@ class CompetitionContentspdfpeopledata extends Component { }) } + + //取消认证弹框 + onCancel = () => { + this.getdata(); + + } + + //撤销认证 Cancellationofapplication = (index) => { let url = "" @@ -294,7 +306,7 @@ class CompetitionContentspdfpeopledata extends Component { } else if (index === 2) { this.props.showNotification('撤销职业认证成功') } - + this.getdata(); } } catch (e) { @@ -315,16 +327,21 @@ class CompetitionContentspdfpeopledata extends Component { console.log(emailbool); return (

    - {this.state.certification === 1 ? this.realNameCertificationModal1 = form} - certification={certification} - Getdata={() => this.getdata()} + {this.state.certification === 1 ? + this.realNameCertificationModal1 = form} + certification={certification} + Getdata={() => this.getdata()} + onCancel={() => this.onCancel()} > : ""} - {this.state.certification === 2 ? this.realNameCertificationModal2 = form} - certification={certification} - Getdata={() => this.getdata()} + {this.state.certification === 2 ? + this.realNameCertificationModal2 = form} + certification={certification} + Getdata={() => this.getdata()} + onCancel={() => this.onCancel()} + > : ""}

    *实名信息 diff --git a/public/react/src/modules/user/modal/RealNameCertificationModal.js b/public/react/src/modules/user/modal/RealNameCertificationModal.js index 461b2a4e7..b3bbdf319 100644 --- a/public/react/src/modules/user/modal/RealNameCertificationModal.js +++ b/public/react/src/modules/user/modal/RealNameCertificationModal.js @@ -56,6 +56,8 @@ class RealNameCertificationModal extends Component{ } componentDidMount() { + console.log("RealNameCertificationModal"); + console.log(this.props.basicInfo); if(this.props.basicInfo){ this.setValue(this.props.basicInfo); this.getSchoolList(this.props.basicInfo); @@ -484,6 +486,7 @@ class RealNameCertificationModal extends Component{ 职业认证 } {...this.props } + {...this.state} onOk={this.onOk} okText="保存" className="applyForModal certificationModal courseNormalForm" From 65c7eecc25d76ef9921fda83d6186c1ad31e3f5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sat, 2 Nov 2019 10:46:37 +0800 Subject: [PATCH 19/19] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CompetitionContentspdfpeopledata.js | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js index 65adc7e51..3585f5b81 100644 --- a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentspdfChild/CompetitionContentspdfpeopledata.js @@ -59,9 +59,9 @@ class CompetitionContentspdfpeopledata extends Component { let url = `/users/accounts/${this.props.current_user.login}.json`; axios.get(url).then((result) => { if (result.data) { - // if(result.data && result.data.base_info_completed == false){ - // this.props.history.push(`/account/profile/edit`); - // } + if (result.data && result.data.base_info_completed == false) { + this.props.history.push(`/account/profile/edit`); + } // "authentication": "uncertified", // "uncertified" | "applying" | "certified" this.setState({ basicInfo: Object.assign({}, {...result.data}, { @@ -231,13 +231,18 @@ class CompetitionContentspdfpeopledata extends Component { if (this.state.basicInfo.base_info_completed == true) { this.showRealNameCertificationModal(index) } else { - this.props.confirm({ - okText: `立即完善`, - content: `请先完善基本信息`, - onOk: () => { - this.props.history.push('/account/profile/edit') - } - }) + try { + this.props.confirm({ + okText: `立即完善`, + content: `请先完善基本信息`, + onOk: () => { + this.props.history.push('/account/profile/edit') + } + }) + } catch (e) { + this.props.history.push(`/account/profile/edit`); + + } } }