caishi 6 years ago
commit 56dbc531d8

@ -3,6 +3,8 @@
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"dependencies": { "dependencies": {
"@novnc/novnc": "^1.1.0",
"@flatten/array": "^1.1.7", "@flatten/array": "^1.1.7",
"@icedesign/base": "^0.2.5", "@icedesign/base": "^0.2.5",
"antd": "^3.6.5", "antd": "^3.6.5",

@ -442,16 +442,21 @@ class CoursesIndex extends Component{
<Switch {...this.props}> <Switch {...this.props}>
{/* 资源列表页 */} {/* 资源列表页 */}
<Route path="/courses/:coursesId/file/:Id" <Route path="/courses/:coursesId/file/:Id" exact
render={ render={
(props) => (<Resourcelist {...this.props} {...props} {...this.state} />) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
} }
></Route> ></Route>
<Route path="/courses/:coursesId/files/:main_id" <Route path="/courses/:coursesId/files/:main_id"
render={ render={
(props) => (<Resourcelist {...this.props} {...props} {...this.state} />) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
} }
></Route> ></Route>
<Route exact path="/courses/:coursesId/boards/:boardId"
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
}
></Route>
{/*课堂讨论*/} {/*课堂讨论*/}
<Route path="/courses/:coursesId/boards/:boardId" <Route path="/courses/:coursesId/boards/:boardId"
render={ render={
@ -486,9 +491,9 @@ class CoursesIndex extends Component{
></Route> ></Route>
{/* 毕设选题列表 */} {/* 毕设选题列表 */}
<Route path="/courses/:coursesId/graduation_topics/:Id" <Route path="/courses/:coursesId/graduation_topics/:Id" exact
render={ render={
(props) => (<GraduationTopics {...this.props} {...props} {...this.state} />) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
}></Route> }></Route>
@ -554,9 +559,9 @@ class CoursesIndex extends Component{
{/* 毕设任务列表 https://www.trustie.net/issues/19981 */} {/* 毕设任务列表 https://www.trustie.net/issues/19981 */}
<Route path="/courses/:coursesId/graduation_tasks/:Id" <Route path="/courses/:coursesId/graduation_tasks/:Id" exact
render={ render={
(props) => (<GraduationTasks {...this.props} {...props} {...this.state} />) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
} }
></Route> ></Route>
@ -593,13 +598,13 @@ class CoursesIndex extends Component{
></Route> ></Route>
{/* 普通作业 */} {/* 普通作业 */}
<Route path="/courses/:coursesId/common_homeworks" exact <Route path="/courses/:coursesId/common_homeworks/:category_id" exact
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
} }
></Route> ></Route>
{/* 分组作业 */} {/* 分组作业 */}
<Route path="/courses/:coursesId/group_homeworks" exact <Route path="/courses/:coursesId/group_homeworks/:category_id" exact
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
} }

@ -56,6 +56,14 @@ const ShixunHomework= Loadable({
loading: Loading, loading: Loading,
}) })
const GraduationTopics= Loadable({
loader: () => import('./graduation/topics'),
loading: Loading,
})
const GraduationTasks= Loadable({
loader: () => import('./graduation/tasks'),
loading: Loading,
})
class ListPageIndex extends Component{ class ListPageIndex extends Component{
constructor(props) { constructor(props) {
super(props) super(props)
@ -169,12 +177,34 @@ class ListPageIndex extends Component{
} }
></Route> ></Route>
<Route path="/courses/:coursesId/files/:main_id"
render={
(props) => (<Resourcelist {...this.props} {...props} {...this.state} />)
}
></Route>
<Route path="/courses/:coursesId/file/:Id"
render={
(props) => (<Resourcelist {...this.props} {...props} {...this.state} />)
}
></Route>
<Route path="/courses/:coursesId/graduation_topics/:Id"
render={
(props) => (<GraduationTopics {...this.props} {...props} {...this.state} />)
}></Route>
<Route path="/courses/:coursesId/graduation_tasks/:Id"
render={
(props) => (<GraduationTasks {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 默认 */}
<Route path="/courses/:coursesId" <Route path="/courses/:coursesId"
render={ render={
(props) => (<StudentsList {...this.props} {...props} {...this.state} />) (props) => (<StudentsList {...this.props} {...props} {...this.state} />)
} }
></Route> ></Route>
</Switch> </Switch>
</div> </div>
</div> </div>

@ -573,7 +573,7 @@ class Fileslists extends Component{
return( return(
<div> <React.Fragment >
{/*发送*/} {/*发送*/}
@ -647,7 +647,6 @@ class Fileslists extends Component{
has_course_groups={this.state.has_course_groups} has_course_groups={this.state.has_course_groups}
/>:""} />:""}
<CourseLayoutcomponent {...this.props}>
<Titlesearchsection <Titlesearchsection
title={name} title={name}
searchValue={ searchValue } searchValue={ searchValue }
@ -840,8 +839,7 @@ class Fileslists extends Component{
</div> </div>
</CourseLayoutcomponent> </React.Fragment>
</div>
) )
} }
} }

@ -71,6 +71,13 @@ class commonWork extends Component{
sureDelClasses(){ sureDelClasses(){
} }
componentDidUpdate(prevProps, prevState) {
debugger;
if (prevProps.match.path != this.props.match.path) {
this.componentDidMount()
}
}
componentDidMount(){ componentDidMount(){
this.setState({ this.setState({

@ -85,6 +85,19 @@ class GraduationTasksSubmitnew extends Component{
handleSubmit=(e) => { handleSubmit=(e) => {
let {fileList,selectmemberslist,workslist}=this.state; let {fileList,selectmemberslist,workslist}=this.state;
if(fileList.length === 0){
this.setState({
Modalstype:true,
Modalstopval:'请上传附件!',
Loadtype:true,
ModalCancel:this.cancelAttachment
})
return
}
let userids=[]; let userids=[];
@ -432,6 +445,8 @@ render(){
let graduation_id=workslist===undefined?"":workslist.graduation_id; let graduation_id=workslist===undefined?"":workslist.graduation_id;
let task_id=workslist===undefined?"":workslist.task_id; let task_id=workslist===undefined?"":workslist.task_id;
return( return(
<React.Fragment> <React.Fragment>

@ -697,7 +697,7 @@ class GraduationTaskssettinglist extends Component{
render: (text, record) => ( render: (text, record) => (
<span> <span>
<Tooltip placement="bottom" title={record.teacherrating==="--"||record.teacherrating==="未批阅"?"未评阅":""}> <Tooltip placement="bottom" title={record.teacherrating==="--"||record.teacherrating==="未批阅"?"未评阅":""}>
<a style={{color:parseInt(record.teacherrating)>90?'#DD1717':parseInt(record.teacherrating)>60&&parseInt(record.teacherrating)<90?"#FF6800":'#747A7F'}}>{record.teacherrating==="--"||record.teacherrating==="未批阅"?"--":parseInt(record.teacherrating)}</a> <a style={{color:parseInt(record.teacherrating)>90?'#DD1717':parseInt(record.teacherrating)>60&&parseInt(record.teacherrating)<90?"#FF6800":'#747A7F'}}>{record.teacherrating==="--"||record.teacherrating==="未批阅"?"--":record.teacherrating}</a>
</Tooltip> </Tooltip>
</span> </span>
), ),
@ -709,7 +709,7 @@ class GraduationTaskssettinglist extends Component{
render: (text, record) => ( render: (text, record) => (
<span> <span>
<Tooltip placement="bottom" title={record.crossrating==="--"||record.crossrating==="未批阅"?"未评阅":""}> <Tooltip placement="bottom" title={record.crossrating==="--"||record.crossrating==="未批阅"?"未评阅":""}>
<a style={{color:parseInt(record.crossrating)>90?'#DD1717':parseInt(record.crossrating)>60&&parseInt(record.crossrating)<90?"#FF6800":'#747A7F'}}>{record.crossrating==="--"||record.crossrating==="未批阅"?"--":parseInt(record.crossrating)}</a> <a style={{color:parseInt(record.crossrating)>90?'#DD1717':parseInt(record.crossrating)>60&&parseInt(record.crossrating)<90?"#FF6800":'#747A7F'}}>{record.crossrating==="--"||record.crossrating==="未批阅"?"--":record.crossrating}</a>
</Tooltip> </Tooltip>
</span> </span>
), ),
@ -721,7 +721,7 @@ class GraduationTaskssettinglist extends Component{
render: (text, record) => ( render: (text, record) => (
<span> <span>
<Tooltip placement="bottom" title={record.finalscore==="--"?"未评阅":""}> <Tooltip placement="bottom" title={record.finalscore==="--"?"未评阅":""}>
<a style={{color:parseInt(record.finalscore)>90?'#DD1717':parseInt(record.finalscore)>60&&parseInt(record.finalscore)<90?"#FF6800":'#747A7F'}}>{record.finalscore==="--"?"--":parseInt(record.finalscore)}</a> <a style={{color:parseInt(record.finalscore)>90?'#DD1717':parseInt(record.finalscore)>60&&parseInt(record.finalscore)<90?"#FF6800":'#747A7F'}}>{record.finalscore==="--"?"--":record.finalscore}</a>
</Tooltip> </Tooltip>
</span> </span>
), ),
@ -838,7 +838,7 @@ class GraduationTaskssettinglist extends Component{
render: (text, record) => ( render: (text, record) => (
<span> <span>
<Tooltip placement="bottom" title={record.teacherrating==="--"||record.teacherrating==="未批阅"?"未评阅":""}> <Tooltip placement="bottom" title={record.teacherrating==="--"||record.teacherrating==="未批阅"?"未评阅":""}>
<a style={{color:parseInt(record.teacherrating)>90?'#DD1717':parseInt(record.teacherrating)>60&&parseInt(record.teacherrating)<90?"#FF6800":'#747A7F'}}>{record.teacherrating==="--"||record.teacherrating==="未批阅"?"--":parseInt(record.teacherrating)}</a> <a style={{color:parseInt(record.teacherrating)>90?'#DD1717':parseInt(record.teacherrating)>60&&parseInt(record.teacherrating)<90?"#FF6800":'#747A7F'}}>{record.teacherrating==="--"||record.teacherrating==="未批阅"?"--":record.teacherrating}</a>
</Tooltip> </Tooltip>
</span> </span>
), ),
@ -850,7 +850,7 @@ class GraduationTaskssettinglist extends Component{
render: (text, record) => ( render: (text, record) => (
<span> <span>
<Tooltip placement="bottom" title={record.crossrating==="--"||record.crossrating==="未批阅"?"未评阅":""}> <Tooltip placement="bottom" title={record.crossrating==="--"||record.crossrating==="未批阅"?"未评阅":""}>
<a style={{color:parseInt(record.crossrating)>90?'#DD1717':parseInt(record.crossrating)>60&&parseInt(record.crossrating)<90?"#FF6800":'#747A7F'}}>{record.crossrating==="--"||record.crossrating==="未批阅"?"--":parseInt(record.crossrating)}</a> <a style={{color:parseInt(record.crossrating)>90?'#DD1717':parseInt(record.crossrating)>60&&parseInt(record.crossrating)<90?"#FF6800":'#747A7F'}}>{record.crossrating==="--"||record.crossrating==="未批阅"?"--":record.crossrating}</a>
</Tooltip> </Tooltip>
</span> </span>
), ),
@ -862,7 +862,7 @@ class GraduationTaskssettinglist extends Component{
render: (text, record) => ( render: (text, record) => (
<span> <span>
<Tooltip placement="bottom" title={record.finalscore==="--"?"未评阅":""}> <Tooltip placement="bottom" title={record.finalscore==="--"?"未评阅":""}>
<a style={{color:parseInt(record.finalscore)>90?'#DD1717':parseInt(record.finalscore)>60&&parseInt(record.finalscore)<90?"#FF6800":'#747A7F'}}>{record.finalscore==="--"?"--":parseInt(record.finalscore)}</a> <a style={{color:parseInt(record.finalscore)>90?'#DD1717':parseInt(record.finalscore)>60&&parseInt(record.finalscore)<90?"#FF6800":'#747A7F'}}>{record.finalscore==="--"?"--":record.finalscore}</a>
</Tooltip> </Tooltip>
</span> </span>
), ),
@ -995,7 +995,7 @@ class GraduationTaskssettinglist extends Component{
render: (text, record) => ( render: (text, record) => (
<span> <span>
<Tooltip placement="bottom" title={record.teacherrating==="--"||record.teacherrating==="未批阅"?"未评阅":""}> <Tooltip placement="bottom" title={record.teacherrating==="--"||record.teacherrating==="未批阅"?"未评阅":""}>
<a style={{color:parseInt(record.teacherrating)>90?'#DD1717':parseInt(record.teacherrating)>60&&parseInt(record.teacherrating)<90?"#FF6800":'#747A7F'}}>{record.teacherrating==="--"||record.teacherrating==="未批阅"?"--":parseInt(record.teacherrating)}</a> <a style={{color:parseInt(record.teacherrating)>90?'#DD1717':parseInt(record.teacherrating)>60&&parseInt(record.teacherrating)<90?"#FF6800":'#747A7F'}}>{record.teacherrating==="--"||record.teacherrating==="未批阅"?"--":record.teacherrating}</a>
</Tooltip> </Tooltip>
</span> </span>
), ),
@ -1007,7 +1007,7 @@ class GraduationTaskssettinglist extends Component{
render: (text, record) => ( render: (text, record) => (
<span> <span>
<Tooltip placement="bottom" title={record.crossrating==="--"||record.crossrating==="未批阅"?"未评阅":""}> <Tooltip placement="bottom" title={record.crossrating==="--"||record.crossrating==="未批阅"?"未评阅":""}>
<a style={{color:parseInt(record.crossrating)>90?'#DD1717':parseInt(record.crossrating)>60&&parseInt(record.crossrating)<90?"#FF6800":'#747A7F'}}>{record.crossrating==="--"||record.crossrating==="未批阅"?"--":parseInt(record.crossrating)}</a> <a style={{color:parseInt(record.crossrating)>90?'#DD1717':parseInt(record.crossrating)>60&&parseInt(record.crossrating)<90?"#FF6800":'#747A7F'}}>{record.crossrating==="--"||record.crossrating==="未批阅"?"--":record.crossrating}</a>
</Tooltip> </Tooltip>
</span> </span>
), ),
@ -1019,7 +1019,7 @@ class GraduationTaskssettinglist extends Component{
render: (text, record) => ( render: (text, record) => (
<span> <span>
<Tooltip placement="bottom" title={record.finalscore==="--"?"未评阅":""}> <Tooltip placement="bottom" title={record.finalscore==="--"?"未评阅":""}>
<a style={{color:parseInt(record.finalscore)>90?'#DD1717':parseInt(record.finalscore)>60&&parseInt(record.finalscore)<90?"#FF6800":'#747A7F'}}>{record.finalscore==="--"?"--":parseInt(record.finalscore)}</a> <a style={{color:parseInt(record.finalscore)>90?'#DD1717':parseInt(record.finalscore)>60&&parseInt(record.finalscore)<90?"#FF6800":'#747A7F'}}>{record.finalscore==="--"?"--":record.finalscore}</a>
</Tooltip> </Tooltip>
</span> </span>
), ),
@ -1138,7 +1138,7 @@ class GraduationTaskssettinglist extends Component{
render: (text, record) => ( render: (text, record) => (
<span> <span>
<Tooltip placement="bottom" title={record.teacherrating==="--"||record.teacherrating==="未批阅"?"未评阅":""}> <Tooltip placement="bottom" title={record.teacherrating==="--"||record.teacherrating==="未批阅"?"未评阅":""}>
<a style={{color:parseInt(record.teacherrating)>90?'#DD1717':parseInt(record.teacherrating)>60&&parseInt(record.teacherrating)<90?"#FF6800":'#747A7F'}}>{record.teacherrating==="--"||record.teacherrating==="未批阅"?"--":parseInt(record.teacherrating)}</a> <a style={{color:parseInt(record.teacherrating)>90?'#DD1717':parseInt(record.teacherrating)>60&&parseInt(record.teacherrating)<90?"#FF6800":'#747A7F'}}>{record.teacherrating==="--"||record.teacherrating==="未批阅"?"--":record.teacherrating}</a>
</Tooltip> </Tooltip>
</span> </span>
), ),
@ -1150,7 +1150,7 @@ class GraduationTaskssettinglist extends Component{
render: (text, record) => ( render: (text, record) => (
<span> <span>
<Tooltip placement="bottom" title={record.crossrating==="--"||record.crossrating==="未批阅"?"未评阅":""}> <Tooltip placement="bottom" title={record.crossrating==="--"||record.crossrating==="未批阅"?"未评阅":""}>
<a style={{color:parseInt(record.crossrating)>90?'#DD1717':parseInt(record.crossrating)>60&&parseInt(record.crossrating)<90?"#FF6800":'#747A7F'}}>{record.crossrating==="--"||record.crossrating==="未批阅"?"--":parseInt(record.crossrating)}</a> <a style={{color:parseInt(record.crossrating)>90?'#DD1717':parseInt(record.crossrating)>60&&parseInt(record.crossrating)<90?"#FF6800":'#747A7F'}}>{record.crossrating==="--"||record.crossrating==="未批阅"?"--":record.crossrating}</a>
</Tooltip> </Tooltip>
</span> </span>
), ),
@ -1162,7 +1162,7 @@ class GraduationTaskssettinglist extends Component{
render: (text, record) => ( render: (text, record) => (
<span> <span>
<Tooltip placement="bottom" title={record.finalscore==="--"?"未评阅":""}> <Tooltip placement="bottom" title={record.finalscore==="--"?"未评阅":""}>
<a style={{color:parseInt(record.finalscore)>90?'#DD1717':parseInt(record.finalscore)>60&&parseInt(record.finalscore)<90?"#FF6800":'#747A7F'}}>{record.finalscore==="--"?"--":parseInt(record.finalscore)}</a> <a style={{color:parseInt(record.finalscore)>90?'#DD1717':parseInt(record.finalscore)>60&&parseInt(record.finalscore)<90?"#FF6800":'#747A7F'}}>{record.finalscore==="--"?"--":record.finalscore}</a>
</Tooltip> </Tooltip>
</span> </span>
), ),

@ -591,7 +591,7 @@ class GraduationTasks extends Component{
// console.log(this.props.isCourseidentity()===isNotMember) // console.log(this.props.isCourseidentity()===isNotMember)
// console.log(category_id) // console.log(category_id)
return( return(
<CourseLayoutcomponent {...this.props}> <React.Fragment>
{/*提示*/} {/*提示*/}
<Modals <Modals
modalsType={Modalstype} modalsType={Modalstype}
@ -775,7 +775,7 @@ class GraduationTasks extends Component{
</div> </div>
</CourseLayoutcomponent> </React.Fragment>
) )
} }
} }

@ -341,7 +341,7 @@ onBoardsNew=()=>{
// let {course_identity}=this.props.coursedata // let {course_identity}=this.props.coursedata
const isAdmin =this.props.isAdmin(); const isAdmin =this.props.isAdmin();
return( return(
<CourseLayoutcomponent {...this.props}> <React.Fragment >
<ChooseGraduateTopicModal ref="chooseGraduateTopicModal"></ChooseGraduateTopicModal> <ChooseGraduateTopicModal ref="chooseGraduateTopicModal"></ChooseGraduateTopicModal>
<Titlesearchsection <Titlesearchsection
title="毕设选题" title="毕设选题"
@ -446,7 +446,7 @@ onBoardsNew=()=>{
<div> <div>
</div> </div>
</CourseLayoutcomponent> </React.Fragment>
) )
} }
} }

@ -60,21 +60,27 @@ class EducoderLogin extends Component {
if( props.match.url === "/changepassword" ){ if( props.match.url === "/changepassword" ){
this.state = { this.state = {
showbool: false, showbool: false,
logini:3,
} }
}else { }else {
if(props.match.url === "/login"){ if(props.match.url === "/login"){
this.state = { this.state = {
showbool: true, showbool: true,
loginstatus:true loginstatus:true,
logini:1,
} }
}else if(props.match.url === "/register"){ }else if(props.match.url === "/register"){
this.state = { this.state = {
showbool: true, showbool: true,
loginstatus:false, loginstatus:false,
logini:2,
} }
}else{ }else{
this.state = { this.state = {
showbool: true, 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 = () => { Setshowbool = () => {
if (this.state.showbool === true) { if (this.state.showbool === true) {
@ -102,7 +116,7 @@ class EducoderLogin extends Component {
render() { render() {
let {showbool} = this.state; let {showbool,loginstatus,logini} = this.state;
return ( return (
<div style={newContainer} > <div style={newContainer} >
<style> <style>
@ -135,14 +149,12 @@ class EducoderLogin extends Component {
"align-items": "center", "align-items": "center",
"width": "100%", "width": "100%",
}}> }}>
<div style={{"margin-top": "40px"}}> <div style={{"margin-top": "40px","height":"500px"}}>
<LoginRegisterComponent {...this.props} {...this.state} <LoginRegisterComponent {...this.props} {...this.state}
Setshowbool={this.Setshowbool}></LoginRegisterComponent> Setshowbool={this.Setshowbool} ></LoginRegisterComponent>
<div style={{"width":"100%","height":"350px"}}>
</div>
</div> </div>
</div> </div>
: :
<div style={{ <div style={{
@ -151,17 +163,23 @@ class EducoderLogin extends Component {
"align-items": "center", "align-items": "center",
"width": "100%", "width": "100%",
}}> }}>
<div style={{"margin-top": "40px"}}> <div style={{"margin-top": "40px","height":"500px"}}>
<FindPasswordComponent {...this.props} {...this.state} <FindPasswordComponent {...this.props} {...this.state}
Setshowbool={this.Setshowbool}></FindPasswordComponent> Setshowbool={this.Setshowbool}></FindPasswordComponent>
<div style={{"width":"100%","height":"250px"}}>
</div>
</div> </div>
</div> </div>
} }
<div style={{"height":"250px",
"display": "flex",
"justify-content": "center",
"align-items": "center",
"width": "100%",
}}>
<div className="font-14 color-grey-9 " style={{marginTop:"15px"}}>© 2019 EduCoder湘ICP备17009477号Trustie & IntelliDE inside.</div>
</div>
</div> </div>
</div> </div>
) )

@ -71,13 +71,16 @@ class Trialapplication extends Component {
this.setState({ this.setState({
isRenders: true isRenders: true
}) })
this.props.setTrialapplication();
} }
return response; return response;
}, (error) => { }, (error) => {
//TODO 这里如果样式变了会出现css不加载的情况 //TODO 这里如果样式变了会出现css不加载的情况
}); });
console.log(this.props.isRenders);
console.log("89"); console.log("89");
console.log(this.state.props.user_phone_binded );
try { try {
if (this.state.props.user_phone_binded !== undefined) { if (this.state.props.user_phone_binded !== undefined) {
console.log(this.state.props.user_phone_binded); console.log(this.state.props.user_phone_binded);

@ -223,6 +223,10 @@ class Index extends Component {
challenge={context.challenge} challenge={context.challenge}
myshixun={context.myshixun} myshixun={context.myshixun}
shixun={context.shixun} shixun={context.shixun}
vnc_url={context.vnc_url}
zip_path={context.zip_path}
loading={context.loading} loading={context.loading}
discusses_count={context.discusses_count} discusses_count={context.discusses_count}
hide_code={context.hide_code} hide_code={context.hide_code}

@ -13,6 +13,7 @@ import ChooseEvaluateView from './main/ChooseEvaluateView'
import { CircularProgress } from 'material-ui/Progress'; import { CircularProgress } from 'material-ui/Progress';
import Button from 'material-ui/Button'; import Button from 'material-ui/Button';
import VNCDisplay from './VNCDisplay'
import './tpiPage.css'; import './tpiPage.css';
import './tpiPageForMobile.css'; import './tpiPageForMobile.css';
@ -32,7 +33,7 @@ class MainContent extends Component {
} }
render() { render() {
const { challenge, output_sets, onRunCodeTest, latest_output, record, st, readRepoTimeout, 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) { // if (output_sets && output_sets.test_sets) {
// const test_sets_array = JSON.parse("[" + 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); const newProps = Object.assign({}, this.props);
delete newProps.testSetsExpandedArray delete newProps.testSetsExpandedArray
const showIframeContent = shixun && shixun.vnc == true
return ( return (
<div className="page--body -margin-t-64 -flex tpi_content"> <div className="page--body -margin-t-64 -flex tpi_content">
<style>{` <style>{`
@ -57,7 +61,7 @@ class MainContent extends Component {
`}</style> `}</style>
<div className="-layout -stretch -fit labelN" id="game_show_content"> <div className="-layout -stretch -fit labelN" id="game_show_content">
<div className="split-panel--first -layout -vertical -flex -relative -flex-basic40" <div className="split-panel--first -layout -vertical -flex -relative -flex-basic40"
id="game_left_contents" style={{ width: '28%'}}> id="game_left_contents" style={{ width: '35%'}}>
{/* style={{width: '694px'}} */} {/* style={{width: '694px'}} */}
{/* 左侧任务说明等功能的区域 */} {/* 左侧任务说明等功能的区域 */}
@ -82,6 +86,10 @@ class MainContent extends Component {
<div className="fl pr tip-right-con" id="update_game_tip"></div> <div className="fl pr tip-right-con" id="update_game_tip"></div>
</div>*/} </div>*/}
{/* { showIframeContent && vnc_url ? <VNCDisplay
vnc_url={vnc_url}
></VNCDisplay> */}
<div className="-layout-v -flex"> <div className="-layout-v -flex">
<div className="-flex -relative"> <div className="-flex -relative">
<div className="split-panel -fit -vertical" id="games_repository_valuation"> <div className="split-panel -fit -vertical" id="games_repository_valuation">

@ -237,6 +237,10 @@ class MainContentContainer extends Component {
// arg_path 点击文件目录树时传入的点击节点对应的path // arg_path 点击文件目录树时传入的点击节点对应的path
fetchRepositoryCode( props, arg_path, type, isRetry) { fetchRepositoryCode( props, arg_path, type, isRetry) {
const { challenge, showSnackbar, game, shixun, myshixun, hide_code } = props ? props : this.props; const { challenge, showSnackbar, game, shixun, myshixun, hide_code } = props ? props : this.props;
if (shixun.vnc == true) {
// vnc模式下不需要加载代码
return true;
}
if ( if (
// true || // true ||
hide_code) { // 隐藏code的实训 hide_code) { // 隐藏code的实训

@ -0,0 +1,154 @@
// import React, { Component } from 'react';
// import RFB from '@novnc/novnc/lib/rfb.js';
// const $ = window.$;
// // const showIframeContent = window.location.search.indexOf('vnc=1') != -1;
// class VNCDisplay extends Component {
// componentDidMount() {
// console.log(RFB)
// let rfb;
// let desktopName;
// // When this function is called we have
// // successfully connected to a server
// function connectedToServer(e) {
// status("Connected to " + desktopName);
// }
// // This function is called when we are disconnected
// function disconnectedFromServer(e) {
// if (e.detail.clean) {
// status("Disconnected");
// } else {
// status("Something went wrong, connection is closed");
// }
// }
// // When this function is called, the server requires
// // credentials to authenticate
// function credentialsAreRequired(e) {
// const password = prompt("Password Required:");
// rfb.sendCredentials({ password: password });
// }
// // When this function is called we have received
// // a desktop name from the server
// function updateDesktopName(e) {
// desktopName = e.detail.name;
// }
// // Since most operating systems will catch Ctrl+Alt+Del
// // before they get a chance to be intercepted by the browser,
// // we provide a way to emulate this key sequence.
// function sendCtrlAltDel() {
// rfb.sendCtrlAltDel();
// return false;
// }
// // Show a status text in the top bar
// function status(text) {
// document.getElementById('status').textContent = text;
// }
// // This function extracts the value of one variable from the
// // query string. If the variable isn't defined in the URL
// // it returns the default value instead.
// function readQueryVariable(name, defaultValue) {
// // A URL with a query parameter can look like this:
// // https://www.example.com?myqueryparam=myvalue
// //
// // Note that we use location.href instead of location.search
// // because Firefox < 53 has a bug w.r.t location.search
// const re = new RegExp('.*[?&]' + name + '=([^&#]*)'),
// match = document.location.href.match(re);
// if (typeof defaultValue === 'undefined') { defaultValue = null; }
// if (match) {
// // We have to decode the URL since want the cleartext value
// return decodeURIComponent(match[1]);
// }
// return defaultValue;
// }
// document.getElementById('sendCtrlAltDelButton')
// .onclick = sendCtrlAltDel;
// // Read parameters specified in the URL query string
// // By default, use the host and port of server that served this file
// // const host = readQueryVariable('host', window.location.hostname);
// // let port = readQueryVariable('port', window.location.port);
// // const password = readQueryVariable('password', '');
// const { vnc_url } = this.props;
// // http://117.50.12.63:43149/vnc_lite.html?password=headless
// let _ar1 = vnc_url.split('/');
// let ipAndPort = _ar1[2].split(':')
// let passwordAr = _ar1[3].split('password=')
// const host = ipAndPort[0]
// let port = ipAndPort[1]
// const password = passwordAr[1].split('&')[0]
// const path = readQueryVariable('path', 'websockify');
// // | | | | | |
// // | | | Connect | | |
// // v v v v v v
// status("Connecting");
// // Build the websocket URL used to connect
// let url;
// if (vnc_url.indexOf("https:") != -1) {
// url = 'wss';
// } else {
// url = 'ws';
// }
// url += '://' + host;
// if(port) {
// url += ':' + port;
// }
// url += '/' + path;
// // Creating a new RFB object will start a new connection
// rfb = new RFB(document.getElementById('screen'), url,
// { credentials: { password: password } });
// // Add listeners to important events from the RFB module
// rfb.addEventListener("connect", connectedToServer);
// rfb.addEventListener("disconnect", disconnectedFromServer);
// rfb.addEventListener("credentialsrequired", credentialsAreRequired);
// rfb.addEventListener("desktopname", updateDesktopName);
// // Set parameters that can be changed on an active connection
// rfb.viewOnly = readQueryVariable('view_only', false);
// rfb.scaleViewport = readQueryVariable('scale', false);
// }
// render() {
// const { challenge, vnc_url } = this.props
// return (
// <div className="">
// <style>{`
// #top_bar {
// background-color: #6e84a3;
// color: white;
// font: bold 12px Helvetica;
// padding: 6px 5px 4px 5px;
// border-bottom: 1px outset;
// }
// #status {
// text-align: center;
// }
// #sendCtrlAltDelButton {
// position: fixed;
// top: 0px;
// right: 0px;
// border: 1px outset;
// padding: 5px 5px 4px 5px;
// cursor: pointer;
// }
// #screen {
// flex: 1; /* fill remaining space */
// overflow: hidden;
// }
// `}</style>
// <div id="top_bar">
// <div id="status">Loading</div>
// <div id="sendCtrlAltDelButton">Send CtrlAltDel</div>
// </div>
// <div id="screen"></div>
// </div>
// );
// }
// }
// export default VNCDisplay;

@ -213,6 +213,13 @@ export function TPMIndexHOC(WrappedComponent) {
return this.state.coursedata&&this.state.coursedata.course_identity === 6 return this.state.coursedata&&this.state.coursedata.course_identity === 6
} }
setTrialapplication = ()=>{
this.setState({
isRenders:true
})
}
/** /**
课堂权限相关方法暂时写这里了 ----------------------------------------END 课堂权限相关方法暂时写这里了 ----------------------------------------END
@ -285,7 +292,7 @@ export function TPMIndexHOC(WrappedComponent) {
user_phone_binded === undefined? user_phone_binded === undefined?
"" ""
: :
<Trialapplication {...this.state} user_phone_binded={user_phone_binded}></Trialapplication> <Trialapplication {...this.state} user_phone_binded={user_phone_binded} setTrialapplication = {this.setTrialapplication} ></Trialapplication>
} }

@ -1,429 +1,431 @@
import React, {Component} from 'react'; import React, {Component} from 'react';
import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom"; import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom";
import {getImageUrl, DragValidator} from 'educoder'; import {getImageUrl, DragValidator} from 'educoder';
import {Tabs, Input, Checkbox, Button, notification} from 'antd'; import {Tabs, Input, Checkbox, Button, notification} from 'antd';
import axios from 'axios'; import axios from 'axios';
import './common.css' import './common.css'
const TabPane = Tabs.TabPane const TabPane = Tabs.TabPane
const loginInputsyl = { const loginInputsyl = {
"width": " 100%", "width": " 100%",
"height": "40px", "height": "40px",
} }
//父组件 EducoderLogin.js //父组件 EducoderLogin.js
class LoginRegisterComponent extends Component { class LoginRegisterComponent extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
login: "", login: "",
password: "", password: "",
passwords: "", passwords: "",
seconds: 60, seconds: 60,
codes: "", codes: "",
getverificationcodes: true, getverificationcodes: true,
Phonenumberisnotco: undefined, Phonenumberisnotco: undefined,
Phonenumberisnotcobool: false, Phonenumberisnotcobool: false,
s: 'text', s: 'text',
classpass: "text", classpass: "text",
readonlyInput: true, readonlyInput: true,
} }
} }
openNotification = (messge) => { openNotification = (messge) => {
notification.open({ notification.open({
message: "提示", message: "提示",
description: description:
messge, messge,
onClick: () => { onClick: () => {
console.log('Notification Clicked!'); console.log('Notification Clicked!');
}, },
}); });
}; };
StudyMakeMoney = () => { // 调用父组件方法 StudyMakeMoney = () => { // 调用父组件方法
this.props.Setshowbool(); this.props.Setshowbool();
} }
// 点击表单后改变type // 点击表单后改变type
changeType = () => { changeType = () => {
this.setState({classpass: 'password'}); this.setState({classpass: 'password'});
} }
changeTypey = () => { changeTypey = () => {
} }
//倒计时 //倒计时
getverificationcode = () => { getverificationcode = () => {
if (this.state.Phonenumberisnotcobool === false) { if (this.state.Phonenumberisnotcobool === false ||this.state.Phonenumberisnotcobool === undefined) {
if (this.state.login.length === 0) { if (this.state.login&&this.state.login.length === 0) {
this.openNotification("请输入手机号或邮箱"); this.openNotification("请输入手机号或邮箱");
return return
} else { } else {
this.openNotification("请输入正确的手机号或邮箱"); this.openNotification("请输入正确的手机号或邮箱");
} }
return; return;
} }
if (this.state.getverificationcodes === true) { if (this.state.getverificationcodes === true) {
this.setState({ this.setState({
getverificationcodes: undefined, getverificationcodes: undefined,
}) })
let timer = setInterval(() => { let timer = setInterval(() => {
this.setState((preState) => ({ this.setState((preState) => ({
seconds: preState.seconds - 1, seconds: preState.seconds - 1,
}), () => { }), () => {
if (this.state.seconds == 0) { if (this.state.seconds == 0) {
clearInterval(timer); clearInterval(timer);
this.setState({ this.setState({
getverificationcodes: false, getverificationcodes: false,
seconds: 60, seconds: 60,
}) })
} }
}); });
}, 1000) }, 1000)
this.SMSverification(); this.SMSverification();
} else { } else {
this.setState({ this.setState({
getverificationcodes: undefined, getverificationcodes: undefined,
}) })
let timer = setInterval(() => { let timer = setInterval(() => {
this.setState((preState) => ({ this.setState((preState) => ({
seconds: preState.seconds - 1, seconds: preState.seconds - 1,
}), () => { }), () => {
if (this.state.seconds == 0) { if (this.state.seconds == 0) {
clearInterval(timer); clearInterval(timer);
this.setState({ this.setState({
getverificationcodes: false, getverificationcodes: false,
seconds: 60, seconds: 60,
}) })
} }
}); });
}, 1000) }, 1000)
this.SMSverification(); this.SMSverification();
} }
} }
//短信验证 //短信验证
SMSverification = () => { SMSverification = () => {
var url = `/accounts/get_verification_code.json`; var url = `/accounts/get_verification_code.json`;
axios.get((url), { axios.get((url), {
params: { params: {
login: this.state.login, login: this.state.login,
type: 2, type: 2,
} }
}).then((result) => { }).then((result) => {
//验证有问题{"status":1,"message":"success"} //验证有问题{"status":1,"message":"success"}
console.log(result); console.log(result);
}).catch((error) => { }).catch((error) => {
console.log(error); console.log(error);
}) })
} }
cancelReadOnly = () => { cancelReadOnly = () => {
this.setState({ this.setState({
readonlyInput: false, readonlyInput: false,
}) })
} }
//找回密码 //找回密码
Retrievepassword = () => { Retrievepassword = () => {
if (this.state.Phonenumberisnotcobool === false) { if (this.state.Phonenumberisnotcobool === false) {
if (this.state.login.length === 0) { if (this.state.login.length === 0) {
this.openNotification("请输入手机号或邮箱"); this.openNotification("请输入手机号或邮箱");
return return
} }
this.openNotification("请输入正确的手机号或邮箱"); this.openNotification("请输入正确的手机号或邮箱");
return; return;
} }
if (this.state.login === undefined || this.state.login == "") { if (this.state.login === undefined || this.state.login == "") {
this.openNotification(`请输入登录手机号码或邮箱`); this.openNotification(`请输入登录手机号码或邮箱`);
return return
} else if (this.state.password === undefined || this.state.password == "") { } else if (this.state.password === undefined || this.state.password == "") {
this.openNotification(`请输入密码`); this.openNotification(`请输入密码`);
return return
} else if (this.state.passwords === undefined || this.state.passwords == "") { } else if (this.state.passwords === undefined || this.state.passwords == "") {
this.openNotification(`请输入密码`); this.openNotification(`请输入密码`);
return return
} else if (this.state.password !== this.state.passwords) { } else if (this.state.password !== this.state.passwords) {
this.openNotification(`两次密码不相同`); this.openNotification(`两次密码不相同`);
return return
} else if (this.state.codes === undefined || this.state.codes == "") { } else if (this.state.codes === undefined || this.state.codes == "") {
this.openNotification(`请输入验证码`); this.openNotification(`请输入验证码`);
return return
} }
var url = "/accounts/reset_password.json"; var url = "/accounts/reset_password.json";
axios.post(url, { axios.post(url, {
login: this.state.login, login: this.state.login,
code: this.state.codes, code: this.state.codes,
new_password: this.state.password, new_password: this.state.password,
new_password_confirmation: this.state.passwords, new_password_confirmation: this.state.passwords,
}).then((result) => { }).then((result) => {
// console.log(result); // console.log(result);
//登录成功会生成session //登录成功会生成session
this.openNotification("找回密码成功,请重新登入。"); this.openNotification("找回密码成功,请重新登入。");
window.location.href = "/login" window.location.href = "/login"
}).catch((error) => { }).catch((error) => {
}) })
} }
openNotification = (messge) => { openNotification = (messge) => {
notification.open({ notification.open({
message: "提示", message: "提示",
description: description:
messge, messge,
onClick: () => { onClick: () => {
console.log('Notification Clicked!'); console.log('Notification Clicked!');
}, },
}); });
}; };
loginInputonChange = (e) => { loginInputonChange = (e) => {
// console.log(e.target.value); // console.log(e.target.value);
this.setState({ this.setState({
login: e.target.value, login: e.target.value,
}) })
} }
loginInputonChanges = (e) => { loginInputonChanges = (e) => {
// console.log(e.target.value); // console.log(e.target.value);
this.setState({ this.setState({
password: e.target.value, password: e.target.value,
}) })
} }
loginInputonChangess = (e) => { loginInputonChangess = (e) => {
// console.log(e.target.value); // console.log(e.target.value);
this.setState({ this.setState({
passwords: e.target.value, passwords: e.target.value,
}) })
} }
//获取code //获取code
codesonChange = (e) => { codesonChange = (e) => {
this.setState({ this.setState({
codes: e.target.value codes: e.target.value
}) })
} }
inputOnBlur = (e) => { inputOnBlur = (e) => {
this.isCorrectname(e.target.value); this.isCorrectname(e.target.value);
// this.Emailphonenumberverification(e.target.value, id); // this.Emailphonenumberverification(e.target.value, id);
} }
isCorrectname = (value) => { isCorrectname = (value) => {
console.log(value.length); console.log(value.length);
if (value.length === 0) { if (value.length === 0) {
this.setState({ this.setState({
Phonenumberisnotco: undefined, Phonenumberisnotco: undefined,
Phonenumberisnotcobool: false, Phonenumberisnotcobool: false,
}) })
return; return;
} }
// var telephone = $("#telephoneAdd.tianjia_phone").val(); // var telephone = $("#telephoneAdd.tianjia_phone").val();
var regph = /^[1][3,4,5,6,7,8][0-9]{9}$/; var regph = /^[1][3,4,5,6,7,8][0-9]{9}$/;
// var email = $("#add_email.tianjia_email").val(); // var email = $("#add_email.tianjia_email").val();
var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; 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的任意数字。 // [1]手机号开头必须是1 [3,4,5,6,7,8] 第二位是3-8中的一个 [0-9]{9} 后边9位可以是0-9的任意数字。
var stringdata = undefined; var stringdata = undefined;
if (!regph.test(value)) { if (!regph.test(value)) {
stringdata = "手机号格式不正确"; stringdata = "手机号格式不正确";
this.setState({ this.setState({
Phonenumberisnotco: stringdata, Phonenumberisnotco: stringdata,
Phonenumberisnotcobool: false, Phonenumberisnotcobool: false,
}) })
} else { } else {
this.setState({ this.setState({
Phonenumberisnotco: undefined, Phonenumberisnotco: undefined,
Phonenumberisnotcobool: true, Phonenumberisnotcobool: true,
}) })
return return
} }
if (!regemail.test(value)) { if (!regemail.test(value)) {
if ((value.indexOf("@") != -1) === true) { if ((value.indexOf("@") != -1) === true) {
stringdata = "邮箱格式不正确"; stringdata = "邮箱格式不正确";
} else { } else {
stringdata = "手机号格式不正确"; stringdata = "手机号格式不正确";
} }
this.setState({ this.setState({
Phonenumberisnotco: stringdata, Phonenumberisnotco: stringdata,
Phonenumberisnotcobool: false, Phonenumberisnotcobool: false,
}) })
this.Emailphonenumberverification(value) this.Emailphonenumberverification(value)
return return
} else { } else {
this.setState({ this.setState({
Phonenumberisnotco: undefined, Phonenumberisnotco: undefined,
Phonenumberisnotcobool: true, Phonenumberisnotcobool: true,
}) })
return return
} }
} }
//邮箱手机号验证 //邮箱手机号验证
Emailphonenumberverification = (value) => { Emailphonenumberverification = (value) => {
var url = `/accounts/valid_email_and_phone.json`; var url = `/accounts/valid_email_and_phone.json`;
axios.get((url), { axios.get((url), {
params: { params: {
login: value, login: value,
type: 2, type: 2,
} }
}).then((result) => { }).then((result) => {
//验证有问题{"status":1,"message":"success"} //验证有问题{"status":1,"message":"success"}
console.log(result); console.log(result);
}).catch((error) => { }).catch((error) => {
console.log(error); console.log(error);
// this.setState({ // this.setState({
// login:"", // login:"",
// logins:"", // logins:"",
// }) // })
}) })
} }
render() { render() {
const { const {
activeKey, activeKey,
// 登录 // 登录
autoLogin, autoLogin,
// 注册 // 注册
readAgreement, dragOk, readAgreement, dragOk,
login, login,
password, password,
passwords, passwords,
classpass, classpass,
seconds, seconds,
getverificationcodes, getverificationcodes,
Phonenumberisnotco, Phonenumberisnotco,
readonlyInput, readonlyInput,
codes, codes,
} = this.state } = this.state
// height: 346px; // height: 346px;
return ( return (
<div className="login_register_content"> <div className="login_register_content" style={{height: "482px"}}>
<Input type="text" name="username" value={"namename"} <Input type="text" name="username" value={"namename"}
style={{height: '0', width: '0', border: 'none', display: "none"}}/> style={{height: '0', width: '0', border: 'none', display: "none"}}/>
<Input type="password" name="password" id="password" value={"123123123"} <Input type="password" name="password" id="password" value={"123123123"}
style={{height: '0', width: '0', border: 'none', display: "none"}}/> style={{height: '0', width: '0', border: 'none', display: "none"}}/>
<style>{` <style>{`
.login_section .section_header { .login_section .section_header {
margin-bottom: 16px; margin-bottom: 16px;
font-size: 18px; font-size: 18px;
width: 100%; width: 100%;
text-align: center; text-align: center;
border-bottom: 1px solid rgb(234, 234, 234); border-bottom: 1px solid rgb(234, 234, 234);
height: 72px; height: 69px;
color: #05101A; color: #05101A;
line-height: 73px; line-height: 69px;
} }
`}</style> `}</style>
<div className="login_section"> <div className="login_section">
<div className="section_header"> <div className="section_header">
找回密码 找回密码
</div> </div>
<div style={{width: '340px'}}> <div style={{width: '340px'}}>
<style> <style>
{ {
` `
.ant-input { .ant-input {
font-family: "Monospaced Number", "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif; font-family: "Monospaced Number", "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
-webkit-box-sizing: border-box; -webkit-box-sizing: border-box;
box-sizing: border-box; box-sizing: border-box;
margin: 0; margin: 0;
padding: 0; padding: 0;
list-style: none; list-style: none;
position: relative; position: relative;
display: inline-block; display: inline-block;
padding: 4px 11px; padding: 4px 11px;
width: 100%; width: 100%;
height: 38px; height: 38px;
font-size: 14px; font-size: 14px;
line-height: 1.5; line-height: 1.5;
color: rgba(0, 0, 0, 0.65); color: rgba(0, 0, 0, 0.65);
background-color: #fff; background-color: #fff;
background-image: none; background-image: none;
border: 1px solid #d9d9d9; border: 1px solid #d9d9d9;
border-radius: 4px; border-radius: 4px;
-webkit-transition: all .3s; -webkit-transition: all .3s;
-o-transition: all .3s; -o-transition: all .3s;
transition: all .3s; transition: all .3s;
} }
` `
} }
</style> </style>
<Input style={loginInputsyl} type="text" autoComplete="off" onClick={this.changeTypey} <Input style={loginInputsyl} type="text" autoComplete="off" onClick={this.changeTypey}
placeholder="输入注册手机号或邮箱" value={this.state.login} onBlur={(e) => this.inputOnBlur(e)} placeholder="输入注册手机号或邮箱" value={this.state.login} onBlur={(e) => this.inputOnBlur(e)}
onChange={this.loginInputonChange} style={{marginTop: '10px'}}></Input> onChange={this.loginInputonChange} style={{marginTop: '10px',height: "38px"}}></Input>
{ {
Phonenumberisnotco && Phonenumberisnotco != "" ? Phonenumberisnotco && Phonenumberisnotco != "" ?
<p className="color-red mt5 mb5" style={{width: " 100%", height: "20px"}}> <p className="color-red mt5 mb5" style={{width: " 100%", height: "20px"}}>
<span>{Phonenumberisnotco}</span> <span>{Phonenumberisnotco}</span>
</p> </p>
: <div className="mt10 mb10"></div> : <div style={{height: "25px"}}></div>
} }
<DragValidator <DragValidator
height={38} className="loginInput" successGreenColor="#45E15F" height={38} successGreenColor="#45E15F"
dragOkCallback={this.dragOkCallback} style={{height:"38px",width:"100%"}}
></DragValidator> dragOkCallback={this.dragOkCallback}
<Input className="loginInput mb20" type={classpass} ></DragValidator>
onClick={this.changeType} autoComplete="new-password" onChange={this.loginInputonChanges} <Input type={classpass}
value={this.state.password} placeholder="输入8~16位密码区分大小写"></Input> onClick={this.changeType} autoComplete="new-password" onChange={this.loginInputonChanges}
<Input className="loginInput mb20" type={classpass} value={this.state.password} style={{width:"100%",height:"38px",marginTop:'25px'}} placeholder="输入8~16位密码区分大小写"></Input>
onClick={this.changeType} autoComplete="new-password" <Input type={classpass}
onChange={this.loginInputonChangess} value={this.state.passwords} onClick={this.changeType} autoComplete="new-password"
placeholder="再次输入新密码"></Input> onChange={this.loginInputonChangess} value={this.state.passwords}
style={{height:"38px",marginTop:'25px',width:"100%"}}
<div> placeholder="再次输入新密码"></Input>
<Input className="fl mr5" type="text" autoComplete="off" style={{
"width": "210px", <div className={"mt25"}>
"margin-bottom": "16px", <Input className="fl mr5" type="text" autoComplete="off" style={{
"height": "38px", width: "210px",
}} placeholder="请输入验证码" height: "38px",
onChange={this.codesonChange} }} placeholder="请输入验证码"
value={codes} onChange={this.codesonChange}
> value={codes}
</Input> >
{ </Input>
getverificationcodes === undefined ? {
<Button className="fl ml5 " disabled getverificationcodes === undefined ?
style={{"width": "120px", "text-align": "center", "height": "38px",}} <Button className="fl ml5 " disabled
size={"large"}>重新发送{seconds}s</Button> style={{"width": "120px", "text-align": "center", "height": "38px",}}
: getverificationcodes === true ? size={"large"}>重新发送{seconds}s</Button>
<Button className="fl ml5 " : getverificationcodes === true ?
style={{"width": "120px", "text-align": "center", "height": "38px"}} <Button className="fl ml5 "
type="primary" style={{"width": "120px", "text-align": "center", "height": "38px"}}
onClick={() => this.getverificationcode()} size={"large"}>验证码</Button> type="primary"
: onClick={() => this.getverificationcode()} size={"large"}>获取验证码</Button>
<Button className="fl ml5 " :
style={{"width": "120px", "text-align": "center", "height": "38px"}} <Button className="fl ml5 "
type="primary" style={{"width": "120px", "text-align": "center", "height": "38px"}}
onClick={() => this.getverificationcode()} size={"large"}>重新发送</Button> type="primary"
} onClick={() => this.getverificationcode()} size={"large"}>重新发送</Button>
}
</div>
</div>
<Button className="login_btn" size={"large"} type="primary"
onClick={this.Retrievepassword}>完成</Button> <Button className="login_btn" size={"large"} type="primary"
</div> style={{height:"46px"}}
</div> onClick={this.Retrievepassword}>完成</Button>
</div>
</div> </div>
);
} </div>
} );
}
export default (LoginRegisterComponent); }
export default (LoginRegisterComponent);

@ -10,8 +10,12 @@ import axios from 'axios';
import './common.css' import './common.css'
const { TabPane } = Tabs; const { TabPane } = Tabs;
const loginInputsyl = { const loginInputsyl = {
"width": " 100%", "width":"434px",
"height": "40px", "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 //父组件EducoderLogin.js
@ -135,6 +139,7 @@ class LoginRegisterComponent extends Component {
; ;
StudyMakeMoney = () => { // 调用父组件方法 StudyMakeMoney = () => { // 调用父组件方法
this.props.Setshowbool(); this.props.Setshowbool();
// this.props.Setlogins(3);
this.setState({ this.setState({
login: "", login: "",
password: "", password: "",
@ -407,8 +412,9 @@ class LoginRegisterComponent extends Component {
//倒计时 //倒计时
getverificationcode = () => { getverificationcode = () => {
if (this.state.Phonenumberisnotcobool === false) { debugger
if (this.state.logins.length === 0) { if (this.state.Phonenumberisnotcobool === false ||this.state.Phonenumberisnotcobool === undefined) {
if (this.state.logins&&this.state.logins.length === 0) {
this.openNotification("请输入手机号或邮箱",2); this.openNotification("请输入手机号或邮箱",2);
return return
}else { }else {
@ -503,6 +509,13 @@ class LoginRegisterComponent extends Component {
this.setState({ this.setState({
tab:e.key 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) // 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); // console.log(activeKey);
return ( return (
<div className="login_register_content"> <div className="login_register_content" style={ parseInt(tab[0])==0?{height: "346px"} :{height: "462px"}}>
<div> <div>
@ -576,62 +589,65 @@ class LoginRegisterComponent extends Component {
<Input placeholder="请输入登录手机号码或邮箱" value={this.state.login} <Input placeholder="请输入登录手机号码或邮箱" value={this.state.login}
onChange={this.loginInputonChange} onChange={this.loginInputonChange}
name="username" name="username"
style={{marginTop: '30px'}}></Input> className="font-14 color-grey-9"
style={{marginTop: '30px', height: '38px'}}></Input>
{ {
Phonenumberisnotco && Phonenumberisnotco != "" ? Phonenumberisnotco && Phonenumberisnotco != "" ?
<p className="color-red mt5 mb5" style={{width: " 100%", height: "20px"}}> <p className="color-red mt5 mb5" style={{width: " 100%", height: "20px"}}>
<span>{Phonenumberisnotco}</span> <span>{Phonenumberisnotco}</span>
</p> </p>
: <div className="mt15 mb15"></div> : <div style={{height:"25px"}}></div>
} }
<Input type="password" name="password" id="password" className="loginInput" value={this.state.password} <Input type="password" name="password" id="password" value={this.state.password}
onChange={this.passwordonChange} onChange={this.passwordonChange}
className="font-14 color-grey-9 loginInput"
placeholder="密码"></Input> placeholder="密码"></Input>
<div className="left_right mt20"> <div className="left_right mt25 font-12 " style={{color: '#676767'}}>
<Checkbox onChange={this.onAutoLoginChange} checked={autoLogin}>下次自动登录</Checkbox> <Checkbox onChange={this.onAutoLoginChange} checked={autoLogin}>下次自动登录</Checkbox>
<a <a onClick={this.StudyMakeMoney}
onClick={this.StudyMakeMoney} className="mr3 color-grey-9 mt3 font-12">找回密码</a>
className="mr3 color-grey-9">找回密码</a>
</div> </div>
<Button className="login_btn" type="primary" onClick={() => this.postLogin()} <Button className="login_btn font-16" type="primary" style={{height:"46px"}} onClick={() => this.postLogin()}
size={"large"}>登录</Button> size={"large"}>登录</Button>
</div> </div>
} }
{ {
parseInt(tab[0])==1 && parseInt(tab[0])==1 &&
<div style={{width: '340px'}}> <div style={{width: '340px'}}>
<Input className={loginInputsyl} placeholder="请使用手机号/邮箱账号进行注册" <Input className="loginInputsyl color-grey-9" placeholder="请使用手机号/邮箱账号进行注册"
value={this.state.logins} value={this.state.logins}
type="text" autoComplete="off" type="text" autoComplete="off"
onChange={this.loginInputonChanges} onChange={this.loginInputonChanges}
onBlur={(e) => this.inputOnBlur(e, 2)} onBlur={(e) => this.inputOnBlur(e, 2)}
style={{marginTop: '30px'}}></Input> style={{marginTop: '30px' , height: '38px',color:'#999999',fontSize:"14px"}}></Input>
{ {
Phonenumberisnotcos && Phonenumberisnotcos != "" ? Phonenumberisnotcos && Phonenumberisnotcos != "" ?
<p className="color-red mt5 mb5 " style={{width: " 100%", height: "20px"}}> <p className="color-red mt5 mb5 " style={{width: " 100%", height: "20px"}}>
{/*<span className="fl">{Phonenumberisnotcos}</span>*/}
<span className="fl">{Phonenumberisnotcos}</span> <span className="fl" style={{textAlign:"center",width: " 100%"}}>请输入手机号码</span>
</p> </p>
: <div className=" mt15 mb15"></div> : <div style={{height:"25px"}}></div>
} }
<DragValidator <DragValidator
height={38} className="loginInput" successGreenColor="#45E15F" height={38} className="loginInput" successGreenColor="#45E15F"
style={{ height: '38px'}}
dragOkCallback={this.dragOkCallback} dragOkCallback={this.dragOkCallback}
></DragValidator> ></DragValidator>
<div> <div className="mt25">
<Input className="fl mr5" name="codes" type="text" autoComplete="off" readonly <Input className="fl mr5 font-14 color-grey-9" name="codes" type="text" autoComplete="off" readonly
onfocus="this.removeAttribute('readonly')" style={{ onfocus="this.removeAttribute('readonly')" style={{
"width": "210px", width:'210px',
"margin-bottom": "16px", height:'38px',
"height": "38px",
}} placeholder="请输入验证码" }} placeholder="请输入验证码"
onChange={this.codesonChange} onChange={this.codesonChange}
value={codes} value={codes}
@ -639,13 +655,13 @@ class LoginRegisterComponent extends Component {
</Input> </Input>
{ {
getverificationcodes === undefined ? getverificationcodes === undefined ?
<Button className="fl ml5 " disabled style={{"width": "120px","text-align":"center", "height": "38px",}} <Button className="fl ml5 font-14" disabled style={{"width": "120px","text-align":"center", "height": "38px",}}
size={"large"}>重新发送{seconds}s</Button> size={"large"}>重新发送{seconds}s</Button>
: getverificationcodes === true ? : getverificationcodes === true ?
<Button className="fl ml5 " type="primary" style={{"width": "120px","text-align":"center", "height": "38px",}} <Button className="fl ml5 font-14" type="primary" style={{"width": "120px","text-align":"center", "height": "38px",}}
onClick={() => this.getverificationcode()} size={"large"}>验证码</Button> onClick={() => this.getverificationcode()} size={"large"}>获取验证码</Button>
: :
<Button className="fl ml5 " type="primary" style={{"width": "120px","text-align":"center", "height": "38px",}} <Button className="fl ml5 font-14 " type="primary" style={{"width": "120px","text-align":"center", "height": "38px",}}
onClick={() => this.getverificationcode()} size={"large"}>重新发送</Button> onClick={() => this.getverificationcode()} size={"large"}>重新发送</Button>
} }
@ -655,8 +671,9 @@ class LoginRegisterComponent extends Component {
{/* style={{height: '0', width: '0', border: 'none', display: "none"}}/>*/} {/* style={{height: '0', width: '0', border: 'none', display: "none"}}/>*/}
{/*<Input type="password" name="password" id="password" autoComplete="new-password"*/} {/*<Input type="password" name="password" id="password" autoComplete="new-password"*/}
{/* style={{height: '0', width: '0', border: 'none', display: "none"}}/>*/} {/* style={{height: '0', width: '0', border: 'none', display: "none"}}/>*/}
<Input className="loginInput" placeholder="输入8~16位密码区分大小写" <Input className="loginInput font-14 mt25 color-grey-9" placeholder="输入8~16位密码区分大小写"
type={classpass} type={classpass}
autoComplete="new-password" autoComplete="new-password"
onClick={this.changeType} onClick={this.changeType}
value={this.state.passwords} onChange={this.passwordonChanges} suffix={ value={this.state.passwords} onChange={this.passwordonChanges} suffix={
@ -665,9 +682,11 @@ class LoginRegisterComponent extends Component {
}></Input> }></Input>
<Checkbox onChange={this.onChange} <Checkbox onChange={this.onChange}
value={Agreetotheterms} value={Agreetotheterms}
>我已阅读并同意服务协议条款</Checkbox> ><span className="font-14 " style={{
<Button className="login_btn" type="primary" onClick={() => this.postregistered()} color: '#676767',
size={"large"}>完成</Button> }}>我已阅读并同意服务协议条款</span></Checkbox>
<Button className="login_btn font-16" type="primary" style={{height:"46px"}} onClick={() => this.postregistered()}
size={"large"}>注册</Button>
</div> </div>

Loading…
Cancel
Save