diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js index 99884e28e..48e1af926 100644 --- a/public/react/src/modules/user/LoginRegisterComponent.js +++ b/public/react/src/modules/user/LoginRegisterComponent.js @@ -14,12 +14,12 @@ import './common.css' import './commontwo.css' const { TabPane } = Tabs; const loginInputsyl = { -"width":"434px", -"height": "462px", -"-webkit-box-shadow": "3px 10px 21px 0px rgba(76,76,76,0.15)", -"box-shadow": "3px 10px 21px 0px rgba(76,76,76,0.15)", -"border-radius": "6px", -"background": "#fff" + "width":"434px", + "height": "462px", + "-webkit-box-shadow": "3px 10px 21px 0px rgba(76,76,76,0.15)", + "box-shadow": "3px 10px 21px 0px rgba(76,76,76,0.15)", + "border-radius": "6px", + "background": "#fff" } //父组件EducoderLogin.js @@ -66,6 +66,7 @@ class LoginRegisterComponent extends Component { pciphone:true, MyEduCoderModals:false, registered:undefined, + Phonenumberisnotcodmms:undefined, } } @@ -103,13 +104,14 @@ class LoginRegisterComponent extends Component { pciphone:true, MyEduCoderModals:false, registered:undefined, + Phonenumberisnotcodmms:undefined, } } } //判断是否是手机端 - IsPC=()=> { + IsPC=()=> { var userAgentInfo = navigator.userAgent; var Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", @@ -162,7 +164,7 @@ class LoginRegisterComponent extends Component { StudyMakeMoney = () => { // 调用父组件方法 - this.props.Setshowbool(3); + // this.props.Setlogins(3); this.setState({ login: "", @@ -170,7 +172,12 @@ class LoginRegisterComponent extends Component { logins: "", passwords: "", codes: "", - }) + }); + try { + this.props.Setshowbool(3); + }catch (e) { + + } } onTabChange = (activeKey) => { console.log("onTabChange"); @@ -294,6 +301,7 @@ class LoginRegisterComponent extends Component { //登入接口 postLogin = () => { + if (this.state.login === undefined || this.state.login == "") { this.setState({ Phonenumberisnotco:"账号不能为空", @@ -310,34 +318,35 @@ class LoginRegisterComponent extends Component { login: this.state.login, password: this.state.password, }).then((response) => { + debugger 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.message==="该手机号尚未注册" || response.data.message==="该邮箱尚未注册"){ + this.setState({ + Phonenumberisnotco:response.data.message, + }) + return; + } + else if(response.data.message==="错误的账号或密码"){ + this.setState({ + Phonenumberisnotcodmms:response.data.message, + }) + return; + } + else if(response.data.message==="违反平台使用规范,账号已被锁定"){ + this.setState({ + Phonenumberisnotco:response.data.message, + }) + + return; + } + else { + this.openNotification(response.data.message); + return; + } } @@ -474,7 +483,7 @@ class LoginRegisterComponent extends Component { // }) this.setMyEduCoderModals(); } - } + } }).catch((error) => { }) @@ -495,54 +504,54 @@ class LoginRegisterComponent extends Component { // this.setState({dragOk: true}) if(result){ - if(result.data.status===-2){ - if (id === 1) { - if(result.data.message==="该手机号码或邮箱已被注册"){ - this.setState({ - Phonenumberisnotco: undefined, - Phonenumberisnotcobool: false, - dragOk:true, - }) - }else { - this.setState({ - Phonenumberisnotco: result.data.message, - Phonenumberisnotcobool: true, - dragOk:false, - Whethertoverify:this.state.Whethertoverify===true?false:true, - }) - console.log("s5"); - - } - return; - } else if (id === 2) { - this.setState({ - Phonenumberisnotcos: result.data.message, - Phonenumberisnotcobool: true, - dragOk:false, - Whethertoverify:this.state.Whethertoverify===true?false:true, - }) - console.log("s6"); - - return; - } - }else { - if (id === 1) { - this.setState({ - Phonenumberisnotco: undefined, - Phonenumberisnotcobool: false, - dragOk:true, - }) - return; - } else if (id === 2) { - this.setState({ - Phonenumberisnotcos: undefined, - Phonenumberisnotcobool: false, - dragOk:true, - }) - return; - } - } - } + if(result.data.status===-2){ + if (id === 1) { + if(result.data.message==="该手机号码或邮箱已被注册"){ + this.setState({ + Phonenumberisnotco: undefined, + Phonenumberisnotcobool: false, + dragOk:true, + }) + }else { + this.setState({ + Phonenumberisnotco: result.data.message, + Phonenumberisnotcobool: true, + dragOk:false, + Whethertoverify:this.state.Whethertoverify===true?false:true, + }) + console.log("s5"); + + } + return; + } else if (id === 2) { + this.setState({ + Phonenumberisnotcos: result.data.message, + Phonenumberisnotcobool: true, + dragOk:false, + Whethertoverify:this.state.Whethertoverify===true?false:true, + }) + console.log("s6"); + + return; + } + }else { + if (id === 1) { + this.setState({ + Phonenumberisnotco: undefined, + Phonenumberisnotcobool: false, + dragOk:true, + }) + return; + } else if (id === 2) { + this.setState({ + Phonenumberisnotcos: undefined, + Phonenumberisnotcobool: false, + dragOk:true, + }) + return; + } + } + } }).catch((error) => { @@ -603,12 +612,12 @@ class LoginRegisterComponent extends Component { }) return; } - if(this.state.pciphone===true) { - if (this.state.dragOk === false) { - this.openNotification("拖动滑块验证"); - return; - } - } + if(this.state.pciphone===true) { + if (this.state.dragOk === false) { + this.openNotification("拖动滑块验证"); + return; + } + } if (this.state.getverificationcodes === true) { this.setState({ @@ -666,12 +675,14 @@ class LoginRegisterComponent extends Component { this.setState({ Phonenumberisnotco: undefined, Phonenumberisnotcobool: false, + Phonenumberisnotcodmms:undefined, login: stirngt, }) }else{ this.setState({ login: stirngt, Phonenumberisnotco:undefined, + Phonenumberisnotcodmms:undefined, }) } @@ -681,61 +692,61 @@ class LoginRegisterComponent extends Component { this.Emailphonenumberverification(e.target.value, 1); } inputOnBlurzhuche = (e, id) => { - if (e.target.value.length === 0) { - this.setState({ - Phonenumberisnotcos: undefined, - Phonenumberisnotcobool: false, - }) - return; - } - // var telephone = $("#telephoneAdd.tianjia_phone").val(); - var regph = /^[1][3,4,5,6,7,8][0-9]{9}$/; - // var email = $("#add_email.tianjia_email").val(); - var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; - - // [1]手机号开头必须是1 [3,4,5,6,7,8] 第二位是3-8中的一个 [0-9]{9} 后边9位可以是0-9的任意数字。 - var stringdata = undefined; - if (!regph.test(e.target.value)) { - stringdata = "手机号格式不正确"; - this.setState({ - Phonenumberisnotcos: stringdata, - Phonenumberisnotcobool: true, - dragOk:false, - Whethertoverify:this.state.Whethertoverify===true?false:true, - }) - } else { - this.setState({ - Phonenumberisnotcos: undefined, - Phonenumberisnotcobool: false, + if (e.target.value.length === 0) { + this.setState({ + Phonenumberisnotcos: undefined, + Phonenumberisnotcobool: false, + }) + return; + } + // var telephone = $("#telephoneAdd.tianjia_phone").val(); + var regph = /^[1][3,4,5,6,7,8][0-9]{9}$/; + // var email = $("#add_email.tianjia_email").val(); + var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; - }) - return - } + // [1]手机号开头必须是1 [3,4,5,6,7,8] 第二位是3-8中的一个 [0-9]{9} 后边9位可以是0-9的任意数字。 + var stringdata = undefined; + if (!regph.test(e.target.value)) { + stringdata = "手机号格式不正确"; + this.setState({ + Phonenumberisnotcos: stringdata, + Phonenumberisnotcobool: true, + dragOk:false, + Whethertoverify:this.state.Whethertoverify===true?false:true, + }) + } else { + this.setState({ + Phonenumberisnotcos: undefined, + Phonenumberisnotcobool: false, - if (!regemail.test(e.target.value)) { - if ((e.target.value.indexOf("@") != -1) === true) { - stringdata = "邮箱格式不正确"; - } else { - stringdata = "手机号格式不正确"; + }) + return + } - } - this.setState({ - Phonenumberisnotcos: stringdata, - Phonenumberisnotcobool: true, - dragOk:false, - Whethertoverify:this.state.Whethertoverify===true?false:true, - }) - return + if (!regemail.test(e.target.value)) { + if ((e.target.value.indexOf("@") != -1) === true) { + stringdata = "邮箱格式不正确"; } else { - this.setState({ - Phonenumberisnotcos: undefined, - Phonenumberisnotcobool: false, + stringdata = "手机号格式不正确"; - }) - this.Emailphonenumberverification(e.target.value, id); - return } + this.setState({ + Phonenumberisnotcos: stringdata, + Phonenumberisnotcobool: true, + dragOk:false, + Whethertoverify:this.state.Whethertoverify===true?false:true, + }) + return + } else { + this.setState({ + Phonenumberisnotcos: undefined, + Phonenumberisnotcobool: false, + + }) this.Emailphonenumberverification(e.target.value, id); + return + } + this.Emailphonenumberverification(e.target.value, id); } //获取登入密码 passwordonChange = (e) => { @@ -750,6 +761,7 @@ class LoginRegisterComponent extends Component { this.setState({ password: stirngt, Phonenumberisnotcodmm:undefined, + Phonenumberisnotcodmms:undefined, }) // this.setState({ // password: e.target.value @@ -759,28 +771,28 @@ class LoginRegisterComponent extends Component { loginInputonChanges = (e) => { console.log(e.target.value); var stirngt; - if(e.target.value.length>0){ - var str= e.target.value.replace(/\s*/g,"") - stirngt=str; - }else{ - stirngt= e.target.value; - } - if (e.target.value.length === 0) { - this.setState({ - Phonenumberisnotcos: undefined, - Phonenumberisnotcobool: false, - logins: stirngt, - dragOk:false, - Whethertoverify:this.state.Whethertoverify===true?false:true, - }) - }else{ - this.setState({ - logins: stirngt, - Phonenumberisnotcos: undefined, - dragOk:false, - Whethertoverify:this.state.Whethertoverify===true?false:true, - }) - } + if(e.target.value.length>0){ + var str= e.target.value.replace(/\s*/g,"") + stirngt=str; + }else{ + stirngt= e.target.value; + } + if (e.target.value.length === 0) { + this.setState({ + Phonenumberisnotcos: undefined, + Phonenumberisnotcobool: false, + logins: stirngt, + dragOk:false, + Whethertoverify:this.state.Whethertoverify===true?false:true, + }) + }else{ + this.setState({ + logins: stirngt, + Phonenumberisnotcos: undefined, + dragOk:false, + Whethertoverify:this.state.Whethertoverify===true?false:true, + }) + } } //获取注册密码 @@ -810,7 +822,7 @@ class LoginRegisterComponent extends Component { this.setState({ tab:e.key }) - console.log(e.key); + console.log(e.key); if(e.key === 0){ this.setState({ Phonenumberisnotcos:undefined @@ -868,6 +880,7 @@ class LoginRegisterComponent extends Component { // 注册 readAgreement, pciphone, + Phonenumberisnotcodmms, } = this.state // height: 346px; if (this.state.seconds === 0) { @@ -877,30 +890,30 @@ class LoginRegisterComponent extends Component { console.log(classpass); return ( -
- - -
- - 登录 - 注册 - - - { - parseInt(tab[0])==0 && -
- + +
+ + 登录 + 注册 + + + { + parseInt(tab[0])==0 && +
+ - - this.inputOnBlur(e, 1)} - style={{marginTop: '30px', height: '38px'}}> - - { - Phonenumberisnotco && Phonenumberisnotco != "" ? -

- {Phonenumberisnotco} -

- :
- } - - - { - Phonenumberisnotcodmm && Phonenumberisnotcodmm != "" ? -

- {Phonenumberisnotcodmm} -

- :
- } - - - - -
- } - - - { - parseInt(tab[0])==1 && -
- this.inputOnBlurzhuche(e, 2)} - style={{marginTop: '30px' , height: '38px',color:'#999999',fontSize:"14px"}}> - { - Phonenumberisnotcos && Phonenumberisnotcos !== "" ? -

- {Phonenumberisnotcos} -

- :
+ } + + + this.inputOnBlur(e, 1)} + style={{marginTop: '30px', height: '38px'}}> + + { + Phonenumberisnotco && Phonenumberisnotco != "" ? +

+ {Phonenumberisnotco} +

+ :
+ } + + + { + Phonenumberisnotcodmm && Phonenumberisnotcodmm != "" ? +

+ {Phonenumberisnotcodmm} +

+ : (Phonenumberisnotcodmms=== undefined?
:"") + } + { + Phonenumberisnotcodmms && Phonenumberisnotcodmms != "" ? +

+ {Phonenumberisnotcodmms} +

+ : "" + } + + + + +
+ } + + + { + parseInt(tab[0])==1 && +
+ this.inputOnBlurzhuche(e, 2)} + style={{marginTop: '30px' , height: '38px',color:'#999999',fontSize:"14px"}}> + { + Phonenumberisnotcos && Phonenumberisnotcos !== "" ? +

+ {Phonenumberisnotcos} +

+ :
+ + } + {this.state.MyEduCoderModals===true? {this.setNotcompleteds()}} + />:""} + + { + Whethertoverify===false&&pciphone===true? + + + : + "" - } - {this.state.MyEduCoderModals===true? {this.setNotcompleteds()}} - />:""} - - { - Whethertoverify===false&&pciphone===true? - - - : - "" - - } - { - Whethertoverify===true&&pciphone===true? - - + } + { + Whethertoverify===true&&pciphone===true? + + : "" - } + } -
- { - pciphone===true? - ( - Phonenumberisnotcosytdhk && Phonenumberisnotcosytdhk !== "" ? +
+ { + pciphone===true? + ( + Phonenumberisnotcosytdhk && Phonenumberisnotcosytdhk !== "" ?

{Phonenumberisnotcosytdhk}

:
- ) - :"" - } -
- - - -
- - - - { - getverificationcodes === undefined ? - - : getverificationcodes === true ? - - : - - } - -
-
- { - Phonenumberisnotcosyzm && Phonenumberisnotcosyzm !== "" ? -

- {Phonenumberisnotcosyzm} -

- :
+ ) + :"" + } +
+ + + +
+ + + + { + getverificationcodes === undefined ? + + : getverificationcodes === true ? + + : + + } + +
+
+ { + Phonenumberisnotcosyzm && Phonenumberisnotcosyzm !== "" ? +

+ {Phonenumberisnotcosyzm} +

+ :
- } -
+ } +
- - this.Showandhide(key)}> - - }> - { - Phonenumberisnotcosymmm && Phonenumberisnotcosymmm !== "" ? -

- {Phonenumberisnotcosymmm} -

- :
- - } - 我已阅读并同意 + } + + this.Showandhide(key)}> + + }> + { + Phonenumberisnotcosymmm && Phonenumberisnotcosymmm !== "" ? +

+ {Phonenumberisnotcosymmm} +

+ :
+ + } + 我已阅读并同意 《服务协议条款》 - + -
- } -
-
+
+ } +
+ ); } }