From 4dff0a03cec2c0b6b35437ad883c3c80b1bb0f15 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Sat, 22 Jun 2019 11:22:40 +0800 Subject: [PATCH 01/11] route --- public/react/src/modules/courses/Index.js | 9 +++++++-- public/react/src/modules/courses/busyWork/commonWork.js | 7 +++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/Index.js b/public/react/src/modules/courses/Index.js index 553db6090..c385af3b7 100644 --- a/public/react/src/modules/courses/Index.js +++ b/public/react/src/modules/courses/Index.js @@ -452,6 +452,11 @@ class CoursesIndex extends Component{ (props) => () } > + () + } + > {/*课堂讨论*/} {/* 普通作业 */} - () } > {/* 分组作业 */} - () } diff --git a/public/react/src/modules/courses/busyWork/commonWork.js b/public/react/src/modules/courses/busyWork/commonWork.js index 5ba97b03a..9f3d8dda0 100644 --- a/public/react/src/modules/courses/busyWork/commonWork.js +++ b/public/react/src/modules/courses/busyWork/commonWork.js @@ -71,6 +71,13 @@ class commonWork extends Component{ sureDelClasses(){ } + componentDidUpdate(prevProps, prevState) { + debugger; + if (prevProps.match.path != this.props.match.path) { + this.componentDidMount() + } + } + componentDidMount(){ this.setState({ From c73857c4a9fd6034e559ad809490ba6a99be97ff Mon Sep 17 00:00:00 2001 From: ysl <904079904@qq.com> Date: Sat, 22 Jun 2019 12:44:10 +0800 Subject: [PATCH 02/11] =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tasks/GraduationTasksSubmitnew.js | 3 + .../react/src/modules/login/EducoderLogin.js | 40 +- .../src/modules/user/FindPasswordComponent.js | 860 +++++++++--------- .../modules/user/LoginRegisterComponent.js | 81 +- 4 files changed, 513 insertions(+), 471 deletions(-) diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js index e1284832c..fd383eabf 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js @@ -84,6 +84,7 @@ class GraduationTasksSubmitnew extends Component{ handleSubmit=(e) => { + let {fileList,selectmemberslist,workslist}=this.state; let userids=[]; @@ -432,6 +433,8 @@ render(){ let graduation_id=workslist===undefined?"":workslist.graduation_id; let task_id=workslist===undefined?"":workslist.task_id; + + return( diff --git a/public/react/src/modules/login/EducoderLogin.js b/public/react/src/modules/login/EducoderLogin.js index 94341d7e2..6df53d63e 100644 --- a/public/react/src/modules/login/EducoderLogin.js +++ b/public/react/src/modules/login/EducoderLogin.js @@ -60,21 +60,27 @@ class EducoderLogin extends Component { if( props.match.url === "/changepassword" ){ this.state = { showbool: false, + logini:3, } }else { if(props.match.url === "/login"){ this.state = { showbool: true, - loginstatus:true + loginstatus:true, + logini:1, + } }else if(props.match.url === "/register"){ this.state = { showbool: true, loginstatus:false, + logini:2, } }else{ this.state = { showbool: true, + logini:1, + } } @@ -86,6 +92,14 @@ class EducoderLogin extends Component { } + Setlogins=(i)=>{ + console.log("96ye"); + console.log(i) + this.setState({ + logini:i + }) + + } Setshowbool = () => { if (this.state.showbool === true) { @@ -102,7 +116,7 @@ class EducoderLogin extends Component { render() { - let {showbool} = this.state; + let {showbool,loginstatus,logini} = this.state; return (
- -
-
- 找回密码 -
-
- - this.inputOnBlur(e)} - onChange={this.loginInputonChange} style={{marginTop: '10px'}}> - { - Phonenumberisnotco && Phonenumberisnotco != "" ? -

- {Phonenumberisnotco} -

- :
- } - - - - -
- - - { - getverificationcodes === undefined ? - - : getverificationcodes === true ? - - : - - } - - -
- - -
-
- -
- ); - } -} - -export default (LoginRegisterComponent); +import React, {Component} from 'react'; + +import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom"; + +import {getImageUrl, DragValidator} from 'educoder'; +import {Tabs, Input, Checkbox, Button, notification} from 'antd'; +import axios from 'axios'; +import './common.css' + +const TabPane = Tabs.TabPane +const loginInputsyl = { + "width": " 100%", + "height": "40px", +} + +//父组件 EducoderLogin.js +class LoginRegisterComponent extends Component { + constructor(props) { + super(props) + this.state = { + login: "", + password: "", + passwords: "", + seconds: 60, + codes: "", + getverificationcodes: true, + Phonenumberisnotco: undefined, + Phonenumberisnotcobool: false, + s: 'text', + classpass: "text", + readonlyInput: true, + } + } + + + openNotification = (messge) => { + notification.open({ + message: "提示", + description: + messge, + onClick: () => { + console.log('Notification Clicked!'); + }, + }); + }; + StudyMakeMoney = () => { // 调用父组件方法 + this.props.Setshowbool(); + + } + + // 点击表单后,改变type + changeType = () => { + this.setState({classpass: 'password'}); + } + changeTypey = () => { + + } + //倒计时 + getverificationcode = () => { + if (this.state.Phonenumberisnotcobool === false ||this.state.Phonenumberisnotcobool === undefined) { + if (this.state.login&&this.state.login.length === 0) { + this.openNotification("请输入手机号或邮箱"); + return + } else { + this.openNotification("请输入正确的手机号或邮箱"); + } + return; + } + if (this.state.getverificationcodes === true) { + this.setState({ + getverificationcodes: undefined, + }) + let timer = setInterval(() => { + this.setState((preState) => ({ + seconds: preState.seconds - 1, + }), () => { + if (this.state.seconds == 0) { + clearInterval(timer); + this.setState({ + getverificationcodes: false, + seconds: 60, + }) + } + }); + }, 1000) + this.SMSverification(); + } else { + this.setState({ + getverificationcodes: undefined, + }) + let timer = setInterval(() => { + this.setState((preState) => ({ + seconds: preState.seconds - 1, + }), () => { + if (this.state.seconds == 0) { + clearInterval(timer); + this.setState({ + getverificationcodes: false, + seconds: 60, + + }) + } + }); + }, 1000) + this.SMSverification(); + } + } + //短信验证 + SMSverification = () => { + var url = `/accounts/get_verification_code.json`; + axios.get((url), { + params: { + login: this.state.login, + type: 2, + } + }).then((result) => { + //验证有问题{"status":1,"message":"success"} + console.log(result); + + + }).catch((error) => { + console.log(error); + + }) + } + + cancelReadOnly = () => { + this.setState({ + readonlyInput: false, + }) + } + //找回密码 + Retrievepassword = () => { + if (this.state.Phonenumberisnotcobool === false) { + if (this.state.login.length === 0) { + this.openNotification("请输入手机号或邮箱"); + return + } + this.openNotification("请输入正确的手机号或邮箱"); + return; + } + + if (this.state.login === undefined || this.state.login == "") { + this.openNotification(`请输入登录手机号码或邮箱`); + return + } else if (this.state.password === undefined || this.state.password == "") { + this.openNotification(`请输入密码`); + return + } else if (this.state.passwords === undefined || this.state.passwords == "") { + this.openNotification(`请输入密码`); + return + } else if (this.state.password !== this.state.passwords) { + this.openNotification(`两次密码不相同`); + return + } else if (this.state.codes === undefined || this.state.codes == "") { + this.openNotification(`请输入验证码`); + return + } + var url = "/accounts/reset_password.json"; + axios.post(url, { + login: this.state.login, + code: this.state.codes, + new_password: this.state.password, + new_password_confirmation: this.state.passwords, + }).then((result) => { + // console.log(result); + //登录成功,会生成session + this.openNotification("找回密码成功,请重新登入。"); + window.location.href = "/login" + }).catch((error) => { + + }) + + + } + openNotification = (messge) => { + notification.open({ + message: "提示", + description: + messge, + onClick: () => { + console.log('Notification Clicked!'); + }, + }); + }; + loginInputonChange = (e) => { + // console.log(e.target.value); + this.setState({ + login: e.target.value, + }) + + + } + loginInputonChanges = (e) => { + // console.log(e.target.value); + this.setState({ + password: e.target.value, + }) + + + } + loginInputonChangess = (e) => { + // console.log(e.target.value); + this.setState({ + passwords: e.target.value, + }) + + + } + //获取code + codesonChange = (e) => { + this.setState({ + codes: e.target.value + }) + } + inputOnBlur = (e) => { + this.isCorrectname(e.target.value); + // this.Emailphonenumberverification(e.target.value, id); + } + isCorrectname = (value) => { + console.log(value.length); + if (value.length === 0) { + this.setState({ + Phonenumberisnotco: undefined, + Phonenumberisnotcobool: false, + }) + return; + } + // var telephone = $("#telephoneAdd.tianjia_phone").val(); + var regph = /^[1][3,4,5,6,7,8][0-9]{9}$/; + // var email = $("#add_email.tianjia_email").val(); + var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; + + // [1]手机号开头必须是1 [3,4,5,6,7,8] 第二位是3-8中的一个 [0-9]{9} 后边9位可以是0-9的任意数字。 + var stringdata = undefined; + if (!regph.test(value)) { + stringdata = "手机号格式不正确"; + this.setState({ + Phonenumberisnotco: stringdata, + Phonenumberisnotcobool: false, + }) + } else { + this.setState({ + Phonenumberisnotco: undefined, + Phonenumberisnotcobool: true, + }) + return + } + + if (!regemail.test(value)) { + if ((value.indexOf("@") != -1) === true) { + stringdata = "邮箱格式不正确"; + } else { + stringdata = "手机号格式不正确"; + + } + this.setState({ + Phonenumberisnotco: stringdata, + Phonenumberisnotcobool: false, + }) + + this.Emailphonenumberverification(value) + return + } else { + this.setState({ + Phonenumberisnotco: undefined, + Phonenumberisnotcobool: true, + }) + return + } + } + //邮箱手机号验证 + Emailphonenumberverification = (value) => { + var url = `/accounts/valid_email_and_phone.json`; + axios.get((url), { + params: { + login: value, + type: 2, + } + }).then((result) => { + //验证有问题{"status":1,"message":"success"} + console.log(result); + + + }).catch((error) => { + console.log(error); + // this.setState({ + // login:"", + // logins:"", + // }) + }) + } + + render() { + const { + activeKey, + // 登录 + autoLogin, + // 注册 + readAgreement, dragOk, + login, + password, + passwords, + classpass, + seconds, + getverificationcodes, + Phonenumberisnotco, + readonlyInput, + codes, + } = this.state + // height: 346px; + return ( + +
+ + + + +
+
+ 找回密码 +
+
+ + this.inputOnBlur(e)} + onChange={this.loginInputonChange} style={{marginTop: '10px',height: "38px"}}> + { + Phonenumberisnotco && Phonenumberisnotco != "" ? +

+ {Phonenumberisnotco} +

+ :
+ } + + + + +
+ + + { + getverificationcodes === undefined ? + + : getverificationcodes === true ? + + : + + } + + +
+ + +
+
+ +
+ ); + } +} + +export default (LoginRegisterComponent); diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js index 846000984..d314effca 100644 --- a/public/react/src/modules/user/LoginRegisterComponent.js +++ b/public/react/src/modules/user/LoginRegisterComponent.js @@ -10,8 +10,12 @@ import axios from 'axios'; import './common.css' const { TabPane } = Tabs; const loginInputsyl = { - "width": " 100%", - "height": "40px", +"width":"434px", +"height": "462px", +"-webkit-box-shadow": "3px 10px 21px 0px rgba(76,76,76,0.15)", +"box-shadow": "3px 10px 21px 0px rgba(76,76,76,0.15)", +"border-radius": "6px", +"background": "#fff" } //父组件EducoderLogin.js @@ -135,6 +139,7 @@ class LoginRegisterComponent extends Component { ; StudyMakeMoney = () => { // 调用父组件方法 this.props.Setshowbool(); + // this.props.Setlogins(3); this.setState({ login: "", password: "", @@ -407,8 +412,9 @@ class LoginRegisterComponent extends Component { //倒计时 getverificationcode = () => { - if (this.state.Phonenumberisnotcobool === false) { - if (this.state.logins.length === 0) { + debugger + if (this.state.Phonenumberisnotcobool === false ||this.state.Phonenumberisnotcobool === undefined) { + if (this.state.logins&&this.state.logins.length === 0) { this.openNotification("请输入手机号或邮箱",2); return }else { @@ -503,6 +509,13 @@ class LoginRegisterComponent extends Component { this.setState({ tab:e.key }) + // console.log(e.key); + // if(e.key === 0){ + // this.props.Setlogins(1); + // }else{ + // this.props.Setlogins(2); + // + // } // this.props.history.push(`/courses/${this.props.match.params.coursesId}/exercises/${this.props.match.params.Id}/student_exercise_list?tab=`+e.key) @@ -532,7 +545,7 @@ class LoginRegisterComponent extends Component { // console.log(activeKey); return ( -
+
@@ -576,62 +589,65 @@ class LoginRegisterComponent extends Component { + className="font-14 color-grey-9" + style={{marginTop: '30px', height: '38px'}}> { Phonenumberisnotco && Phonenumberisnotco != "" ?

{Phonenumberisnotco}

- :
+ :
} - -
+
下次自动登录 - 找回密码 + 找回密码
-
} { parseInt(tab[0])==1 &&
- this.inputOnBlur(e, 2)} - style={{marginTop: '30px'}}> + style={{marginTop: '30px' , height: '38px',color:'#999999',fontSize:"14px"}}> { Phonenumberisnotcos && Phonenumberisnotcos != "" ? -

+

+ {/*{Phonenumberisnotcos}*/} - {Phonenumberisnotcos} + 请输入手机号码

- :
+ :
} -
- + { getverificationcodes === undefined ? - : getverificationcodes === true ? - + : - } @@ -655,8 +671,9 @@ class LoginRegisterComponent extends Component { {/* style={{height: '0', width: '0', border: 'none', display: "none"}}/>*/} {/**/} - 我已阅读并同意服务协议条款 - + >我已阅读并同意服务协议条款 +
From cfb6a0d16a366b20d0b02ca48c7d8c09beed7477 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 22 Jun 2019 13:56:36 +0800 Subject: [PATCH 03/11] =?UTF-8?q?=20=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tasks/GraduationTaskssettinglist.js | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js index c842d02f2..b681388f8 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js @@ -697,7 +697,7 @@ class GraduationTaskssettinglist extends Component{ render: (text, record) => ( - 90?'#DD1717':parseInt(record.teacherrating)>60&&parseInt(record.teacherrating)<90?"#FF6800":'#747A7F'}}>{record.teacherrating==="--"||record.teacherrating==="未批阅"?"--":parseInt(record.teacherrating)} + 90?'#DD1717':parseInt(record.teacherrating)>60&&parseInt(record.teacherrating)<90?"#FF6800":'#747A7F'}}>{record.teacherrating==="--"||record.teacherrating==="未批阅"?"--":record.teacherrating} ), @@ -709,7 +709,7 @@ class GraduationTaskssettinglist extends Component{ render: (text, record) => ( - 90?'#DD1717':parseInt(record.crossrating)>60&&parseInt(record.crossrating)<90?"#FF6800":'#747A7F'}}>{record.crossrating==="--"||record.crossrating==="未批阅"?"--":parseInt(record.crossrating)} + 90?'#DD1717':parseInt(record.crossrating)>60&&parseInt(record.crossrating)<90?"#FF6800":'#747A7F'}}>{record.crossrating==="--"||record.crossrating==="未批阅"?"--":record.crossrating} ), @@ -721,7 +721,7 @@ class GraduationTaskssettinglist extends Component{ render: (text, record) => ( - 90?'#DD1717':parseInt(record.finalscore)>60&&parseInt(record.finalscore)<90?"#FF6800":'#747A7F'}}>{record.finalscore==="--"?"--":parseInt(record.finalscore)} + 90?'#DD1717':parseInt(record.finalscore)>60&&parseInt(record.finalscore)<90?"#FF6800":'#747A7F'}}>{record.finalscore==="--"?"--":record.finalscore} ), @@ -838,7 +838,7 @@ class GraduationTaskssettinglist extends Component{ render: (text, record) => ( - 90?'#DD1717':parseInt(record.teacherrating)>60&&parseInt(record.teacherrating)<90?"#FF6800":'#747A7F'}}>{record.teacherrating==="--"||record.teacherrating==="未批阅"?"--":parseInt(record.teacherrating)} + 90?'#DD1717':parseInt(record.teacherrating)>60&&parseInt(record.teacherrating)<90?"#FF6800":'#747A7F'}}>{record.teacherrating==="--"||record.teacherrating==="未批阅"?"--":record.teacherrating} ), @@ -850,7 +850,7 @@ class GraduationTaskssettinglist extends Component{ render: (text, record) => ( - 90?'#DD1717':parseInt(record.crossrating)>60&&parseInt(record.crossrating)<90?"#FF6800":'#747A7F'}}>{record.crossrating==="--"||record.crossrating==="未批阅"?"--":parseInt(record.crossrating)} + 90?'#DD1717':parseInt(record.crossrating)>60&&parseInt(record.crossrating)<90?"#FF6800":'#747A7F'}}>{record.crossrating==="--"||record.crossrating==="未批阅"?"--":record.crossrating} ), @@ -862,7 +862,7 @@ class GraduationTaskssettinglist extends Component{ render: (text, record) => ( - 90?'#DD1717':parseInt(record.finalscore)>60&&parseInt(record.finalscore)<90?"#FF6800":'#747A7F'}}>{record.finalscore==="--"?"--":parseInt(record.finalscore)} + 90?'#DD1717':parseInt(record.finalscore)>60&&parseInt(record.finalscore)<90?"#FF6800":'#747A7F'}}>{record.finalscore==="--"?"--":record.finalscore} ), @@ -995,7 +995,7 @@ class GraduationTaskssettinglist extends Component{ render: (text, record) => ( - 90?'#DD1717':parseInt(record.teacherrating)>60&&parseInt(record.teacherrating)<90?"#FF6800":'#747A7F'}}>{record.teacherrating==="--"||record.teacherrating==="未批阅"?"--":parseInt(record.teacherrating)} + 90?'#DD1717':parseInt(record.teacherrating)>60&&parseInt(record.teacherrating)<90?"#FF6800":'#747A7F'}}>{record.teacherrating==="--"||record.teacherrating==="未批阅"?"--":record.teacherrating} ), @@ -1007,7 +1007,7 @@ class GraduationTaskssettinglist extends Component{ render: (text, record) => ( - 90?'#DD1717':parseInt(record.crossrating)>60&&parseInt(record.crossrating)<90?"#FF6800":'#747A7F'}}>{record.crossrating==="--"||record.crossrating==="未批阅"?"--":parseInt(record.crossrating)} + 90?'#DD1717':parseInt(record.crossrating)>60&&parseInt(record.crossrating)<90?"#FF6800":'#747A7F'}}>{record.crossrating==="--"||record.crossrating==="未批阅"?"--":record.crossrating} ), @@ -1019,7 +1019,7 @@ class GraduationTaskssettinglist extends Component{ render: (text, record) => ( - 90?'#DD1717':parseInt(record.finalscore)>60&&parseInt(record.finalscore)<90?"#FF6800":'#747A7F'}}>{record.finalscore==="--"?"--":parseInt(record.finalscore)} + 90?'#DD1717':parseInt(record.finalscore)>60&&parseInt(record.finalscore)<90?"#FF6800":'#747A7F'}}>{record.finalscore==="--"?"--":record.finalscore} ), @@ -1138,7 +1138,7 @@ class GraduationTaskssettinglist extends Component{ render: (text, record) => ( - 90?'#DD1717':parseInt(record.teacherrating)>60&&parseInt(record.teacherrating)<90?"#FF6800":'#747A7F'}}>{record.teacherrating==="--"||record.teacherrating==="未批阅"?"--":parseInt(record.teacherrating)} + 90?'#DD1717':parseInt(record.teacherrating)>60&&parseInt(record.teacherrating)<90?"#FF6800":'#747A7F'}}>{record.teacherrating==="--"||record.teacherrating==="未批阅"?"--":record.teacherrating} ), @@ -1150,7 +1150,7 @@ class GraduationTaskssettinglist extends Component{ render: (text, record) => ( - 90?'#DD1717':parseInt(record.crossrating)>60&&parseInt(record.crossrating)<90?"#FF6800":'#747A7F'}}>{record.crossrating==="--"||record.crossrating==="未批阅"?"--":parseInt(record.crossrating)} + 90?'#DD1717':parseInt(record.crossrating)>60&&parseInt(record.crossrating)<90?"#FF6800":'#747A7F'}}>{record.crossrating==="--"||record.crossrating==="未批阅"?"--":record.crossrating} ), @@ -1162,7 +1162,7 @@ class GraduationTaskssettinglist extends Component{ render: (text, record) => ( - 90?'#DD1717':parseInt(record.finalscore)>60&&parseInt(record.finalscore)<90?"#FF6800":'#747A7F'}}>{record.finalscore==="--"?"--":parseInt(record.finalscore)} + 90?'#DD1717':parseInt(record.finalscore)>60&&parseInt(record.finalscore)<90?"#FF6800":'#747A7F'}}>{record.finalscore==="--"?"--":record.finalscore} ), From 7aa347713674e43270c70286ce61353af38ef2dd Mon Sep 17 00:00:00 2001 From: ysl <904079904@qq.com> Date: Sat, 22 Jun 2019 13:57:21 +0800 Subject: [PATCH 04/11] =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/login/EducoderLogin.js | 2 +- public/react/src/modules/login/Trialapplication.js | 5 +++++ public/react/src/modules/tpm/TPMIndexHOC.js | 9 ++++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/login/EducoderLogin.js b/public/react/src/modules/login/EducoderLogin.js index 6df53d63e..3c3f47c87 100644 --- a/public/react/src/modules/login/EducoderLogin.js +++ b/public/react/src/modules/login/EducoderLogin.js @@ -151,7 +151,7 @@ class EducoderLogin extends Component { }}>
+ Setshowbool={this.Setshowbool} >
diff --git a/public/react/src/modules/login/Trialapplication.js b/public/react/src/modules/login/Trialapplication.js index d2b942ce7..aa3a942dd 100644 --- a/public/react/src/modules/login/Trialapplication.js +++ b/public/react/src/modules/login/Trialapplication.js @@ -77,13 +77,18 @@ class Trialapplication extends Component { //TODO 这里如果样式变了会出现css不加载的情况 }); + console.log(this.props.isRenders); console.log("89"); + console.log(this.state.props.user_phone_binded ); try { if (this.state.props.user_phone_binded !== undefined) { console.log(this.state.props.user_phone_binded); this.setState({ user_phone_binded: this.state.props.user_phone_binded, }) + if(this.state.props.user_phone_binded === true){ + this.props.setTrialapplication(); + } } } catch (e) { diff --git a/public/react/src/modules/tpm/TPMIndexHOC.js b/public/react/src/modules/tpm/TPMIndexHOC.js index 7723af4fc..9d8adb920 100644 --- a/public/react/src/modules/tpm/TPMIndexHOC.js +++ b/public/react/src/modules/tpm/TPMIndexHOC.js @@ -213,6 +213,13 @@ export function TPMIndexHOC(WrappedComponent) { return this.state.coursedata&&this.state.coursedata.course_identity === 6 } + setTrialapplication = ()=>{ + this.setState({ + isRenders:true + }) + + } + /** 课堂权限相关方法,暂时写这里了 ----------------------------------------END @@ -285,7 +292,7 @@ export function TPMIndexHOC(WrappedComponent) { user_phone_binded === undefined? "" : - + } From 1ee43431d0418018cbc07a2369c56c3999de5e18 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Sat, 22 Jun 2019 14:04:54 +0800 Subject: [PATCH 05/11] =?UTF-8?q?=E8=B5=84=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/courses/Index.js | 6 +++--- .../react/src/modules/courses/ListPageIndex.js | 16 +++++++++++++++- .../react/src/modules/courses/Resource/index.js | 6 ++---- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/public/react/src/modules/courses/Index.js b/public/react/src/modules/courses/Index.js index c385af3b7..840d1d617 100644 --- a/public/react/src/modules/courses/Index.js +++ b/public/react/src/modules/courses/Index.js @@ -442,14 +442,14 @@ class CoursesIndex extends Component{ {/* 资源列表页 */} - () + (props) => () } > () + (props) => () } > + + () + } + > + () + } + > + + + {/* 默认 */} () } > - +
diff --git a/public/react/src/modules/courses/Resource/index.js b/public/react/src/modules/courses/Resource/index.js index 1cae3d559..6476ef2bb 100644 --- a/public/react/src/modules/courses/Resource/index.js +++ b/public/react/src/modules/courses/Resource/index.js @@ -573,7 +573,7 @@ class Fileslists extends Component{ return( -
+ {/*发送*/} @@ -647,7 +647,6 @@ class Fileslists extends Component{ has_course_groups={this.state.has_course_groups} />:""} - - -
+ ) } } From 12a0bcaf4555a8322adb3a88943ad9a0231a74eb Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Sat, 22 Jun 2019 14:13:05 +0800 Subject: [PATCH 06/11] =?UTF-8?q?=E6=AF=95=E8=AE=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/courses/Index.js | 8 ++++---- .../react/src/modules/courses/ListPageIndex.js | 18 +++++++++++++++++- .../modules/courses/graduation/tasks/index.js | 4 ++-- .../modules/courses/graduation/topics/index.js | 4 ++-- 4 files changed, 25 insertions(+), 9 deletions(-) diff --git a/public/react/src/modules/courses/Index.js b/public/react/src/modules/courses/Index.js index 840d1d617..3dcdb1c18 100644 --- a/public/react/src/modules/courses/Index.js +++ b/public/react/src/modules/courses/Index.js @@ -491,9 +491,9 @@ class CoursesIndex extends Component{ > {/* 毕设选题列表 */} - () + (props) => () }> @@ -559,9 +559,9 @@ class CoursesIndex extends Component{ {/* 毕设任务列表 https://www.trustie.net/issues/19981 */} - () + (props) => () } > diff --git a/public/react/src/modules/courses/ListPageIndex.js b/public/react/src/modules/courses/ListPageIndex.js index abb8a8528..1f8bf6b29 100644 --- a/public/react/src/modules/courses/ListPageIndex.js +++ b/public/react/src/modules/courses/ListPageIndex.js @@ -56,6 +56,14 @@ const ShixunHomework= Loadable({ loading: Loading, }) +const GraduationTopics= Loadable({ + loader: () => import('./graduation/topics'), + loading: Loading, +}) +const GraduationTasks= Loadable({ + loader: () => import('./graduation/tasks'), + loading: Loading, +}) class ListPageIndex extends Component{ constructor(props) { super(props) @@ -181,7 +189,15 @@ class ListPageIndex extends Component{ } > - + () + }> + () + } + > {/* 默认 */} + {/*提示*/} - + ) } } diff --git a/public/react/src/modules/courses/graduation/topics/index.js b/public/react/src/modules/courses/graduation/topics/index.js index aaba86e9e..391bcac18 100644 --- a/public/react/src/modules/courses/graduation/topics/index.js +++ b/public/react/src/modules/courses/graduation/topics/index.js @@ -341,7 +341,7 @@ onBoardsNew=()=>{ // let {course_identity}=this.props.coursedata const isAdmin =this.props.isAdmin(); return( - + {
-
+ ) } } From 710ef90cd12b601d208bdd19df97e5af89c14675 Mon Sep 17 00:00:00 2001 From: ysl <904079904@qq.com> Date: Sat, 22 Jun 2019 14:14:21 +0800 Subject: [PATCH 07/11] =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/login/Trialapplication.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/public/react/src/modules/login/Trialapplication.js b/public/react/src/modules/login/Trialapplication.js index aa3a942dd..e9a801f74 100644 --- a/public/react/src/modules/login/Trialapplication.js +++ b/public/react/src/modules/login/Trialapplication.js @@ -71,6 +71,7 @@ class Trialapplication extends Component { this.setState({ isRenders: true }) + this.props.setTrialapplication(); } return response; }, (error) => { @@ -86,9 +87,6 @@ class Trialapplication extends Component { this.setState({ user_phone_binded: this.state.props.user_phone_binded, }) - if(this.state.props.user_phone_binded === true){ - this.props.setTrialapplication(); - } } } catch (e) { From cc290824bd4e438adbe4f6a1ddc11341677e1854 Mon Sep 17 00:00:00 2001 From: ysl <904079904@qq.com> Date: Sat, 22 Jun 2019 14:29:20 +0800 Subject: [PATCH 08/11] =?UTF-8?q?=E9=99=84=E4=BB=B6=E4=B8=8A=E4=BC=A0=20?= =?UTF-8?q?=E5=BC=B9=E5=87=BA=E6=A1=86=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../graduation/tasks/GraduationTasksSubmitnew.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js index fd383eabf..1f49804e5 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js @@ -84,8 +84,20 @@ class GraduationTasksSubmitnew extends Component{ handleSubmit=(e) => { - let {fileList,selectmemberslist,workslist}=this.state; + + if(fileList.length === 0){ + this.setState({ + Modalstype:true, + Modalstopval:'请上传附件!', + Loadtype:true, + ModalCancel:this.cancelAttachment + }) + + + return + } + let userids=[]; From df009248ea2b92c067c350f9012207ff291297e6 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Sat, 22 Jun 2019 14:47:15 +0800 Subject: [PATCH 09/11] =?UTF-8?q?=E6=AF=94=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/page/MainContent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/page/MainContent.js b/public/react/src/modules/page/MainContent.js index bfe53f0ac..2aef78e1b 100644 --- a/public/react/src/modules/page/MainContent.js +++ b/public/react/src/modules/page/MainContent.js @@ -57,7 +57,7 @@ class MainContent extends Component { `}
+ id="game_left_contents" style={{ width: '35%'}}> {/* style={{width: '694px'}} */} {/* 左侧任务说明等功能的区域 */} From c3ca98a64422b990f7e29a2240a9a0fb42a4d276 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Sat, 22 Jun 2019 14:51:20 +0800 Subject: [PATCH 10/11] "@novnc/novnc": "^1.1.0", --- public/react/package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/public/react/package.json b/public/react/package.json index 7b00881d5..19b8286d9 100644 --- a/public/react/package.json +++ b/public/react/package.json @@ -3,6 +3,8 @@ "version": "0.1.0", "private": true, "dependencies": { + "@novnc/novnc": "^1.1.0", + "@flatten/array": "^1.1.7", "@icedesign/base": "^0.2.5", "antd": "^3.6.5", From e196f5b066d54f32c90c4f9b667d29c8c84fd60b Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Sat, 22 Jun 2019 15:02:37 +0800 Subject: [PATCH 11/11] VNCDisplay --- public/react/src/modules/page/Index.js | 4 + public/react/src/modules/page/MainContent.js | 10 +- .../src/modules/page/MainContentContainer.js | 4 + public/react/src/modules/page/VNCDisplay.js | 154 ++++++++++++++++++ 4 files changed, 171 insertions(+), 1 deletion(-) create mode 100644 public/react/src/modules/page/VNCDisplay.js diff --git a/public/react/src/modules/page/Index.js b/public/react/src/modules/page/Index.js index 7d89462b9..5a37c8c66 100644 --- a/public/react/src/modules/page/Index.js +++ b/public/react/src/modules/page/Index.js @@ -223,6 +223,10 @@ class Index extends Component { challenge={context.challenge} myshixun={context.myshixun} shixun={context.shixun} + + vnc_url={context.vnc_url} + zip_path={context.zip_path} + loading={context.loading} discusses_count={context.discusses_count} hide_code={context.hide_code} diff --git a/public/react/src/modules/page/MainContent.js b/public/react/src/modules/page/MainContent.js index 2aef78e1b..c49b037f9 100644 --- a/public/react/src/modules/page/MainContent.js +++ b/public/react/src/modules/page/MainContent.js @@ -13,6 +13,7 @@ import ChooseEvaluateView from './main/ChooseEvaluateView' import { CircularProgress } from 'material-ui/Progress'; import Button from 'material-ui/Button'; +import VNCDisplay from './VNCDisplay' import './tpiPage.css'; import './tpiPageForMobile.css'; @@ -32,7 +33,7 @@ class MainContent extends Component { } render() { const { challenge, output_sets, onRunCodeTest, latest_output, record, st, readRepoTimeout, - onTestSetHeaderClick, loading, codeLoading } = this.props + onTestSetHeaderClick, loading, codeLoading, shixun} = this.props // if (output_sets && output_sets.test_sets) { // const test_sets_array = JSON.parse("[" + output_sets.test_sets + "]"); @@ -47,6 +48,9 @@ class MainContent extends Component { } const newProps = Object.assign({}, this.props); delete newProps.testSetsExpandedArray + + const showIframeContent = shixun && shixun.vnc == true + return (
+//
+//
Loading
+//
Send CtrlAltDel
+//
+//
+//
+// ); +// } +// } + +// export default VNCDisplay;