hjm 5 years ago
commit 9bde68b284

@ -333,7 +333,13 @@ class App extends Component {
{/*实训课程(原实训路径)*/}
<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>

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

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

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

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

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

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

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

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

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

@ -40,6 +40,8 @@ class CoursesNew extends Component {
}
componentDidMount() {
let coursesId = this.props.match.params.coursesId;
let user_school=this.props.current_user&&this.props.current_user.user_school;
@ -85,7 +87,13 @@ class CoursesNew extends Component {
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) => {
if(dateString===""){
this.setState({

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

@ -71,7 +71,7 @@ class PollDetailTabThird extends Component{
<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>
{ 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">
{
item.question.min_choices == item.question.max_choices ? "可选"+item.question.max_choices+"项" :

@ -382,7 +382,7 @@ class PollInfo extends Component{
<div className="pl30 pr30 mt30 mb10 clearfix">
<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.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">
{
item.question.min_choices == item.question.max_choices ? "可选"+item.question.max_choices+"项" :

@ -69,11 +69,8 @@ class EducoderInteresse extends Component {
display: "flex",
justifyContent: "center",
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>

@ -72,7 +72,8 @@ class EducoderLogin extends Component {
showbool: 3,
logini:3,
namezh:"",
passmm:""
passmm:"",
loginstatus:true,
}
}else {
if(props.match.url === "/login"){
@ -98,8 +99,8 @@ class EducoderLogin extends Component {
showbool: 1,
logini:1,
namezh:"",
passmm:""
passmm:"",
loginstatus:true,
}
}
@ -156,13 +157,12 @@ class EducoderLogin extends Component {
display: "flex",
justifyContent: "center",
width: "100%",
height: "550px",
marginTop: "44px",
marginTop: "25px",
}}>
<div>
<LoginRegisterComponent {...this.props} {...this.state}
Setshowbool={(e,name,pass)=>this.Setshowbool(e,name,pass)} ></LoginRegisterComponent>
Setshowbool={(e)=>this.Setshowbool(e)} ></LoginRegisterComponent>
</div>
@ -172,8 +172,7 @@ class EducoderLogin extends Component {
display: "flex",
justifyContent: "center",
width: "100%",
height: "550px",
marginTop: "44px",
marginTop: "25px",
}}>
<div >
<FindPasswordComponent {...this.props} {...this.state}
@ -186,11 +185,8 @@ class EducoderLogin extends Component {
display: "flex",
justifyContent: "center",
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>

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

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

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

@ -188,3 +188,7 @@ body>.-task-title {
.HeaderSearch .ant-input-search .ant-input{
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===""){
debugger
this.setState({
shixunExec_timeType:false
})

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

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

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

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

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

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

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

@ -5,6 +5,12 @@
.login_register_content .ant-input {
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 {
width: 434px;
box-shadow:3px 10px 21px 0px rgba(76,76,76,0.15);
@ -34,7 +40,7 @@
.educouddiv {
display: flex;
justify-content: center;
flex-direction: column;
}
@ -165,3 +171,89 @@
.yslgouxuanimg2{
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 {Checkbox,Input,Table, Pagination,Menu,Icon} from "antd";
import {TPMIndexHOC} from "../modules/tpm/TPMIndexHOC";
import {Link,NavLink} from 'react-router-dom';
import { WordsBtn ,ActionBtn,SnackbarHOC,markdownToHTML,getImageUrl} from 'educoder';
const Search = Input.Search;
import axios from 'axios';
import './searchc.css'
import {TPMIndexHOC} from "../modules/tpm/TPMIndexHOC";
const Search = Input.Search;
class SearchPage extends Component{
constructor(props) {
@ -13,20 +15,40 @@ class SearchPage extends Component{
this.state={
tab:"0",
count:0,
keywords:"python",
type:"",
keywords:undefined,
type:"shixun",
page:1,
perpages:20,
data:[],
}
}
//切换tab
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(){
@ -39,25 +61,42 @@ class SearchPage extends Component{
// this.setState({
// 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) => {
this.setState({
page: pageNumber,
loadingstate: true,
})
this.getdata(pageNumber);
this.getdata(pageNumber,this.state.type,this.state.keywords);
}
//获取数据
getdata=(pages)=>{
getdata=(pages,type,keywords)=>{
let url = "/search.json";
axios.get(url,{params:{
keyword:this.state.keywords,
type:this.state.types,
keyword:keywords,
type:type,
page:pages,
per_page:this.state.perpages,
}
@ -66,21 +105,22 @@ class SearchPage extends Component{
return
}
console.log("63");
console.log(response.data);
this.setState({
count:response.data.count,
data:response.data.results,
})
}).catch((error) => {
console.log("56");
console.log(error);
});
}
render(){
let {tab,count,data,page,perpages}=this.state;
console.log(tab);
return(
<div className="newMain clearfix">
<div className="headersear" >
@ -88,7 +128,9 @@ class SearchPage extends Component{
<Search
style={{ width: "800px", marginTop:"53px"}}
className="packinput"
value={this.state.keywords}
enterButton={<span><Icon type="search" className="mr5"/> 搜索</span>}
onInput={(e)=>this.setdatafunsval(e)}
onSearch={ (value)=>this.setdatafuns(value)} />
</div>
@ -106,7 +148,7 @@ class SearchPage extends Component{
JSON.stringify(data) === "[]" ?
<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">
<img className="edu-nodata-img mb20" src={getImageUrl("images/educoder/nodata.png")}/>
<p className="edu-nodata-p mb30">没有数据可以显示</p>
@ -120,11 +162,19 @@ class SearchPage extends Component{
<p className="counttittext">共找到相关结果<span className="counttittexts">{count}</span></p>
</div>
<div className="mainx">
<div className="educontent project-packages-list mb30">
{data === undefined ? "" : data.map((item, key) => {
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={"font-16 color-dark fl "} >
@ -178,10 +228,14 @@ class SearchPage extends Component{
</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>
</a>
)
})}
@ -193,9 +247,7 @@ class SearchPage extends Component{
</div>
<div className="mt20">
<span></span> <span></span> <span></span>
</div>
</div>
}

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