|
|
@ -402,6 +402,7 @@ class LoginRegisterComponent extends Component {
|
|
|
|
type: 1,
|
|
|
|
type: 1,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}).then((result) => {
|
|
|
|
}).then((result) => {
|
|
|
|
|
|
|
|
debugger
|
|
|
|
//验证有问题{"status":1,"message":"success"}
|
|
|
|
//验证有问题{"status":1,"message":"success"}
|
|
|
|
// console.log(result);
|
|
|
|
// console.log(result);
|
|
|
|
// this.setState({dragOk: true})
|
|
|
|
// this.setState({dragOk: true})
|
|
|
@ -409,12 +410,12 @@ class LoginRegisterComponent extends Component {
|
|
|
|
if(result){
|
|
|
|
if(result){
|
|
|
|
if(result.data.status===-2){
|
|
|
|
if(result.data.status===-2){
|
|
|
|
if (id === 1) {
|
|
|
|
if (id === 1) {
|
|
|
|
console.log(value.length);
|
|
|
|
|
|
|
|
if(result.data.message==="该手机号码或邮箱已被注册"){
|
|
|
|
if(result.data.message==="该手机号码或邮箱已被注册"){
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
Phonenumberisnotco: undefined,
|
|
|
|
Phonenumberisnotco: undefined,
|
|
|
|
Phonenumberisnotcobool: false,
|
|
|
|
Phonenumberisnotcobool: false,
|
|
|
|
dragOk:true,
|
|
|
|
dragOk:true,
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}else {
|
|
|
|
}else {
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
@ -436,7 +437,6 @@ class LoginRegisterComponent extends Component {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}else {
|
|
|
|
}else {
|
|
|
|
if (id === 1) {
|
|
|
|
if (id === 1) {
|
|
|
|
console.log(value.length);
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
Phonenumberisnotco: undefined,
|
|
|
|
Phonenumberisnotco: undefined,
|
|
|
|
Phonenumberisnotcobool: false,
|
|
|
|
Phonenumberisnotcobool: false,
|
|
|
@ -585,13 +585,116 @@ class LoginRegisterComponent extends Component {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//失去焦点判断
|
|
|
|
//失去焦点判断
|
|
|
|
inputOnBlur = (e, id) => {
|
|
|
|
inputOnBlur = (e, id) => {
|
|
|
|
this.isCorrectname(e.target.value, id);
|
|
|
|
// this.isCorrectname(e.target.value, id);
|
|
|
|
// this.Emailphonenumberverification(e.target.value, id);
|
|
|
|
// this.Emailphonenumberverification(e.target.value, id);
|
|
|
|
|
|
|
|
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();
|
|
|
|
|
|
|
|
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({
|
|
|
|
|
|
|
|
Phonenumberisnotco: stringdata,
|
|
|
|
|
|
|
|
Phonenumberisnotcobool: true,
|
|
|
|
|
|
|
|
dragOk:false,
|
|
|
|
|
|
|
|
Whethertoverify:this.state.Whethertoverify===true?false:true,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
Phonenumberisnotco: undefined,
|
|
|
|
|
|
|
|
Phonenumberisnotcobool: false,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!regemail.test(e.target.value)) {
|
|
|
|
|
|
|
|
if ((e.target.value.indexOf("@") != -1) === true) {
|
|
|
|
|
|
|
|
stringdata = "邮箱格式不正确";
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
stringdata = "手机号格式不正确";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
Phonenumberisnotco: stringdata,
|
|
|
|
|
|
|
|
Phonenumberisnotcobool: true,
|
|
|
|
|
|
|
|
dragOk:false,
|
|
|
|
|
|
|
|
Whethertoverify:this.state.Whethertoverify===true?false:true,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
Phonenumberisnotco: undefined,
|
|
|
|
|
|
|
|
Phonenumberisnotcobool: false,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
this.Emailphonenumberverification(e.target.value, 1);
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
this.Emailphonenumberverification(e.target.value, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
inputOnBlurzhuche = (e, id) => {
|
|
|
|
inputOnBlurzhuche = (e, id) => {
|
|
|
|
if(this.state.pciphone===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]+$/;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// [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,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!regemail.test(e.target.value)) {
|
|
|
|
|
|
|
|
if ((e.target.value.indexOf("@") != -1) === true) {
|
|
|
|
|
|
|
|
stringdata = "邮箱格式不正确";
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
stringdata = "手机号格式不正确";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
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);
|
|
|
|
this.Emailphonenumberverification(e.target.value, id);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//获取登入密码
|
|
|
|
//获取登入密码
|
|
|
|
passwordonChange = (e) => {
|
|
|
|
passwordonChange = (e) => {
|
|
|
|