|
|
|
@ -94,14 +94,14 @@ class LoginRegisterComponent extends Component {
|
|
|
|
|
}
|
|
|
|
|
//倒计时
|
|
|
|
|
getverificationcode = () => {
|
|
|
|
|
|
|
|
|
|
debugger
|
|
|
|
|
if(this.state.login === undefined || this.state.login.length===0){
|
|
|
|
|
this.openNotification("请输入手机号或邮箱");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//这是判断是否手机正确
|
|
|
|
|
if(this.state.Phonenumberisnotcobool === true){
|
|
|
|
|
if(this.state.Phonenumberisnotcobool === false){
|
|
|
|
|
this.openNotification(this.state.Phonenumberisnotco);
|
|
|
|
|
this.setState({
|
|
|
|
|
Whethertoverify:this.state.Whethertoverify===true?false:true,
|
|
|
|
@ -109,7 +109,7 @@ class LoginRegisterComponent extends Component {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
//拖动滑动验证
|
|
|
|
|
if(this.state.dragOk===undefined||this.state.dragOk === false){
|
|
|
|
|
if(this.state.dragOk === false){
|
|
|
|
|
this.openNotification("拖动滑块验证");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -180,12 +180,11 @@ class LoginRegisterComponent extends Component {
|
|
|
|
|
//找回密码
|
|
|
|
|
Retrievepassword = () => {
|
|
|
|
|
if (this.state.Phonenumberisnotcobool === false) {
|
|
|
|
|
if (this.state.login.length === 0) {
|
|
|
|
|
this.openNotification(this.state.Phonenumberisnotco);
|
|
|
|
|
this.setState({
|
|
|
|
|
Phonenumberisnotco:"请输入正确的邮箱或手机号",
|
|
|
|
|
Whethertoverify:this.state.Whethertoverify===true?false:true,
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (this.state.login === undefined|| this.state.login.length ===0 || this.state.login === "") {
|
|
|
|
|
this.setState({
|
|
|
|
@ -365,7 +364,7 @@ class LoginRegisterComponent extends Component {
|
|
|
|
|
if (value.length === 0) {
|
|
|
|
|
this.setState({
|
|
|
|
|
Phonenumberisnotco: undefined,
|
|
|
|
|
Phonenumberisnotcobool: false,
|
|
|
|
|
Phonenumberisnotcobool: true,
|
|
|
|
|
})
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -418,20 +417,20 @@ class LoginRegisterComponent extends Component {
|
|
|
|
|
if(this.state.login===""||this.state.login.length===0){
|
|
|
|
|
this.setState({
|
|
|
|
|
Phonenumberisnotco: "账号不能为空",
|
|
|
|
|
Phonenumberisnotcobool: true,
|
|
|
|
|
Phonenumberisnotcobool: false,
|
|
|
|
|
dragOk:false,
|
|
|
|
|
Whethertoverify:this.state.Whethertoverify===true?false:true,
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
console.log(e.target.value.length);
|
|
|
|
|
if (e.target.value.length === 0) {
|
|
|
|
|
this.setState({
|
|
|
|
|
Phonenumberisnotco: undefined,
|
|
|
|
|
Phonenumberisnotcobool: false,
|
|
|
|
|
})
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// console.log(e.target.value.length);
|
|
|
|
|
// if (e.target.value.length === 0) {
|
|
|
|
|
// this.setState({
|
|
|
|
|
// Phonenumberisnotco: 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();
|
|
|
|
@ -485,12 +484,63 @@ class LoginRegisterComponent extends Component {
|
|
|
|
|
if (this.state.login === "" || this.state.login.length === 0) {
|
|
|
|
|
this.setState({
|
|
|
|
|
Phonenumberisnotco: "账号不能为空",
|
|
|
|
|
Phonenumberisnotcobool: true,
|
|
|
|
|
Phonenumberisnotcobool: false,
|
|
|
|
|
dragOk: false,
|
|
|
|
|
Whethertoverify: this.state.Whethertoverify === true ? false : true,
|
|
|
|
|
})
|
|
|
|
|
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(this.state.login)) {
|
|
|
|
|
stringdata = "手机号格式不正确";
|
|
|
|
|
this.setState({
|
|
|
|
|
Phonenumberisnotco: stringdata,
|
|
|
|
|
Phonenumberisnotcobool: false,
|
|
|
|
|
dragOk:false,
|
|
|
|
|
Whethertoverify: this.state.Whethertoverify === true ? false : true,
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
this.setState({
|
|
|
|
|
Phonenumberisnotco: undefined,
|
|
|
|
|
Phonenumberisnotcobool: true,
|
|
|
|
|
dragOk: true,
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
this.Emailphonenumberverification(this.state.login)
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!regemail.test(this.state.login)) {
|
|
|
|
|
if ((this.state.login.indexOf("@") != -1) === true) {
|
|
|
|
|
stringdata = "邮箱格式不正确";
|
|
|
|
|
} else {
|
|
|
|
|
stringdata = "手机号格式不正确";
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
this.setState({
|
|
|
|
|
Phonenumberisnotco: stringdata,
|
|
|
|
|
Phonenumberisnotcobool: false,
|
|
|
|
|
dragOk:false,
|
|
|
|
|
Whethertoverify: this.state.Whethertoverify === true ? false : true,
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
} else {
|
|
|
|
|
this.setState({
|
|
|
|
|
Phonenumberisnotco: undefined,
|
|
|
|
|
Phonenumberisnotcobool: true,
|
|
|
|
|
dragOk: true,
|
|
|
|
|
})
|
|
|
|
|
this.Emailphonenumberverification(this.state.login)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
Phonenumberisnotcosytdhk: undefined,
|
|
|
|
|
})
|
|
|
|
@ -513,7 +563,7 @@ class LoginRegisterComponent extends Component {
|
|
|
|
|
console.log(value.length);
|
|
|
|
|
this.setState({
|
|
|
|
|
Phonenumberisnotco: result.data.message,
|
|
|
|
|
Phonenumberisnotcobool: true,
|
|
|
|
|
Phonenumberisnotcobool: false,
|
|
|
|
|
dragOk:false,
|
|
|
|
|
Whethertoverify:this.state.Whethertoverify===true?false:true,
|
|
|
|
|
})
|
|
|
|
@ -521,7 +571,7 @@ class LoginRegisterComponent extends Component {
|
|
|
|
|
}else {
|
|
|
|
|
this.setState({
|
|
|
|
|
Phonenumberisnotco: undefined,
|
|
|
|
|
Phonenumberisnotcobool: false,
|
|
|
|
|
Phonenumberisnotcobool: true,
|
|
|
|
|
dragOk:true,
|
|
|
|
|
})
|
|
|
|
|
return;
|
|
|
|
|