dev_forum
杨树林 5 years ago
parent dd55ea86c1
commit 413b29ed1a

@ -110,6 +110,11 @@ const CoursesIndex = Loadable({
loader: () => import('./modules/courses/Index'),
loading: Loading,
})
const SearchPage = Loadable({
loader: () => import('./search/SearchPage'),
loading: Loading,
})
// 课堂讨论
// const BoardIndex = Loadable({
// loader: () => import('./modules/courses/boards/BoardIndex'),
@ -328,9 +333,10 @@ class App extends Component {
{/*实训课程(原实训路径)*/}
<Route path="/paths" component={ShixunPaths}></Route>
<Route path="/search" component={SearchPage} ></Route>
{/*课堂*/}
<Route path="/courses" component={CoursesIndex} {...this.props}></Route>
{/* 课堂讨论 */}
{/* <Route path="/board" component = {BoardIndex} {...this.props}></Route> */}
@ -340,6 +346,7 @@ class App extends Component {
{/* <Route path="/myshixuns/:shixunId/stages/:stageId" component={Index}/> */}
{/* 兴趣页面*/}
{/*<Route path="/interest" component={Interestpage}/>*/}
<Route path="/comment" component={CommentComponent}/>
<Route path="/testMaterial" component={TestMaterialDesignComponent}/>
<Route path="/test" component={TestIndex}/>

@ -309,6 +309,15 @@ class LoginRegisterComponent extends Component {
//是否验证通过
dragOkCallback = () => {
console.log(this.state.login);
if(this.state.login===""||this.state.login.length===0){
this.setState({
Phonenumberisnotco: "账号不能为空",
Phonenumberisnotcobool: true,
dragOk:false,
Whethertoverify:this.state.Whethertoverify===true?false:true,
})
return
}
this.Emailphonenumberverification(this.state.login)
}

@ -51,6 +51,10 @@ class LoginRegisterComponent extends Component {
codes: "",
Phonenumberisnotco: undefined,
Phonenumberisnotcos: undefined,
Phonenumberisnotcosyzm:undefined,
Phonenumberisnotcosymmm:undefined,
Phonenumberisnotcosytdhk:undefined,
Phonenumberisnotcosyfwtk:undefined,
Phonenumberisnotcobool: false,
Whethertoverify:false,
@ -81,6 +85,10 @@ class LoginRegisterComponent extends Component {
codes: "",
Phonenumberisnotco: undefined,
Phonenumberisnotcos: undefined,
Phonenumberisnotcosyzm:undefined,
Phonenumberisnotcosymmm:undefined,
Phonenumberisnotcosytdhk:undefined,
Phonenumberisnotcosyfwtk:undefined,
Phonenumberisnotcobool: false,
Whethertoverify:false,
@ -175,6 +183,15 @@ 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)
}
@ -182,8 +199,10 @@ class LoginRegisterComponent extends Component {
//是否同意
onChange = (e) => {
this.setState({
Agreetotheterms: e.target.checked,
Phonenumberisnotcosyfwtk:undefined,
})
}
@ -225,21 +244,31 @@ class LoginRegisterComponent extends Component {
}
//注册接口
postregistered = () => {
if (this.state.logins === undefined || this.state.logins === "") {
this.openNotification(`请输入登录手机号码或邮箱`,2);
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:"请拖动滑块完成验证",
})
return
} else if (this.state.codes === undefined || this.state.codes == "") {
this.openNotification(`请输入验证码`,2);
} else if (this.state.codes === undefined || this.state.codes == ""||this.state.codes.length===0) {
// this.openNotification(`请输入验证码`,2);
this.setState({
Phonenumberisnotcosyzm:"验证码不能为空",
})
return
} else if (this.state.passwords === undefined || this.state.passwords == "") {
this.openNotification(`请输入密码`,2);
} else if (this.state.passwords === undefined || this.state.passwords == "" ||this.state.passwords.length===0) {
this.setState({
Phonenumberisnotcosymmm:"密码不能为空",
})
return
} else if (this.state.Agreetotheterms === false) {
this.openNotification(`请同意服务协议条款`,2);
this.setState({
Phonenumberisnotcosyfwtk:"请同意服务协议条款",
})
return;
}
var url = "/accounts/register.json";
@ -249,14 +278,30 @@ class LoginRegisterComponent extends Component {
code: this.state.codes,
}).then((result) => {
if(result){
if(result.data.status===-2){
if(response.data.message==="验证码不正确"){
this.setState({
Phonenumberisnotcosyzm:"验证码不正确",
})
return;
}else if(response.data.message==="验证码已失效"){
this.setState({
logins: "",
dragOk: false,
codes: "",
passwords: "",
Agreetotheterms: "",
Phonenumberisnotcosyzm:"验证码不正确",
})
this.props.history.push("/interesse");
return;
}
}else {
this.setState({
logins: "",
dragOk: false,
codes: "",
passwords: "",
Agreetotheterms: "",
})
this.props.history.push("/interesse");
}
}
}).catch((error) => {
@ -514,12 +559,14 @@ class LoginRegisterComponent extends Component {
}
this.setState({
passwords: stirngt,
Phonenumberisnotcosymmm:undefined,
})
}
//获取code
codesonChange = (e) => {
this.setState({
codes: e.target.value
codes: e.target.value,
Phonenumberisnotcosyzm:undefined,
})
}
//切换tab
@ -565,6 +612,11 @@ class LoginRegisterComponent extends Component {
dragOk,
Whethertoverify,
classpassbool,
Phonenumberisnotcosyzm,
Phonenumberisnotcosymmm,
Phonenumberisnotcosytdhk,
Phonenumberisnotcosyfwtk,
Phonenumberisnotcobool,
// 注册
readAgreement,
} = this.state
@ -687,6 +739,7 @@ class LoginRegisterComponent extends Component {
<Input className="loginInputsyl color-grey-9 loginInputzhuche" placeholder="请使用手机号/邮箱账号进行注册"
value={this.state.logins}
type="text" autoComplete="off"
onChange={this.loginInputonChanges}
style={{marginTop: '30px' , height: '38px',color:'#999999',fontSize:"14px"}}></Input>
{
@ -718,10 +771,17 @@ class LoginRegisterComponent extends Component {
:
""
}
{
Phonenumberisnotcosytdhk && Phonenumberisnotcosytdhk != "" ?
<p className="color-red mt5 mb5 " style={{width: " 100%", height: "20px",textAlign:"left"}}>
<span className="fl" style={{textAlign:"left",width: " 100%"}}>{Phonenumberisnotcosytdhk}</span>
</p>
: <div style={{height:"25px"}}></div>
}
<div className="mt25">
<div className="">
<Input className="fl mr5 font-14 color-grey-9 loginInputzhuche" name="codes" type="text" autoComplete="off" readonly
onfocus="this.removeAttribute('readonly')" style={{
width:'210px',
@ -745,6 +805,14 @@ class LoginRegisterComponent extends Component {
</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>
{
@ -756,9 +824,8 @@ class LoginRegisterComponent extends Component {
`
}
</style>
<Input className="loginInput font-14 mt25 color-grey-9 loginInputzhuche" placeholder="输入8~16位密码区分大小写"
<Input className="loginInput font-14 color-grey-9 loginInputzhuche" placeholder="输入8~16位密码区分大小写"
type={classpassbool===false?"text":"password"}
autoComplete="new-password"
onClick={this.changeType}
value={this.state.passwords} onChange={this.passwordonChanges}
@ -766,11 +833,27 @@ class LoginRegisterComponent extends Component {
<img className={"mt5"} src={passopens} onClick={(key) => this.Showandhide(key)}>
</img>
}></Input>
{
Phonenumberisnotcosymmm && Phonenumberisnotcosymmm!== "" ?
<p className="color-red mt5 mb5 " style={{width: " 100%", height: "20px",textAlign:"left"}}>
<span className="fl" style={{textAlign:"left",width: " 100%"}}>{Phonenumberisnotcosymmm}</span>
</p>
: ""
}
<Checkbox onChange={this.onChange}
value={Agreetotheterms}
><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()}
size={"large"}>注册</Button>

@ -0,0 +1,82 @@
import React,{ Component } from "react";
import {Checkbox,Input,Table, Pagination,Menu,Icon} from "antd";
import {Link,NavLink} from 'react-router-dom';
import { WordsBtn ,ActionBtn,SnackbarHOC} from 'educoder';
const Search = Input.Search;
import axios from 'axios';
import './searchc.css'
import {TPMIndexHOC} from "../modules/tpm/TPMIndexHOC";
class SearchPage extends Component{
constructor(props) {
super(props);
this.state={
tab:"0",
count:0,
}
}
//切换tab
changeTab=(e)=>{
this.setState({
tab:e.key
})
}
componentDidMount(){
// const query =this.props.location.search;
// const type = query.split('?tab=');
// let sum = []
// sum.push(type[1])
// // console.log("componentDidMountcomponentDidMount");
// // console.log(sum);
// this.setState({
// tab:sum,
// })
}
setdatafuns =(value)=>{
}
render(){
let {tab,count}=this.state;
console.log(tab);
return(
<div className="newMain clearfix">
<div className="headersear" >
<div style={{height:"53px"}}></div>
<Search
style={{ width: "800px", marginTop:"53px"}}
className="packinput"
enterButton={<span><Icon type="search" className="mr5"/> 搜索</span>}
onSearch={ (value)=>this.setdatafuns(value)} />
</div>
<div className="tabtitle">
<Menu mode="horizontal" className="tabtitless" selectedKeys={tab} onClick={this.changeTab}>
<Menu.Item className={"tabtitle1"} key="0">开发社区</Menu.Item>
<Menu.Item className={"tabtitle2"} key="1">实践课程</Menu.Item>
<Menu.Item className={"tabtitle2"} key="2">翻转课堂</Menu.Item>
<Menu.Item className={"tabtitle2"} key="3">交流问答</Menu.Item>
</Menu>
</div>
<div className="counttit">
<p className="counttittext">共找到相关结果<span className="counttittexts">{count}</span></p>
</div>
<div className="mainx">
</div>
</div>
)
}
}
export default SnackbarHOC() (TPMIndexHOC ( SearchPage ));

@ -0,0 +1,74 @@
.searchinput{
width: 800px;
margin-top: 53px;
}
.headersear{
height: 160px;
background: #EAF2F9;
display: flex;
justify-content: center;
}
.packinput .ant-input{
height: 55px;
width:663px !important;
font-size: 18px;
color: #681616 !important;
border-color: #E1EDF8 !important;
}
.packinput .ant-input-group-addon .ant-btn{
width:137px !important;
font-size: 18px;
height: 53px;
background:rgba(76,172,255,1);
}
.tabtitle{
width: 100% !important;
height: 62px !important;
box-shadow: 3px 10px 21px 0px rgba(76, 76, 76, 0.15);
border-radius: 6px;
background: #fff;
background: rgb(244, 244, 244);
}
.tabtitless{
height: 62px !important;
line-height: 62px !important;
}
.tabtitle1{
margin-left: 181px !important;
}
.tabtitle2{
margin-left: 90px !important;
}
.counttit{
width: 130px;
height: 18px;
}
.counttittext{
width: 130px;
height: 18px;
color: #888888;
font-size: 13px;
margin-top: 24px;
padding-bottom: 17px;
margin-left: 343px;
}
.counttittexts{
color: #4CACFF !important;
font-size: 13px;
}
.mainx{
display: flex;
justify-content: center;
}
Loading…
Cancel
Save