hjm 5 years ago
commit 9bde68b284

@ -333,7 +333,13 @@ class App extends Component {
{/*实训课程(原实训路径)*/} {/*实训课程(原实训路径)*/}
<Route path="/paths" component={ShixunPaths}></Route> <Route path="/paths" component={ShixunPaths}></Route>
<Route path="/search" component={SearchPage} ></Route>
<Route path="/search"
render={
(props)=>(<SearchPage {...this.props} {...props} {...this.state}></SearchPage>)
}
></Route>
{/*课堂*/} {/*课堂*/}
<Route path="/courses" component={CoursesIndex} {...this.props}></Route> <Route path="/courses" component={CoursesIndex} {...this.props}></Route>

@ -1,6 +1,7 @@
import React, { useState, useEffect, memo } from 'react' import React, { useState, useEffect, memo } from 'react';
import ImageLayer from '../../modules/page/layers/ImageLayer' import ImageLayer from '../../modules/page/layers/ImageLayer';
import { isImageExtension } from 'educoder' import { isImageExtension } from 'educoder';
const $ = window.$;
function ImageLayerHook(props) { function ImageLayerHook(props) {
const [showImage, setShowImage] = useState(false) const [showImage, setShowImage] = useState(false)
const [imageSrc, setImageSrc] = useState('') const [imageSrc, setImageSrc] = useState('')

@ -40,8 +40,8 @@ class coursesHomeCard extends Component{
className="mt80 mb25"/> className="mt80 mb25"/>
<p className="font-14 color-white">非成员不能访问</p> <p className="font-14 color-white">非成员不能访问</p>
</div> </div>
{/*<a href={item.first_category_url} className="square-img" >*/} <a href={item.first_category_url} className="square-img" >
<a href={`/courses/${item.id}/students`} className="square-img" > {/*<a href={`/courses/${item.id}/students`} className="square-img" >*/}
{/*target="_blank"*/} {/*target="_blank"*/}
{ {
item.is_public===1&&item.id===1309? item.is_public===1&&item.id===1309?

@ -119,7 +119,7 @@ class AccessoryModal2 extends Component{
} }
} }
Saves=()=>{ Saves=()=>{
debugger // debugger
let {fileList,description} =this.state; let {fileList,description} =this.state;
let newfileList=[]; let newfileList=[];
for(var list of fileList){ for(var list of fileList){

@ -59,7 +59,7 @@ class Associationmodel extends Component{
goback=()=>{ goback=()=>{
debugger // debugger
this.setState({ this.setState({
Modalstype:false, Modalstype:false,
}) })
@ -70,7 +70,7 @@ class Associationmodel extends Component{
setSaves=()=>{ setSaves=()=>{
debugger // debugger
let {projectvalue}=this.state; let {projectvalue}=this.state;
let taskid=this.props.taskid; let taskid=this.props.taskid;
let url="/graduation_tasks/"+taskid+"/graduation_works/relate_project.json"; let url="/graduation_tasks/"+taskid+"/graduation_works/relate_project.json";

@ -86,7 +86,7 @@ class Exercisestatisticalresult extends Component {
page:pageNumber page:pageNumber
}) })
debugger // debugger
$('html').animate({ $('html').animate({
scrollTop: 10 scrollTop: 10
}, 1000); }, 1000);

@ -122,6 +122,11 @@ class GraduationTasksSubmitedit extends Component{
let fileList = info.fileList; let fileList = info.fileList;
this.setState({ fileList:appendFileSizeToUploadFileAll(fileList) }); this.setState({ fileList:appendFileSizeToUploadFileAll(fileList) });
} }
if (info.file.status === 'done') {
let fileList = info.fileList;
this.setState({ fileList:appendFileSizeToUploadFileAll(fileList) });
}
} }
//onAttachmentRemove = (file) => { //onAttachmentRemove = (file) => {
@ -393,7 +398,7 @@ class GraduationTasksSubmitedit extends Component{
// console.log(fileList); // console.log(fileList);
if(values.description===undefined||values.description===""){ if(values.description===undefined||values.description===""){
this.scrollToAnchor("valuestypes"); this.scrollToAnchor("valuestypes");
debugger // debugger
return return
} }
if(workslist.task_type===2){ if(workslist.task_type===2){

@ -117,10 +117,17 @@ class GraduationTasksSubmitnew extends Component{
} }
// 附件相关 START // 附件相关 START
handleChange = (info) => { handleChange = (info) => {
debugger
if (info.file.status === 'uploading') { if (info.file.status === 'uploading') {
let fileList = info.fileList; let fileList = info.fileList;
this.setState({ fileList:appendFileSizeToUploadFileAll(fileList) }); this.setState({ fileList:appendFileSizeToUploadFileAll(fileList) });
} }
if (info.file.status === 'done') {
let fileList = info.fileList;
this.setState({ fileList:appendFileSizeToUploadFileAll(fileList) });
}
} }
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
@ -358,7 +365,7 @@ class GraduationTasksSubmitnew extends Component{
//公用数据 //公用数据
Commoninterface = (fileList,selectmemberslist,workslist)=>{ Commoninterface = (fileList,selectmemberslist,workslist)=>{
debugger // debugger
let userids=[]; let userids=[];
for(var list of selectmemberslist){ for(var list of selectmemberslist){
@ -384,7 +391,7 @@ class GraduationTasksSubmitnew extends Component{
// console.log(fileList); // console.log(fileList);
if(values.description===undefined||values.description===""){ if(values.description===undefined||values.description===""){
this.scrollToAnchor("valuestypes"); this.scrollToAnchor("valuestypes");
debugger // debugger
return return
} }
if(workslist&&workslist.task_type===2){ if(workslist&&workslist.task_type===2){
@ -460,7 +467,7 @@ class GraduationTasksSubmitnew extends Component{
//确认 //确认
hidestartshixunsreplace=()=>{ hidestartshixunsreplace=()=>{
debugger // debugger
let {fileList,selectmemberslist,workslist}=this.state; let {fileList,selectmemberslist,workslist}=this.state;
this.Commoninterface(fileList,selectmemberslist,workslist); this.Commoninterface(fileList,selectmemberslist,workslist);

@ -145,7 +145,7 @@ class GraduationTasksedit extends Component{
} }
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
debugger // debugger
this.cancelAttachment(); this.cancelAttachment();
const url = `/attachments/${file.response ? file.response.id : file.uid}.json` const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
// const url = `/attachments/${file}.json` // const url = `/attachments/${file}.json`

@ -37,7 +37,7 @@ class GraduationTasks extends Component{
} }
} }
fetchAll = (search,page,order,count) => { fetchAll = (search,page,order,count) => {
debugger // debugger
const cid = this.props.match.params.coursesId const cid = this.props.match.params.coursesId
@ -554,7 +554,7 @@ debugger
} }
// 题库选用成功后刷新页面 // 题库选用成功后刷新页面
useBankSuccess=(checkBoxValues,object_ids)=>{ useBankSuccess=(checkBoxValues,object_ids)=>{
debugger // debugger
let {search,page,order,all_count} = this.state; let {search,page,order,all_count} = this.state;
this.fetchAll(search,page,order,all_count) this.fetchAll(search,page,order,all_count)
} }

@ -40,6 +40,8 @@ class CoursesNew extends Component {
} }
componentDidMount() { componentDidMount() {
let coursesId = this.props.match.params.coursesId; let coursesId = this.props.match.params.coursesId;
let user_school=this.props.current_user&&this.props.current_user.user_school; let user_school=this.props.current_user&&this.props.current_user.user_school;
@ -85,7 +87,13 @@ class CoursesNew extends Component {
this.Searchvalue("") this.Searchvalue("")
} }
componentDidUpdate(prevProps){
if(prevProps.current_user!=this.props.current_user){
if(this.props.current_user.user_identity==="学生"){
window.location.href ="/403"
}
}
}
onChangeTimepublishs = (date, dateString) => { onChangeTimepublishs = (date, dateString) => {
if(dateString===""){ if(dateString===""){
this.setState({ this.setState({

@ -115,7 +115,7 @@ class PollDetailTabForthRules extends Component{
} }
//修改发布规则里面的发布时间 //修改发布规则里面的发布时间
changeRulePublishTime=(e,date,index)=>{ changeRulePublishTime=(e,date,index)=>{
debugger // debugger
let arr=Object.assign({}, this.state.rules[parseInt(index)]); let arr=Object.assign({}, this.state.rules[parseInt(index)]);
arr.publish_time=date=== ""?"":moment(handleDateString(date)).format("YYYY-MM-DD HH:mm"); arr.publish_time=date=== ""?"":moment(handleDateString(date)).format("YYYY-MM-DD HH:mm");
if(!arr.end_time){ if(!arr.end_time){

@ -71,13 +71,13 @@ class PollDetailTabThird extends Component{
<p className="pl30 pr30 pt30 pb15 font-16 clearfix"> <p className="pl30 pr30 pt30 pb15 font-16 clearfix">
<span className="color-blue mr8 fl">{item.question.question_number}{map[item.question.question_type]}</span> <span className="color-blue mr8 fl">{item.question.question_number}{map[item.question.question_type]}</span>
{ item.question.is_necessary==1 ? <span className="mustAnswer fl ml10 mr10">必答</span>:<span className="mustAnswer fl ml10 mr10"></span> } { item.question.is_necessary==1 ? <span className="mustAnswer fl ml10 mr10">必答</span>:<span className="mustAnswer fl ml10 mr10"></span> }
{ item.question.question_type == 2 ? { item.question.question_type == 2 && item.question.min_choices && item.question.max_choice ?
<span className="color-grey-9 font-14 fl mt2"> <span className="color-grey-9 font-14 fl mt2">
{ {
item.question.min_choices == item.question.max_choices ? "可选"+item.question.max_choices+"项" : item.question.min_choices == item.question.max_choices ? "可选"+item.question.max_choices+"项" :
"可选"+item.question.min_choices+"-"+item.question.max_choices+"项" "可选"+item.question.min_choices+"-"+item.question.max_choices+"项"
} }
</span>:"" </span>:""
} }
</p> </p>
<li className="pl30 pr30 pb15">{item.question.question_title}</li> <li className="pl30 pr30 pb15">{item.question.question_title}</li>

@ -382,7 +382,7 @@ class PollInfo extends Component{
<div className="pl30 pr30 mt30 mb10 clearfix"> <div className="pl30 pr30 mt30 mb10 clearfix">
<span className="color-blue fl font-16">{item.question.question_number}{map[item.question.question_type]}</span> <span className="color-blue fl font-16">{item.question.question_number}{map[item.question.question_type]}</span>
{ item.question.is_necessary==1 ? <span className="mustAnswer fl ml10 mr10 mt5">必答</span>:<span className="mustAnswer fl ml10 mr10 mt5"></span> } { item.question.is_necessary==1 ? <span className="mustAnswer fl ml10 mr10 mt5">必答</span>:<span className="mustAnswer fl ml10 mr10 mt5"></span> }
{ item.question.question_type == 2 ? { item.question.question_type == 2 && item.question.min_choices && item.question.max_choice ?
<span className="color-grey-9 font-14 fl mt2"> <span className="color-grey-9 font-14 fl mt2">
{ {
item.question.min_choices == item.question.max_choices ? "可选"+item.question.max_choices+"项" : item.question.min_choices == item.question.max_choices ? "可选"+item.question.max_choices+"项" :

@ -69,11 +69,8 @@ class EducoderInteresse extends Component {
display: "flex", display: "flex",
justifyContent: "center", justifyContent: "center",
width: "100%", width: "100%",
bottom:"0",
position: "fixed"
}}> }}>
<div className="font-14 color-grey-9 " style={{ bottom:"0",position: "absolute",marginBottom: "20px"}}><span className="font-18">©</span>&nbsp;2019&nbsp;EduCoder<span className="ml15 mr15">ICP17009477</span><a href="https://team.trustie.net" style={{"color":"#888"}} target="_blank">Trustie</a>&nbsp;&nbsp;&nbsp;&amp;&nbsp;&nbsp;&nbsp;IntelliDE inside.</div> <div className="font-14 color-grey-9 " style={{marginTop:"20px"}}><span className="font-18">©</span>&nbsp;2019&nbsp;EduCoder<span className="ml15 mr15">ICP17009477</span><a href="https://team.trustie.net" style={{"color":"#888"}} target="_blank">Trustie</a>&nbsp;&nbsp;&nbsp;&amp;&nbsp;&nbsp;&nbsp;IntelliDE inside.</div>
</div> </div>
</div> </div>
</div> </div>

@ -72,7 +72,8 @@ class EducoderLogin extends Component {
showbool: 3, showbool: 3,
logini:3, logini:3,
namezh:"", namezh:"",
passmm:"" passmm:"",
loginstatus:true,
} }
}else { }else {
if(props.match.url === "/login"){ if(props.match.url === "/login"){
@ -98,8 +99,8 @@ class EducoderLogin extends Component {
showbool: 1, showbool: 1,
logini:1, logini:1,
namezh:"", namezh:"",
passmm:"" passmm:"",
loginstatus:true,
} }
} }
@ -156,13 +157,12 @@ class EducoderLogin extends Component {
display: "flex", display: "flex",
justifyContent: "center", justifyContent: "center",
width: "100%", width: "100%",
height: "550px", marginTop: "25px",
marginTop: "44px",
}}> }}>
<div> <div>
<LoginRegisterComponent {...this.props} {...this.state} <LoginRegisterComponent {...this.props} {...this.state}
Setshowbool={(e,name,pass)=>this.Setshowbool(e,name,pass)} ></LoginRegisterComponent> Setshowbool={(e)=>this.Setshowbool(e)} ></LoginRegisterComponent>
</div> </div>
@ -172,8 +172,7 @@ class EducoderLogin extends Component {
display: "flex", display: "flex",
justifyContent: "center", justifyContent: "center",
width: "100%", width: "100%",
height: "550px", marginTop: "25px",
marginTop: "44px",
}}> }}>
<div > <div >
<FindPasswordComponent {...this.props} {...this.state} <FindPasswordComponent {...this.props} {...this.state}
@ -186,11 +185,8 @@ class EducoderLogin extends Component {
display: "flex", display: "flex",
justifyContent: "center", justifyContent: "center",
width: "100%", width: "100%",
bottom:"0",
position: "fixed"
}}> }}>
<div className="font-14 color-grey-9 " style={{ bottom:"0",position: "absolute",marginBottom: "20px"}}><span className="font-18">©</span>&nbsp;2019&nbsp;EduCoder<span className="ml15 mr15">ICP17009477</span><a href="https://team.trustie.net" style={{"color":"#888"}} target="_blank">Trustie</a>&nbsp;&nbsp;&nbsp;&amp;&nbsp;&nbsp;&nbsp;IntelliDE inside.</div> <div className="font-14 color-grey-9 " style={{marginTop:"20px"}}><span className="font-18">©</span>&nbsp;2019&nbsp;EduCoder<span className="ml15 mr15">ICP17009477</span><a href="https://team.trustie.net" style={{"color":"#888"}} target="_blank">Trustie</a>&nbsp;&nbsp;&nbsp;&amp;&nbsp;&nbsp;&nbsp;IntelliDE inside.</div>
</div> </div>
</div> </div>
</div> </div>

@ -7,7 +7,7 @@ import Dialog, {
DialogContentText, DialogContentText,
DialogTitle, DialogTitle,
} from 'material-ui/Dialog'; } from 'material-ui/Dialog';
import {notification } from 'antd';
import axios from 'axios'; import axios from 'axios';
@ -346,10 +346,19 @@ class LoginDialog extends Component {
if(response===undefined){ if(response===undefined){
return return
} }
if(response.data.identity === null || response.data.identity === undefined){
this.props.history.push("/interesse");
return;
}
if(response.status===200){ if(response.status===200){
if (response.data.status === 402) { if (response.data.status === 402) {
window.location.href = response.data.url; window.location.href = response.data.url;
}else{ }else if (response.data.status === -2) {
notification.open({
message: '提示',
description:response.data.message,
});
}else{
broadcastChannelPostMessage('refreshPage') broadcastChannelPostMessage('refreshPage')
this.setState({ this.setState({
isRender:false isRender:false

@ -228,7 +228,7 @@ class DetailCards extends Component{
isSpin:true, isSpin:true,
}) })
axios.get(url).then((response) => { axios.get(url).then((response) => {
debugger // debugger
if(response.status===200){ if(response.status===200){
// let path="/shixuns/"+response.data.shixun_identifier+"/challenges"; // let path="/shixuns/"+response.data.shixun_identifier+"/challenges";
// this.props.history.push(path); // this.props.history.push(path);

@ -118,22 +118,23 @@ function loadHeader(){
function header_search(reactHeaderComponnet){ function header_search(reactHeaderComponnet){
console.log(old_url) console.log(old_url)
var keyword = $("input[name='search_keyword']").val(); // 搜索关键字 var keyword = $("input[name='search_keyword']").val(); // 搜索关键字
if (!reactHeaderComponnet) { window.location.href ="/search"+"?value="+keyword;
reactHeaderComponnet = window._header_componentHandler // if (!reactHeaderComponnet) {
} // reactHeaderComponnet = window._header_componentHandler
if (!reactHeaderComponnet) { // }
var index = $("#search_type").val(); // 搜索课程/项目 // if (!reactHeaderComponnet) {
keyword = encodeURIComponent(keyword); // var index = $("#search_type").val(); // 搜索课程/项目
// $.get('/users/search_shixuns_or_course', // keyword = encodeURIComponent(keyword);
// { search: keyword, // // $.get('/users/search_shixuns_or_course',
// index: index}); // // { search: keyword,
window.location.href = old_url+"/users/search_shixuns_or_courses" + "?search=" + keyword + "&index=" + index; // // index: index});
// window.location.href = old_url+"/users/search_shixuns_or_courses" + "?search=" + keyword + "&index=" + index;
//e.stopPropagation();//阻止冒泡 //e.stopPropagation();//阻止冒泡
} else { // } else {
window.__headSearchKeyword = keyword // window.__headSearchKeyword = keyword
reactHeaderComponnet.props.history.push(`/shixuns`) // reactHeaderComponnet.props.history.push(`/shixuns`)
trigger('searchKeywordChange', keyword) // trigger('searchKeywordChange', keyword)
} // }
} }
//头部导航条的隐藏 //头部导航条的隐藏
function closeSearch(){ function closeSearch(){
@ -382,12 +383,14 @@ class NewHeader extends Component {
header_search(this) header_search(this)
} }
onKeywordSearchKeyDown = (e) => { onKeywordSearchKeyDown = (e) => {
let code = e.keyCode;
window.location.href ="/search?value="+e.target.value;
// let code = e.keyCode;
if(code == 13) { // if(code == 13) {
header_search(this); // header_search(this);
return false; // return false;
} // }
} }
hideAddcoursestypes=()=>{ hideAddcoursestypes=()=>{
@ -632,7 +635,7 @@ submittojoinclass=(value)=>{
<a href="/"> <a href="/">
<img alt="高校智能化教学与实训平台" className="logoimg" src={getImageUrl("images/educoder/headNavLogo.png?1526520218")}></img> <img alt="高校智能化教学与实训平台" className="logoimg" src={getImageUrl("images/educoder/headNavLogo.png?1526520218")}></img>
</a> </a>
<div className="head-nav pr" style={{width:'716px'}}> <div className="head-nav pr">
<ul id="header-nav"> <ul id="header-nav">
{/*<li className={`${activeIndex === true ? 'active' : ''}`}><a href="/">首页</a></li>*/} {/*<li className={`${activeIndex === true ? 'active' : ''}`}><a href="/">首页</a></li>*/}
@ -704,10 +707,11 @@ submittojoinclass=(value)=>{
style={{display: 'none'}} style={{display: 'none'}}
> >
<Search <Search
placeholder="搜索" placeholder="实践课程/翻转课堂/开发社区/交流问答"
// onSearch={value => console.log(value)} // onSearch={value => console.log(value)}
onPressEnter={this.onKeywordSearchKeyDown} onPressEnter={this.onKeywordSearchKeyDown}
style={{ width: 258 }} style={{ width: 295 }}
/> />
</div> </div>
@ -788,7 +792,7 @@ submittojoinclass=(value)=>{
<div className="edu-menu-list" style={{top: '60px',width:"240px"}}> <div className="edu-menu-list" style={{top: '60px',width:"240px"}}>
<div className="overPart"></div> <div className="overPart"></div>
<ul className="fl with50 edu-txt-center pr ul-leftline"> <ul className="fl with50 edu-txt-center pr ul-leftline">
<li><Link to={"/courses/new"}>新建课堂</Link></li> {this.props.current_user&&this.props.current_user.user_identity==="学生"?"":<li><Link to={"/courses/new"}>新建课堂</Link></li>}
<li><a href="/shixuns/new">新建实训</a></li> <li><a href="/shixuns/new">新建实训</a></li>
<li><a href={this.props.Headertop===undefined?"":"/paths/new"}>新建实践课程</a></li> <li><a href={this.props.Headertop===undefined?"":"/paths/new"}>新建实践课程</a></li>
<li><a href={this.props.Headertop===undefined?"":this.props.Headertop.new_project_url} target="_blank">新建项目</a></li> <li><a href={this.props.Headertop===undefined?"":this.props.Headertop.new_project_url} target="_blank">新建项目</a></li>

@ -188,3 +188,7 @@ body>.-task-title {
.HeaderSearch .ant-input-search .ant-input{ .HeaderSearch .ant-input-search .ant-input{
color: #fff; color: #fff;
} }
.HeaderSearch .ant-input-search .ant-input-suffix{
background: transparent !important;
}

@ -339,7 +339,7 @@ export default class TPMchallengesnew extends Component {
} }
if(exec_time===null||exec_time===undefined||exec_time===""){ if(exec_time===null||exec_time===undefined||exec_time===""){
debugger
this.setState({ this.setState({
shixunExec_timeType:false shixunExec_timeType:false
}) })

@ -160,6 +160,8 @@ function disabledDateTime() {
// disabledSeconds: () => [0, 60], // disabledSeconds: () => [0, 60],
}; };
} }
class Newshixuns extends Component { class Newshixuns extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
@ -195,6 +197,10 @@ class Newshixuns extends Component {
testcoderunmode:undefined, testcoderunmode:undefined,
file:undefined, file:undefined,
deleteisnot:true, deleteisnot:true,
languagewritetype:false,
systemenvironmenttype:false,
testcoderunmodetype:false,
attachmentidstype:false
} }
} }
@ -514,21 +520,26 @@ class Newshixuns extends Component {
// }) // })
// } // }
if(languagewrite === undefined || languagewrite === "" ){ if(languagewrite === undefined || languagewrite === "" ){
this.props.showNotification(`请填写该镜像是基于什么语言`); // this.props.showNotification(`请填写该镜像是基于什么语言`);
this.setState({
languagewritetype:true
})
return return
} }
if(systemenvironment === undefined || systemenvironment === ""){ if(systemenvironment === undefined || systemenvironment === ""){
this.props.showNotification(`请填写该镜像是基于什么语言系统环境`); // this.props.showNotification(`请填写该镜像是基于什么语言系统环境`);
this.setState({
systemenvironmenttype:true
})
return; return;
} }
if(testcoderunmode === undefined || testcoderunmode === "") { if(testcoderunmode === undefined || testcoderunmode === "") {
this.props.showNotification(`请填写该镜像中测试代码运行方式`); // this.props.showNotification(`请填写该镜像中测试代码运行方式`);
this.setState({
testcoderunmodetype:true
})
return; return;
} }
var attachment_ids=undefined; var attachment_ids=undefined;
if (this.state.fileList) { if (this.state.fileList) {
@ -536,17 +547,20 @@ class Newshixuns extends Component {
return item.response ? item.response.id : item.id return item.response ? item.response.id : item.id
}) })
} }
debugger
if( attachment_ids === undefined || attachment_ids.length===0){
notification.open( if( attachment_ids === undefined || attachment_ids.length===0){
{
message: '提示',
description:
'请上传附件!',
} // notification.open(
) // {
// message: '提示',
// description:
// '请上传附件!',
//
// }
// )
this.setState({
attachmentidstype:true
})
return; return;
} }
// console.log("attachment_ids"+attachment_ids); // console.log("attachment_ids"+attachment_ids);
@ -939,7 +953,7 @@ class Newshixuns extends Component {
> >
{/*<Form onSubmit={this.handleSubmit}>*/} {/*<Form onSubmit={this.handleSubmit}>*/}
<div> <div>
<li className="clearfix mb15 ml85" > <li className="clearfix ml85" >
<label className="fl mt10 "><span <label className="fl mt10 "><span
className="color-red fl mt3">*</span>&nbsp;&nbsp;</label> className="color-red fl mt3">*</span>&nbsp;&nbsp;</label>
<textarea className="fl task-form-80 task-height-150" <textarea className="fl task-form-80 task-height-150"
@ -949,7 +963,8 @@ class Newshixuns extends Component {
placeholder="请填写该镜像是基于什么语言示例Python" placeholder="请填写该镜像是基于什么语言示例Python"
id="demand_info"></textarea> id="demand_info"></textarea>
</li> </li>
<li className="clearfix mb15"> <div className={"color-red shixunspanred"}>{this.state.languagewritetype===true?"请填写该镜像语言":""}</div>
<li className="clearfix">
<label className="panel-form-label fl ml50"><span <label className="panel-form-label fl ml50"><span
className="color-red fl mt3">*</span>&nbsp;&nbsp;</label> className="color-red fl mt3">*</span>&nbsp;&nbsp;</label>
<textarea className="fl task-form-80 task-height-150 " <textarea className="fl task-form-80 task-height-150 "
@ -959,8 +974,8 @@ class Newshixuns extends Component {
placeholder="请填写该镜像是基于什么linux系统环境,代码运行环境" placeholder="请填写该镜像是基于什么linux系统环境,代码运行环境"
id="demand_info"></textarea> id="demand_info"></textarea>
</li> </li>
<div className={"color-red shixunspanred"}>{this.state.systemenvironmenttype===true?"请填写该镜像语言系统环境":""}</div>
<li className="clearfix mb15"> <li className="clearfix">
<label className="fl mt10" ><span <label className="fl mt10" ><span
className="color-red fl mt3">*</span>&nbsp;&nbsp;</label> className="color-red fl mt3">*</span>&nbsp;&nbsp;</label>
@ -971,8 +986,8 @@ class Newshixuns extends Component {
placeholder="请填写该镜像中测试代码运行方式" placeholder="请填写该镜像中测试代码运行方式"
id="demand_info"></textarea> id="demand_info"></textarea>
</li> </li>
<div className={"color-red shixunspanred"}>{this.state.testcoderunmodetype===true?"请填写该镜像测试代码运行方式":""}</div>
<li className="clearfix mb15 ml50"> <li className="clearfix ml50">
<label className="panel-form-label fl mt-5"><span <label className="panel-form-label fl mt-5"><span
className="color-red fl">*</span>&nbsp;&nbsp;</label> className="color-red fl">*</span>&nbsp;&nbsp;</label>
<div className="mt10" style={{ <div className="mt10" style={{
@ -987,14 +1002,14 @@ class Newshixuns extends Component {
{ {
deleteisnot=== true? deleteisnot=== true?
<Upload {...uploadProps} > <Upload {...uploadProps} >
<Icon type="upload" className="fl mt5" > </Icon> <Icon type="upload" className="fl mt3" > </Icon>
<span className="color-blue fl">上传附件</span> <span className="color-blue fl">上传附件</span>
<span className="color-grey-c fl ml10 ">(单个文件50M以内)</span> <span className="color-grey-c fl ml10 ">(单个文件50M以内)</span>
</Upload> </Upload>
: :
<Upload {...uploadProps} disabled={true} > <Upload {...uploadProps} disabled={true} >
<Icon type="upload" className="fl mt5" > </Icon> <Icon type="upload" className="fl mt3" > </Icon>
<span className="color-grey-c fl">上传附件</span> <span className="color-grey-c fl">上传附件</span>
<span className="color-grey-c fl ml10 ">(单个文件50M以内)</span> <span className="color-grey-c fl ml10 ">(单个文件50M以内)</span>
@ -1007,6 +1022,9 @@ class Newshixuns extends Component {
</div> </div>
</li> </li>
<div className={"color-red shixunspanred"}>
{this.state.attachmentidstype===true?"请上传附件":""}
</div>
<li className="edu-txt-center clearfix "> <li className="edu-txt-center clearfix ">
<a className="pop_close task-btn mr30" <a className="pop_close task-btn mr30"
onClick={() => this.sendhideModaly()} onClick={() => this.sendhideModaly()}

@ -376,4 +376,9 @@ a.white-btn.use_scope-btn:hover{
color:#FFF !important; color:#FFF !important;
} }
.shixunspanred{
margin-left: 142px;
margin-top: 5px;
margin-bottom: 5px;
}

@ -3,9 +3,13 @@ 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 DragValidatortwo from '../../../src/common/components/DragValidatortwo'
import {Tabs, Input, Checkbox, Button, notification} from 'antd'; import {Tabs, Input, Checkbox, Button, notification} from 'antd';
import DragValidatortwo from '../../../src/common/components/DragValidatortwo'
import ReadPassword from './ReadPassword';
import axios from 'axios'; import axios from 'axios';
import './common.css' import './common.css'
@ -26,13 +30,19 @@ class LoginRegisterComponent extends Component {
seconds: 35, seconds: 35,
codes: "", codes: "",
getverificationcodes: true, getverificationcodes: true,
Phonenumberisnotco: undefined,
Phonenumberisnotcobool: false, Phonenumberisnotcobool: false,
Phonenumberisnotco: undefined,
Phonenumberisnotcosytdhk:undefined,
Phonenumberisnotcosmmm: undefined,
Phonenumberisnotcosymmmm:undefined,
Phonenumberisnotcosyzm:undefined,
s: 'text', s: 'text',
classpass: "text", classpass: "text",
readonlyInput: true, readonlyInput: true,
dragOk: false, dragOk: false,
Whethertoverify:false, Whethertoverify:false,
modalsType:false,
} }
} }
@ -148,29 +158,67 @@ class LoginRegisterComponent extends Component {
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.setState({
Phonenumberisnotco:"请输入正确的邮箱或手机号",
})
return return
} }
} }
if (this.state.login === undefined|| this.state.login.length ===0 || this.state.login === "") {
if (this.state.login === undefined || this.state.login === "") { this.setState({
this.openNotification(`请输入登录手机号码或邮箱`); Phonenumberisnotco:"账号不能为空",
})
return
}
if (this.state.dragOk === false) {
// this.openNotification(`请拖动滑块完成验证`,2);
this.setState({
Phonenumberisnotcosytdhk:"请拖动滑块完成验证",
})
return
}
if (this.state.password === undefined || this.state.password.length ===0 || this.state.password === "") {
this.setState({
Phonenumberisnotcosmmm:"密码不能为空",
})
return return
} }
if (this.state.password === undefined || this.state.password === "") { if (this.state.passwords === undefined || this.state.passwords.length ===0 || this.state.passwords === "") {
this.openNotification(`请输入密码`); this.setState({
Phonenumberisnotcosymmmm:"二次密码不能为空"
})
return return
} }
if (this.state.passwords === undefined || this.state.passwords === "") { if (this.state.password !== this.state.passwords==="") {
this.openNotification(`请输入密码`); this.openNotification(`两次输入的密码不一致`);
return return
} }
if (this.state.password !== this.state.passwords) { else if (this.state.password !==undefined&&this.state.password.length>0&&this.state.password.length<8){
this.openNotification(`两次密码不相同`); this.setState({
Phonenumberisnotcosmmm:"密码不能少于8位",
})
return
} else if (this.state.password !==undefined&&this.state.password.length>0&&this.state.password.length>16){
this.setState({
Phonenumberisnotcosmmm:"密码不能超过16位",
})
return return
} }
if (this.state.codes === undefined || this.state.codes === "") { else if (this.state.passwords !==undefined&&this.state.passwords.length>0&&this.state.passwords.length<8){
this.openNotification(`请输入验证码`); this.setState({
Phonenumberisnotcosymmmm:"二次密码不能少于8位",
})
return
} else if (this.state.passwords !==undefined&&this.state.passwords.length>0&&this.state.passwords.length>16){
this.setState({
Phonenumberisnotcosymmmm:"二次密码不能超过16位",
})
return
}
if (this.state.codes === undefined|| this.state.codes.length ===0 || this.state.codes === "") {
this.setState({
Phonenumberisnotcosyzm:"验证码不能为空"
})
return return
} }
var url = "/accounts/reset_password.json"; var url = "/accounts/reset_password.json";
@ -182,8 +230,30 @@ class LoginRegisterComponent extends Component {
}).then((result) => { }).then((result) => {
// console.log(result); // console.log(result);
//登录成功会生成session //登录成功会生成session
this.openNotification("找回密码成功,请重新登入。"); if(result){
window.location.href = "/login" if(result.data.status===-2){
if(result.data.message==="验证码不正确"){
this.setState({
Phonenumberisnotcosyzm:"验证码不正确",
})
return;
}else if(result.data.message==="验证码已失效"){
this.setState({
Phonenumberisnotcosyzm:"验证码不正确",
})
return;
}else {
this.openNotification(result.data.message);
return;
}
}else {
this.setState({
modalsType:true
})
}
}
}).catch((error) => { }).catch((error) => {
}) })
@ -227,6 +297,7 @@ class LoginRegisterComponent extends Component {
} }
this.setState({ this.setState({
password: stirngt, password: stirngt,
Phonenumberisnotcosmmm:undefined,
}) })
} }
@ -241,13 +312,15 @@ class LoginRegisterComponent extends Component {
} }
this.setState({ this.setState({
passwords: stirngt, passwords: stirngt,
Phonenumberisnotcosymmmm:undefined,
}) })
} }
//获取code //获取code
codesonChange = (e) => { codesonChange = (e) => {
this.setState({ this.setState({
codes: e.target.value codes: e.target.value,
Phonenumberisnotcosyzm:undefined,
}) })
} }
inputOnBlur = (e) => { inputOnBlur = (e) => {
@ -318,6 +391,9 @@ class LoginRegisterComponent extends Component {
}) })
return return
} }
this.setState({
Phonenumberisnotcosytdhk:undefined,
})
this.Emailphonenumberverification(this.state.login) this.Emailphonenumberverification(this.state.login)
} }
@ -360,7 +436,6 @@ class LoginRegisterComponent extends Component {
render() { render() {
const { const {
activeKey,
// 登录 // 登录
autoLogin, autoLogin,
// 注册 // 注册
@ -372,6 +447,10 @@ class LoginRegisterComponent extends Component {
seconds, seconds,
getverificationcodes, getverificationcodes,
Phonenumberisnotco, Phonenumberisnotco,
Phonenumberisnotcosytdhk,
Phonenumberisnotcosmmm,
Phonenumberisnotcosymmmm,
Phonenumberisnotcosyzm,
readonlyInput, readonlyInput,
codes, codes,
Whethertoverify, Whethertoverify,
@ -380,6 +459,11 @@ class LoginRegisterComponent extends Component {
return ( return (
<div className="login_register_content" style={{height: "520px"}}> <div className="login_register_content" style={{height: "520px"}}>
<ReadPassword
modalsType={this.state.modalsType}
StudyMakeMoney={()=>this.StudyMakeMoney()}
/>
<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"}
@ -442,11 +526,11 @@ class LoginRegisterComponent extends Component {
</style> </style>
{/*onBlur={(e) => this.inputOnBlur(e)}*/} {/*onBlur={(e) => this.inputOnBlur(e)}*/}
<Input style={loginInputsyl} type="text" autoComplete="off" onClick={this.changeTypey} <Input style={loginInputsyl} type="text" autoComplete="off" onClick={this.changeTypey}
className={"loginInputzhuche"} className={Phonenumberisnotco && Phonenumberisnotco !== "" ?" color-grey-9 loginInputzhucheyslass bor-reds":" color-grey-9 loginInputzhuche"}
placeholder="输入注册手机号或邮箱" value={this.state.login} placeholder="输入注册手机号或邮箱" value={this.state.login}
onChange={this.loginInputonChange} style={{marginTop: '10px', height: "38px"}}></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 className="fl" style={{textAlign: "left", width: " 100%"}}>{Phonenumberisnotco}</span> <span className="fl" style={{textAlign: "left", width: " 100%"}}>{Phonenumberisnotco}</span>
</p> </p>
@ -474,21 +558,43 @@ class LoginRegisterComponent extends Component {
: :
"" ""
} }
{
Phonenumberisnotcosytdhk && Phonenumberisnotcosytdhk !=="" ?
<p className="color-red mt5 mb5" style={{width: " 100%", height: "20px"}}>
<span className="fl" style={{textAlign: "left", width: " 100%"}}>{Phonenumberisnotcosytdhk}</span>
</p>
: <div style={{height: "25px"}}></div>
}
<Input type={classpass} <Input type={classpass}
className={"loginInputzhuche"} className={Phonenumberisnotcosmmm && Phonenumberisnotcosmmm !== "" ?" color-grey-9 loginInputzhucheyslass bor-reds":" color-grey-9 loginInputzhuche"}
onClick={this.changeType} autoComplete="new-password" onChange={this.loginInputonChanges} onClick={this.changeType} autoComplete="new-password" onChange={this.loginInputonChanges}
value={this.state.password} style={{width: "100%", height: "38px", marginTop: '25px'}} value={this.state.password} style={{width: "100%", height: "38px"}}
placeholder="输入8~16位密码区分大小写"></Input> placeholder="输入8~16位密码区分大小写"></Input>
{
Phonenumberisnotcosmmm && Phonenumberisnotcosmmm !== "" ?
<p className="color-red mt5 mb5" style={{width: " 100%", height: "20px"}}>
<span className="fl" style={{textAlign: "left", width: " 100%"}}>{Phonenumberisnotcosmmm}</span>
</p>
: <div style={{height: "25px"}}></div>
}
<Input type={classpass} <Input type={classpass}
className={"loginInputzhuche"} className={Phonenumberisnotcosymmmm && Phonenumberisnotcosymmmm !== "" ?" color-grey-9 loginInputzhucheyslass bor-reds":" color-grey-9 loginInputzhuche"}
onClick={this.changeType} autoComplete="new-password" onClick={this.changeType} autoComplete="new-password"
onChange={this.loginInputonChangess} value={this.state.passwords} onChange={this.loginInputonChangess} value={this.state.passwords}
style={{height: "38px", marginTop: '25px', width: "100%"}} style={{height: "38px", width: "100%"}}
placeholder="再次输入新密码"></Input> placeholder="再次输入新密码"></Input>
{
Phonenumberisnotcosymmmm && Phonenumberisnotcosymmmm !== "" ?
<p className="color-red mt5 mb5" style={{width: " 100%", height: "20px"}}>
<span className="fl" style={{textAlign: "left", width: " 100%"}}>{Phonenumberisnotcosymmmm}</span>
</p>
: <div style={{height: "25px"}}></div>
}
<div className="yslbutondls">
<div className={"mt25"}> <Input className={Phonenumberisnotcosyzm && Phonenumberisnotcosyzm !== "" ?" mr5 font-14 color-grey-9 loginInputzhucheyslass bor-reds":" mr5 font-14 color-grey-9 loginInputzhuche"}
<Input className="fl mr5 loginInputzhuche" type="text" autoComplete="off" style={{ type="text" autoComplete="off" style={{
width: "210px", width: "210px",
height: "38px", height: "38px",
}} placeholder="请输入验证码" }} placeholder="请输入验证码"
@ -498,16 +604,16 @@ class LoginRegisterComponent extends Component {
</Input> </Input>
{ {
getverificationcodes === undefined ? getverificationcodes === undefined ?
<Button className="fl ml5 " disabled <Button className=" ml5 " disabled
style={{"width": "120px", "text-align": "center", "height": "45px",}} style={{"width": "120px", "text-align": "center", "height": "45px",}}
size={"large"}>重新发送{seconds}s</Button> size={"large"}>重新发送{seconds}s</Button>
: getverificationcodes === true ? : getverificationcodes === true ?
<Button className="fl ml5 " <Button className=" ml5 "
style={{"width": "120px", "text-align": "center", "height": "45px"}} style={{"width": "120px", "text-align": "center", "height": "45px"}}
type="primary" type="primary"
onClick={() => this.getverificationcode()} size={"large"}>获取验证码</Button> onClick={() => this.getverificationcode()} size={"large"}>获取验证码</Button>
: :
<Button className="fl ml5 " <Button className=" ml5 "
style={{"width": "120px", "text-align": "center", "height": "45px"}} style={{"width": "120px", "text-align": "center", "height": "45px"}}
type="primary" type="primary"
onClick={() => this.getverificationcode()} size={"large"}>重新发送</Button> onClick={() => this.getverificationcode()} size={"large"}>重新发送</Button>
@ -516,9 +622,17 @@ class LoginRegisterComponent extends Component {
</div> </div>
<Button className="login_btn" size={"large"} type="primary" {
style={{height: "46px"}} Phonenumberisnotcosyzm && Phonenumberisnotcosyzm !== "" ?
onClick={this.Retrievepassword}>完成</Button> <p className="color-red mt5 mb5" style={{width: " 100%", height: "20px"}}>
<span className="fl" style={{textAlign: "left", width: " 100%"}}>{Phonenumberisnotcosyzm}</span>
</p>
: <div style={{height: "25px"}}></div>
}
<Button size={"large"} type="primary"
style={{height:"46px", width: "100%",marginBottom:"26px"}}
onClick={this.Retrievepassword}>完成</Button>
</div> </div>
</div> </div>

@ -1,8 +1,10 @@
import React, {Component} from 'react'; import React, {Component} from 'react';
import {Button,notification} from 'antd'; import {Button,notification} from 'antd';
import {broadcastChannelPostMessage} from 'educoder'; import {broadcastChannelPostMessage} from 'educoder';
import MyEduCoderModal from './MyEduCoderModal';
import Notcompleted from './Notcompleted';
import axios from 'axios'; import axios from 'axios';
import './common.css' import './common.css';
import mytc from './img/mytc.png'; import mytc from './img/mytc.png';
import skzbdx from './img/skzbdx.png'; import skzbdx from './img/skzbdx.png';
import zyrs1 from './img/zyrs1.png'; import zyrs1 from './img/zyrs1.png';
@ -155,6 +157,12 @@ class InterestpageComponent extends Component {
} }
setMyEduCoderModals=()=>{
this.setState({
MyEduCoderModals:true
})
}
//兴趣页面点击 //兴趣页面点击
Interestcompletionpage(){ Interestcompletionpage(){
if(this.state.gouxuans.length === 0){ if(this.state.gouxuans.length === 0){
@ -179,7 +187,8 @@ class InterestpageComponent extends Component {
}).then((response) => { }).then((response) => {
if (response !== undefined) { if (response !== undefined) {
// this.Jumptotheinterestpage(); // this.Jumptotheinterestpage();
window.location.href = "/" // window.location.href = "/"
this.setMyEduCoderModals()
} }
@ -218,6 +227,13 @@ class InterestpageComponent extends Component {
// console.log(error); // console.log(error);
// }) // })
// } // }
setNotcompleteds=()=>{
this.setState({
Notcompleteds:true,
MyEduCoderModals:false
})
}
render() { render() {
const { const {
gouxuans, gouxuans,
@ -228,6 +244,14 @@ class InterestpageComponent extends Component {
<div className="ysllogin_register_contents" style={{width:"800px",height: "600px"}}> <div className="ysllogin_register_contents" style={{width:"800px",height: "600px"}}>
<MyEduCoderModal
modalsType={this.state.MyEduCoderModals}
setNotcompleteds={()=>{this.setNotcompleteds()}}
/>
<Notcompleted
modalsType={this.state.Notcompleteds}
/>
<div className="ysllogin_section"> <div className="ysllogin_section">
<div className="mt15"><span className="yslspans1">请选择你的职业</span></div> <div className="mt15"><span className="yslspans1">请选择你的职业</span></div>
<div className="ysldivhome1" > <div className="ysldivhome1" >

@ -23,6 +23,9 @@ const loginInputsyl = {
class LoginRegisterComponent extends Component { class LoginRegisterComponent extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
//
// console.log("LoginRegisterComponent"); // console.log("LoginRegisterComponent");
// console.log("29"); // console.log("29");
// console.log(props.loginstatus); // console.log(props.loginstatus);
@ -30,7 +33,6 @@ class LoginRegisterComponent extends Component {
// console.log(props.loginstatus); // console.log(props.loginstatus);
this.state = { this.state = {
tab:["0"], tab:["0"],
activeKey: 0,
classpass: "text", classpass: "text",
// 登录 // 登录
passopens: passoff, passopens: passoff,
@ -55,6 +57,7 @@ class LoginRegisterComponent extends Component {
Phonenumberisnotcosymmm:undefined, Phonenumberisnotcosymmm:undefined,
Phonenumberisnotcosytdhk:undefined, Phonenumberisnotcosytdhk:undefined,
Phonenumberisnotcosyfwtk:undefined, Phonenumberisnotcosyfwtk:undefined,
Phonenumberisnotcodmm:undefined,
Phonenumberisnotcobool: false, Phonenumberisnotcobool: false,
Whethertoverify:false, Whethertoverify:false,
@ -64,7 +67,6 @@ class LoginRegisterComponent extends Component {
// console.log(props.loginstatus); // console.log(props.loginstatus);
this.state = { this.state = {
tab:["1"], tab:["1"],
activeKey: '1',
classpass: "text", classpass: "text",
// 登录 // 登录
passopens: passoff, passopens: passoff,
@ -90,6 +92,7 @@ class LoginRegisterComponent extends Component {
Phonenumberisnotcosytdhk:undefined, Phonenumberisnotcosytdhk:undefined,
Phonenumberisnotcosyfwtk:undefined, Phonenumberisnotcosyfwtk:undefined,
Phonenumberisnotcobool: false, Phonenumberisnotcobool: false,
Phonenumberisnotcodmm:undefined,
Whethertoverify:false, Whethertoverify:false,
} }
@ -108,12 +111,10 @@ class LoginRegisterComponent extends Component {
this.state = { this.state = {
tab:["0"], tab:["0"],
} }
this.onTabChange('0');
} else if (this.props.match.url === "/register") { } else if (this.props.match.url === "/register") {
this.state = { this.state = {
tab:["1"], tab:["1"],
} }
this.onTabChange('1');
} }
} }
@ -129,7 +130,6 @@ class LoginRegisterComponent extends Component {
} }
;
StudyMakeMoney = () => { // 调用父组件方法 StudyMakeMoney = () => { // 调用父组件方法
this.props.Setshowbool(3); this.props.Setshowbool(3);
// this.props.Setlogins(3); // this.props.Setlogins(3);
@ -143,8 +143,6 @@ class LoginRegisterComponent extends Component {
} }
onTabChange = (activeKey) => { onTabChange = (activeKey) => {
console.log("onTabChange"); console.log("onTabChange");
// console.log(activeKey);
// this.setState({activeKey})
} }
// -------------------- LOGIN START // -------------------- LOGIN START
//下次自动登入 //下次自动登入
@ -183,15 +181,6 @@ class LoginRegisterComponent extends Component {
//是否验证通过 //是否验证通过
dragOkCallback = () => { dragOkCallback = () => {
console.log(this.state.logins); console.log(this.state.logins);
if(this.state.logins===""||this.state.logins.length===0){
this.setState({
Phonenumberisnotco:"账号不能为空",
Phonenumberisnotcobool: true,
dragOk:false,
Whethertoverify:this.state.Whethertoverify===true?false:true,
})
return
}
this.Emailphonenumberverification(this.state.logins, 2) this.Emailphonenumberverification(this.state.logins, 2)
} }
@ -199,20 +188,22 @@ class LoginRegisterComponent extends Component {
//是否同意 //是否同意
onChange = (e) => { onChange = (e) => {
this.setState({ this.setState({
Agreetotheterms: e.target.checked, Agreetotheterms: e.target.checked,
Phonenumberisnotcosyfwtk:undefined,
}) })
} }
//登入接口 //登入接口
postLogin = () => { postLogin = () => {
if (this.state.login === undefined || this.state.login == "") { if (this.state.login === undefined || this.state.login == "") {
this.openNotification(`请输入登录手机号码或邮箱`,2); this.setState({
Phonenumberisnotco:"账号不能为空",
})
return return
} else if (this.state.password === undefined || this.state.password == "") { } else if (this.state.password === undefined || this.state.password == "") {
this.openNotification(`请输入密码`,2); this.setState({
Phonenumberisnotcodmm:"密码不能为空",
})
return return
} }
var url = "/accounts/login.json"; var url = "/accounts/login.json";
@ -223,6 +214,40 @@ class LoginRegisterComponent extends Component {
if (response === undefined) { if (response === undefined) {
return return
} }
if(response.data.status === -2){
if("该手机号尚未注册" || "该邮箱尚未注册"){
this.setState({
Phonenumberisnotco:response.data.message,
})
return;
}
else if("错误的账号或密码"){
this.setState({
Phonenumberisnotco:response.data.message,
})
return;
}
else if("违反平台使用规范,账号已被锁定"){
this.setState({
Phonenumberisnotco:response.data.message,
})
return;
}
else {
this.openNotification(response.data.message);
return;
}
}
if(response.data.identity === null || response.data.identity === undefined){
this.props.history.push("/interesse");
return;
}
if (response.status === 200) { if (response.status === 200) {
if (response.data.status === 402) { if (response.data.status === 402) {
window.location.href = response.data.url; window.location.href = response.data.url;
@ -244,12 +269,30 @@ class LoginRegisterComponent extends Component {
} }
//注册接口 //注册接口
postregistered = () => { postregistered = () => {
// if (this.state.logins === undefined || this.state.logins === "") {
// this.openNotification(`请输入登录手机号码或邮箱`,2);
//
// return
// } else if (this.state.dragOk === false) {
// this.openNotification(`请拖动滑块验证`,2);
// return
// } else if (this.state.codes === undefined || this.state.codes == "") {
// this.openNotification(`请输入验证码`,2);
// return
// } else if (this.state.passwords === undefined || this.state.passwords == "") {
// this.openNotification(`请输入密码`,2);
// return
// } else if (this.state.Agreetotheterms === false) {
// this.openNotification(`请同意服务协议条款`,2);
// return;
// }
if (this.state.logins === undefined || this.state.logins === ""||this.state.logins.length===0) { if (this.state.logins === undefined || this.state.logins === ""||this.state.logins.length===0) {
this.setState({ this.setState({
Phonenumberisnotcos:"账号不能为空", Phonenumberisnotcos:"账号不能为空",
}) })
return return
} else if (this.state.dragOk === false) { } else if (this.state.dragOk === false) {
// this.openNotification(`请拖动滑块完成验证`,2);
this.setState({ this.setState({
Phonenumberisnotcosytdhk:"请拖动滑块完成验证", Phonenumberisnotcosytdhk:"请拖动滑块完成验证",
}) })
@ -265,10 +308,18 @@ class LoginRegisterComponent extends Component {
Phonenumberisnotcosymmm:"密码不能为空", Phonenumberisnotcosymmm:"密码不能为空",
}) })
return return
} else if (this.state.Agreetotheterms === false) { } else if (this.state.passwords !==undefined &&this.state.passwords.length>0&&this.state.passwords.length<8){
this.setState({ this.setState({
Phonenumberisnotcosyfwtk:"请同意服务协议条款", Phonenumberisnotcosymmm:"密码不能少于8位",
}) })
return
} else if (this.state.passwords !==undefined &&this.state.passwords.length>0&&this.state.passwords.length>16){
this.setState({
Phonenumberisnotcosymmm:"密码不能超过16位",
})
return
} else if (this.state.Agreetotheterms === false) {
this.openNotification(`请同意服务协议条款`,2);
return; return;
} }
var url = "/accounts/register.json"; var url = "/accounts/register.json";
@ -279,18 +330,21 @@ class LoginRegisterComponent extends Component {
}).then((result) => { }).then((result) => {
if(result){ if(result){
if(result.data.status===-2){ if(result.data.status===-2){
if(response.data.message==="验证码不正确"){ if(result.data.message==="验证码不正确"){
this.setState({ this.setState({
Phonenumberisnotcosyzm:"验证码不正确", Phonenumberisnotcosyzm:"验证码不正确",
}) })
return; return;
}else if(response.data.message==="验证码已失效"){ }else if(result.data.message==="验证码已失效"){
this.setState({ this.setState({
Phonenumberisnotcosyzm:"验证码不正确", Phonenumberisnotcosyzm:"验证码不正确",
}) })
return; return;
}else {
this.openNotification(result.data.message);
return;
} }
}else { }else {
this.setState({ this.setState({
@ -493,6 +547,7 @@ class LoginRegisterComponent extends Component {
}else{ }else{
this.setState({ this.setState({
login: stirngt, login: stirngt,
Phonenumberisnotco:undefined,
}) })
} }
@ -514,6 +569,7 @@ class LoginRegisterComponent extends Component {
} }
this.setState({ this.setState({
password: stirngt, password: stirngt,
Phonenumberisnotcodmm:undefined,
}) })
// this.setState({ // this.setState({
// password: e.target.value // password: e.target.value
@ -597,7 +653,6 @@ class LoginRegisterComponent extends Component {
} }
render() { render() {
const { const {
activeKey,
// 登录 // 登录
autoLogin, autoLogin,
classpass, classpass,
@ -612,11 +667,10 @@ class LoginRegisterComponent extends Component {
dragOk, dragOk,
Whethertoverify, Whethertoverify,
classpassbool, classpassbool,
Phonenumberisnotcosytdhk,
Phonenumberisnotcosyzm, Phonenumberisnotcosyzm,
Phonenumberisnotcosymmm, Phonenumberisnotcosymmm,
Phonenumberisnotcosytdhk, Phonenumberisnotcodmm,
Phonenumberisnotcosyfwtk,
Phonenumberisnotcobool,
// 注册 // 注册
readAgreement, readAgreement,
} = this.state } = this.state
@ -681,7 +735,7 @@ 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"
className="font-14 color-grey-9 loginInputzhuche" className={Phonenumberisnotco && Phonenumberisnotco !== "" ?" color-grey-9 loginInputzhucheyslass bor-reds":" color-grey-9 loginInputzhuche"}
onBlur={(e) => this.inputOnBlur(e, 1)} onBlur={(e) => this.inputOnBlur(e, 1)}
style={{marginTop: '30px', height: '38px'}}></Input> style={{marginTop: '30px', height: '38px'}}></Input>
@ -695,11 +749,17 @@ class LoginRegisterComponent extends Component {
<Input type="password" name="password" id="password" 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 loginInputzhuche" className={Phonenumberisnotcodmm && Phonenumberisnotcodmm !== "" ?" color-grey-9 loginInputzhucheyslass bor-reds":" color-grey-9 loginInputzhuche"}
placeholder="密码"></Input> placeholder="密码"></Input>
{
Phonenumberisnotcodmm && Phonenumberisnotcodmm != "" ?
<p className="color-red mt5 mb5" style={{width: " 100%", height: "20px"}}>
<span className="fl" style={{textAlign:"left",width: " 100%"}}>{Phonenumberisnotcodmm}</span>
</p>
: <div style={{height:"25px"}}></div>
}
<div className="left_right mt25 font-12 " style={{color: '#676767'}}> <div className="left_right font-12 " style={{color: '#676767'}}>
<Checkbox onChange={this.onAutoLoginChange} checked={autoLogin}>下次自动登录</Checkbox> <Checkbox onChange={this.onAutoLoginChange} checked={autoLogin}>下次自动登录</Checkbox>
<a onClick={()=>this.StudyMakeMoney()} <a onClick={()=>this.StudyMakeMoney()}
@ -710,40 +770,19 @@ class LoginRegisterComponent extends Component {
size={"large"}>登录</Button> size={"large"}>登录</Button>
</div> </div>
} }
<style>
{
`
.loginInputzhuche{
width: 100%;
background-color: #fff!important;
height: 45px !important;
padding: 5px;
}
.loginInputzhuche .ant-input{
width: 100%;
background-color: #fff!important;
height: 45px !important;
padding: 5px;
position: relative;
right: 5px;
width: 103%;
}
`
}
</style>
{ {
parseInt(tab[0])==1 && parseInt(tab[0])==1 &&
<div style={{width: '340px'}}> <div style={{width: '340px'}}>
<Input className="loginInputsyl color-grey-9 loginInputzhuche" placeholder="请使用手机号/邮箱账号进行注册" <Input placeholder="请使用手机号/邮箱账号进行注册"
className={Phonenumberisnotcos && Phonenumberisnotcos !== "" ?" color-grey-9 loginInputzhucheyslass bor-reds":" color-grey-9 loginInputzhuche"}
value={this.state.logins} value={this.state.logins}
type="text" autoComplete="off" type="text" autoComplete="off"
onChange={this.loginInputonChanges} onChange={this.loginInputonChanges}
style={{marginTop: '30px' , height: '38px',color:'#999999',fontSize:"14px"}}></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" style={{textAlign:"left",width: " 100%"}}>{Phonenumberisnotcos}</span> <span className="fl" style={{textAlign:"left",width: " 100%"}}>{Phonenumberisnotcos}</span>
</p> </p>
@ -753,7 +792,7 @@ class LoginRegisterComponent extends Component {
{ {
Whethertoverify===false? Whethertoverify===false?
<DragValidator <DragValidator
height={38} className="loginInput" successGreenColor="#29bd8b" height={38} successGreenColor="#29bd8b"
style={{ height: '38px'}} style={{ height: '38px'}}
dragOkCallback={this.dragOkCallback} dragOkCallback={this.dragOkCallback}
></DragValidator> ></DragValidator>
@ -764,7 +803,7 @@ class LoginRegisterComponent extends Component {
{ {
Whethertoverify===true? Whethertoverify===true?
<DragValidatortwo <DragValidatortwo
height={38} className="loginInput" successGreenColor="#29bd8b" height={38} successGreenColor="#29bd8b"
style={{ height: '38px'}} style={{ height: '38px'}}
dragOkCallback={this.dragOkCallback} dragOkCallback={this.dragOkCallback}
></DragValidatortwo> ></DragValidatortwo>
@ -772,8 +811,8 @@ class LoginRegisterComponent extends Component {
"" ""
} }
{ {
Phonenumberisnotcosytdhk && Phonenumberisnotcosytdhk != "" ? Phonenumberisnotcosytdhk && Phonenumberisnotcosytdhk !== "" ?
<p className="color-red mt5 mb5 " style={{width: " 100%", height: "20px",textAlign:"left"}}> <p className="color-red mt5 mb5 " style={{width: " 100%", height: "20px"}}>
<span className="fl" style={{textAlign:"left",width: " 100%"}}>{Phonenumberisnotcosytdhk}</span> <span className="fl" style={{textAlign:"left",width: " 100%"}}>{Phonenumberisnotcosytdhk}</span>
</p> </p>
: <div style={{height:"25px"}}></div> : <div style={{height:"25px"}}></div>
@ -781,38 +820,44 @@ class LoginRegisterComponent extends Component {
} }
<div className=""> <div className="yslbutondls">
<Input className="fl mr5 font-14 color-grey-9 loginInputzhuche" name="codes" type="text" autoComplete="off" readonly
onfocus="this.removeAttribute('readonly')" style={{ <Input
width:'210px', className={Phonenumberisnotcosyzm && Phonenumberisnotcosyzm !== "" ?" mr5 font-14 color-grey-9 loginInputzhucheyslass bor-reds":" mr5 font-14 color-grey-9 loginInputzhuche"}
height:'38px', name="codes" type="text" autoComplete="off" readonly
}} placeholder="请输入验证码" onfocus="this.removeAttribute('readonly')" style={{
onChange={this.codesonChange} width:'210px',
value={codes} height:'38px',
> }} placeholder="请输入验证码"
</Input> onChange={this.codesonChange}
{ value={codes}
getverificationcodes === undefined ? >
<Button className="fl ml5 font-14" disabled style={{"width": "120px","text-align":"center", "height": "45px",}} </Input>
size={"large"}>重新发送{seconds}s</Button> {
: getverificationcodes === true ? getverificationcodes === undefined ?
<Button className="fl ml5 font-14" type="primary" style={{"width": "120px","text-align":"center", "height": "45px",}} <Button className=" ml5 font-14" disabled style={{"width": "120px","text-align":"center", "height": "45px",}}
onClick={() => this.getverificationcode()} size={"large"}>获取验证码</Button> size={"large"}>重新发送{seconds}s</Button>
: : getverificationcodes === true ?
<Button className="fl ml5 font-14 " type="primary" style={{"width": "120px","text-align":"center", "height": "45px",}} <Button className=" ml5 font-14" type="primary" style={{"width": "120px","text-align":"center", "height": "45px",}}
onClick={() => this.getverificationcode()} size={"large"}>重新发送</Button> onClick={() => this.getverificationcode()} size={"large"}>获取验证码</Button>
} :
<Button className=" ml5 font-14 " type="primary" style={{"width": "120px","text-align":"center", "height": "45px",}}
onClick={() => this.getverificationcode()} size={"large"}>重新发送</Button>
}
</div>
<div>
{
Phonenumberisnotcosyzm && Phonenumberisnotcosyzm !== "" ?
<p className="color-red mt5 mb5 " style={{width: " 100%", height: "20px"}}>
<span className="fl" style={{textAlign:"left",width: " 100%"}}>{Phonenumberisnotcosyzm}</span>
</p>
: <div style={{height:"25px"}}></div>
}
</div> </div>
{
Phonenumberisnotcosyzm && Phonenumberisnotcosyzm != "" ?
<p className="color-red mt5 mb5 " style={{width: " 100%", height: "20px",textAlign:"left"}}>
<span className="fl" style={{textAlign:"left",width: " 100%"}}>{Phonenumberisnotcosyzm}</span>
</p>
: <div style={{height:"25px"}}></div>
}
<style> <style>
{ {
@ -824,8 +869,9 @@ class LoginRegisterComponent extends Component {
` `
} }
</style> </style>
<Input className="loginInput font-14 color-grey-9 loginInputzhuche" placeholder="输入8~16位密码区分大小写" <Input placeholder="输入8~16位密码区分大小写"
type={classpassbool===false?"text":"password"} type={classpassbool===false?"text":"password"}
className={Phonenumberisnotcosymmm && Phonenumberisnotcosymmm !== "" ?" font-14 color-grey-9 loginInputzhucheysl ":" font-14 color-grey-9 loginInputzhuche"}
autoComplete="new-password" autoComplete="new-password"
onClick={this.changeType} onClick={this.changeType}
value={this.state.passwords} onChange={this.passwordonChanges} value={this.state.passwords} onChange={this.passwordonChanges}
@ -834,11 +880,11 @@ class LoginRegisterComponent extends Component {
</img> </img>
}></Input> }></Input>
{ {
Phonenumberisnotcosymmm && Phonenumberisnotcosymmm!== "" ? Phonenumberisnotcosymmm && Phonenumberisnotcosymmm !== "" ?
<p className="color-red mt5 mb5 " style={{width: " 100%", height: "20px",textAlign:"left"}}> <p className="color-red mt5 mb5 " style={{width: " 100%", height: "20px"}}>
<span className="fl" style={{textAlign:"left",width: " 100%"}}>{Phonenumberisnotcosymmm}</span> <span className="fl" style={{textAlign:"left",width: " 100%"}}>{Phonenumberisnotcosymmm}</span>
</p> </p>
: "" : <div style={{height:"25px"}}></div>
} }
<Checkbox onChange={this.onChange} <Checkbox onChange={this.onChange}
@ -846,15 +892,7 @@ class LoginRegisterComponent extends Component {
><span className="font-14 " style={{ ><span className="font-14 " style={{
color: '#676767', color: '#676767',
}}>我已阅读并同意服务协议条款</span></Checkbox> }}>我已阅读并同意服务协议条款</span></Checkbox>
{ <Button className=" font-16" type="primary" style={{height:"46px", width: "100%",marginTop:"26px"}} onClick={() => this.postregistered()}
Phonenumberisnotcosyfwtk && Phonenumberisnotcosyfwtk!== "" ?
<p className="color-red mt5 mb5 " style={{width: " 100%", height: "20px",textAlign:"left"}}>
<span className="fl" style={{textAlign:"left",width: " 100%"}}>{Phonenumberisnotcosyfwtk}</span>
</p>
: ""
}
<Button className="login_btn font-16" type="primary" style={{height:"46px"}} onClick={() => this.postregistered()}
size={"large"}>注册</Button> size={"large"}>注册</Button>

@ -2,7 +2,7 @@ import React, { Component } from 'react';
import {getImageUrl} from 'educoder'; import {getImageUrl} from 'educoder';
import { Modal} from 'antd'; import { Modal} from 'antd';
import axios from 'axios'; import axios from 'axios';
import 'common.css' import './common.css'
//立即申请试用 //立即申请试用
class MyEduCoderModal extends Component { class MyEduCoderModal extends Component {
@ -14,11 +14,12 @@ class MyEduCoderModal extends Component {
} }
modalCancel=()=>{ modalCancel=()=>{
//取消 window.location.href = "/"
} }
setDownload=()=>{ setDownload=()=>{
//立即联系 //立即联系
this.props.setNotcompleteds()
} }
@ -36,11 +37,12 @@ class MyEduCoderModal extends Component {
width="530px" width="530px"
> >
<div className="educouddiv"> <div className="educouddiv">
<div><p>欢迎使用EduCoder您可以试用1天</p></div> <div className={"tabeltext-alignleft mt10"}><p>欢迎使用EduCoder您可以试用1天</p></div>
<div><p>超过期限需要经过管理员的授权审核</p></div> <div className={"tabeltext-alignleft mt10"}><p>超过期限需要经过管理员的授权审核</p></div>
<div className="clearfix mt30 edu-txt-center"> <div className="clearfix mt30 edu-txt-center">
<a className="task-btn mr30" onClick={this.modalCancel()}>先试试看</a> {/*<a className="task-btn mr30" onClick={()=>this.modalCancel()}>先试试看</a>*/}
<a className="task-btn task-btn-orange" onClick={this.setDownload()}>立即申请授权</a> {/*<a className="task-btn task-btn-orange" onClick={()=>this.setDownload()}>立即申请授权</a>*/}
<a className="task-btn task-btn-orange bth100" onClick={()=>this.modalCancel()}>知道啦</a>
</div> </div>
</div> </div>
</Modal> </Modal>

@ -2,7 +2,7 @@ import React, { Component } from 'react';
import {getImageUrl} from 'educoder'; import {getImageUrl} from 'educoder';
import { Modal} from 'antd'; import { Modal} from 'antd';
import axios from 'axios'; import axios from 'axios';
import 'common.css' import './common.css';
//完善个人资料 //完善个人资料
class Notcompleted extends Component { class Notcompleted extends Component {
@ -12,11 +12,11 @@ class Notcompleted extends Component {
} }
modalCancel=()=>{ modalCancel=()=>{
//取消 window.location.href = "/";
} }
setDownload=()=>{ setDownload=()=>{
//立即联系 window.location.href ='/account/profile';
} }
@ -34,11 +34,11 @@ class Notcompleted extends Component {
width="530px" width="530px"
> >
<div className="educouddiv"> <div className="educouddiv">
<div><p>您尚未完善个人资料</p></div> <div className={"tabeltext-alignleft mt10"}><p>您尚未完善个人资料</p></div>
<div><p>请在完成资料后提交试用申请</p></div> <div className={"tabeltext-alignleft mt10"}><p>请在完成资料后提交试用申请</p></div>
<div className="clearfix mt30 edu-txt-center"> <div className="clearfix mt30 edu-txt-center">
<a className="task-btn mr30" onClick={this.modalCancel()}>取消</a> <a className="task-btn mr30" onClick={()=>this.modalCancel()}>取消</a>
<a className="task-btn task-btn-orange" onClick={this.setDownload()}>立即完善资料</a> <a className="task-btn task-btn-orange" onClick={()=>this.setDownload()}>立即完善资料</a>
</div> </div>
</div> </div>
</Modal> </Modal>

@ -2,7 +2,7 @@ import React, { Component } from 'react';
import {getImageUrl} from 'educoder'; import {getImageUrl} from 'educoder';
import { Modal} from 'antd'; import { Modal} from 'antd';
import axios from 'axios'; import axios from 'axios';
import 'common.css' import './common.css'
//密码已重置,请重新登录 //密码已重置,请重新登录
class ReadPassword extends Component { class ReadPassword extends Component {
@ -14,6 +14,7 @@ class ReadPassword extends Component {
setDownload=()=>{ setDownload=()=>{
//立即联系 //立即联系
this.props.StudyMakeMoney()
} }
@ -30,9 +31,9 @@ class ReadPassword extends Component {
visible={this.props.modalsType===undefined?false:this.props.modalsType} visible={this.props.modalsType===undefined?false:this.props.modalsType}
width="530px" width="530px"
> >
<div className="educouddiv"> <div className="educouddiv tabeltext-alignleft">
<div><p>密码已重置请重新登录</p></div> <div className={"tabeltext-alignleft mb20"}><p>密码已重置请重新登录</p></div>
<a className="task-btn task-btn-orange" onClick={this.setDownload()}>知道啦</a> <a className="task-btn task-btn-orange bth100" onClick={()=>this.setDownload()}>知道啦</a>
</div> </div>
</Modal> </Modal>
) )

@ -5,6 +5,12 @@
.login_register_content .ant-input { .login_register_content .ant-input {
background:rgb(244,244,244); background:rgb(244,244,244);
} }
.login_register_content .loginInputzhucheyslass{
border:1px solid red !important;
}
.login_register_content .loginInputzhucheyslass:hover{
border:1px solid red !important;
}
.login_register_content { .login_register_content {
width: 434px; width: 434px;
box-shadow:3px 10px 21px 0px rgba(76,76,76,0.15); box-shadow:3px 10px 21px 0px rgba(76,76,76,0.15);
@ -34,7 +40,7 @@
.educouddiv { .educouddiv {
display: flex; display: flex;
justify-content: center; flex-direction: column;
} }
@ -164,4 +170,90 @@
} }
.yslgouxuanimg2{ .yslgouxuanimg2{
height: 20px; height: 20px;
}
.yslbutondls{
display: flex;
flex-direction:row;
}
yslinpulsy input{
}
.loginInputzhuche{
width: 100%;
background-color: #fff!important;
height: 45px !important;
padding: 5px;
}
.loginInputzhucheyslass {
width: 100%;
background-color: #fff!important;
height: 45px !important;
padding: 5px;
}
.loginInputzhucheyslass .ant-input{
width: 100%;
background-color: #fff!important;
height: 45px !important;
padding: 5px;
position: relative;
right: 5px;
width: 103%;
border: 1px solid #FF0000!important;
border-radius: 4px;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
}
.loginInputzhucheyslass .ant-input:hover{
border: 1px solid #FF0000!important;
}
.loginInputzhuche .ant-input{
width: 100%;
background-color: #fff!important;
height: 45px !important;
padding: 5px;
position: relative;
right: 5px;
width: 103%;
}
.loginInputzhucheysl{
width: 100%;
background-color: #fff!important;
height: 45px !important;
padding: 5px;
border-radius: 4px;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
}
.loginInputzhucheysl .ant-input{
width: 100%;
background-color: #fff!important;
height: 45px !important;
padding: 5px;
position: relative;
right: 5px;
width: 103%;
border: 1px solid #FF0000!important;
border-radius: 4px;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
}
.loginInputzhucheysl .ant-input:hover{
border: 1px solid #FF0000!important;
}
.bth100{
width: 100px;
margin: 0 auto;
} }

@ -1,11 +1,13 @@
import React,{ Component } from "react"; import React,{ Component } from "react";
import {Checkbox,Input,Table, Pagination,Menu,Icon} from "antd"; import {Checkbox,Input,Table, Pagination,Menu,Icon} from "antd";
import {TPMIndexHOC} from "../modules/tpm/TPMIndexHOC";
import {Link,NavLink} from 'react-router-dom'; import {Link,NavLink} from 'react-router-dom';
import { WordsBtn ,ActionBtn,SnackbarHOC,markdownToHTML,getImageUrl} from 'educoder'; import { WordsBtn ,ActionBtn,SnackbarHOC,markdownToHTML,getImageUrl} from 'educoder';
const Search = Input.Search;
import axios from 'axios'; import axios from 'axios';
import './searchc.css' import './searchc.css'
import {TPMIndexHOC} from "../modules/tpm/TPMIndexHOC"; const Search = Input.Search;
class SearchPage extends Component{ class SearchPage extends Component{
constructor(props) { constructor(props) {
@ -13,20 +15,40 @@ class SearchPage extends Component{
this.state={ this.state={
tab:"0", tab:"0",
count:0, count:0,
keywords:"python", keywords:undefined,
type:"", type:"shixun",
page:1, page:1,
perpages:20, perpages:20,
data:[], data:[],
} }
} }
//切换tab //切换tab
changeTab=(e)=>{ changeTab=(e)=>{
this.setState({
tab:e.key
})
let types ="";
if(parseInt(e.key)===0){
types="shixun";
}
if(parseInt(e.key)===1){
types="subject";
}
if(parseInt(e.key)===2){
types="course";
}
if(parseInt(e.key)===3){
types="memo";
}
this.setState({
tab:e.key,
type:types,
page:1,
})
this.getdata(1,types,this.state.keywords);
} }
componentDidMount(){ componentDidMount(){
@ -39,25 +61,42 @@ class SearchPage extends Component{
// this.setState({ // this.setState({
// tab:sum, // tab:sum,
// }) // })
this.getdata(this.state.page); let courstype=decodeURI(decodeURI(this.props.location.search));
courstype = courstype.split('?value=');
this.setState({
keywords:courstype[1]
})
this.getdata(this.state.page,this.state.type,courstype[1]);
} }
setdatafuns =(value)=>{
setdatafunsval=(e)=>{
this.setState({
keywords:e.target.value
})
}
setdatafuns =(value)=>{
this.setState({
keywords:value
})
this.props.history.replace(`/search?value=${value}`)
this.getdata(this.state.page,this.state.type,value);
} }
paginationonChanges = (pageNumber) => { paginationonChanges = (pageNumber) => {
this.setState({ this.setState({
page: pageNumber, page: pageNumber,
loadingstate: true, loadingstate: true,
}) })
this.getdata(pageNumber); this.getdata(pageNumber,this.state.type,this.state.keywords);
} }
//获取数据 //获取数据
getdata=(pages)=>{ getdata=(pages,type,keywords)=>{
let url = "/search.json"; let url = "/search.json";
axios.get(url,{params:{ axios.get(url,{params:{
keyword:this.state.keywords, keyword:keywords,
type:this.state.types, type:type,
page:pages, page:pages,
per_page:this.state.perpages, per_page:this.state.perpages,
} }
@ -66,21 +105,22 @@ class SearchPage extends Component{
return return
} }
console.log("63");
console.log(response.data);
this.setState({ this.setState({
count:response.data.count, count:response.data.count,
data:response.data.results, data:response.data.results,
}) })
}).catch((error) => { }).catch((error) => {
console.log("56");
console.log(error);
}); });
} }
render(){ render(){
let {tab,count,data,page,perpages}=this.state; let {tab,count,data,page,perpages}=this.state;
console.log(tab);
return( return(
<div className="newMain clearfix"> <div className="newMain clearfix">
<div className="headersear" > <div className="headersear" >
@ -88,7 +128,9 @@ class SearchPage extends Component{
<Search <Search
style={{ width: "800px", marginTop:"53px"}} style={{ width: "800px", marginTop:"53px"}}
className="packinput" className="packinput"
value={this.state.keywords}
enterButton={<span><Icon type="search" className="mr5"/> 搜索</span>} enterButton={<span><Icon type="search" className="mr5"/> 搜索</span>}
onInput={(e)=>this.setdatafunsval(e)}
onSearch={ (value)=>this.setdatafuns(value)} /> onSearch={ (value)=>this.setdatafuns(value)} />
</div> </div>
@ -106,7 +148,7 @@ class SearchPage extends Component{
JSON.stringify(data) === "[]" ? JSON.stringify(data) === "[]" ?
<div id="forum_list" className="forum_table"> <div id="forum_list" className="forum_table">
<div className="mh650 edu-back-white"> <div className="mh650 bjyss">
<div className="edu-tab-con-box clearfix edu-txt-center"> <div className="edu-tab-con-box clearfix edu-txt-center">
<img className="edu-nodata-img mb20" src={getImageUrl("images/educoder/nodata.png")}/> <img className="edu-nodata-img mb20" src={getImageUrl("images/educoder/nodata.png")}/>
<p className="edu-nodata-p mb30">没有数据可以显示</p> <p className="edu-nodata-p mb30">没有数据可以显示</p>
@ -120,11 +162,19 @@ class SearchPage extends Component{
<p className="counttittext">共找到相关结果<span className="counttittexts">{count}</span></p> <p className="counttittext">共找到相关结果<span className="counttittexts">{count}</span></p>
</div> </div>
<div className="mainx"> <div className="mainx">
<div className="educontent project-packages-list mb30"> <div className="educontent project-packages-list mb30">
{data === undefined ? "" : data.map((item, key) => { {data === undefined ? "" : data.map((item, key) => {
return ( return (
<a key={key}
href={
item.type==="shixun"?`/shixuns/${item.identifier}/challenges`:item.type==="course"?`/courses/${item.id}/students`:item.type==="subject"?`/paths/${item.id}`:item.type==="memo"?`/forums/${item.id}`:""
}
target="_blank"
>
<div className="project-package-item"> <div className="project-package-item">
<div className={"font-16 color-dark fl "} > <div className={"font-16 color-dark fl "} >
@ -178,10 +228,14 @@ class SearchPage extends Component{
</div> </div>
<div className="mt20">
<span className="ziticor"><i className="fa fa-user ziticor"></i><span className="ml10">{item.author_name}</span></span><span className="ml10 ziticor "><span>{item.author_school_name}</span></span> <span className="ml20 ziticor"><i className="iconfont icon-shixunguanqia ziticor"></i><span>:<span className="ml10 ziticor">{item.challenges_count===undefined?0:item.challenges_count}</span></span></span> <span className="ml20 ziticor"><i className="iconfont icon-chengyuan ziticor"></i><span>:<span className="ml10 ziticor">{item.study_count===undefined?0:item.study_count}</span></span></span>
</div>
</div> </div>
</div> </div>
</a>
) )
})} })}
@ -193,9 +247,7 @@ class SearchPage extends Component{
</div> </div>
<div className="mt20">
<span></span> <span></span> <span></span>
</div>
</div> </div>
} }

@ -114,4 +114,16 @@
} }
.tzbqx{ .tzbqx{
margin-left: 24px; margin-left: 24px;
}
.bjyss{
background: #F8F8F8;
}
.zj{
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap
}
.ziticor{
color: #777777;
font-size: 13px;
} }
Loading…
Cancel
Save