dev_forum
杨树林 5 years ago
parent a662b5f153
commit f2bac17de2

@ -23,6 +23,9 @@ const loginInputsyl = {
class LoginRegisterComponent extends Component { class LoginRegisterComponent extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
//
// console.log("LoginRegisterComponent"); // console.log("LoginRegisterComponent");
// console.log("29"); // console.log("29");
// console.log(props.loginstatus); // console.log(props.loginstatus);
@ -183,15 +186,6 @@ class LoginRegisterComponent extends Component {
//是否验证通过 //是否验证通过
dragOkCallback = () => { dragOkCallback = () => {
console.log(this.state.logins); 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) this.Emailphonenumberverification(this.state.logins, 2)
} }
@ -199,10 +193,8 @@ class LoginRegisterComponent extends Component {
//是否同意 //是否同意
onChange = (e) => { onChange = (e) => {
this.setState({ this.setState({
Agreetotheterms: e.target.checked, Agreetotheterms: e.target.checked,
Phonenumberisnotcosyfwtk:undefined,
}) })
} }
@ -244,12 +236,30 @@ class LoginRegisterComponent extends Component {
} }
//注册接口 //注册接口
postregistered = () => { 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) { if (this.state.logins === undefined || this.state.logins === ""||this.state.logins.length===0) {
this.setState({ this.setState({
Phonenumberisnotcos:"账号不能为空", Phonenumberisnotcos:"账号不能为空",
}) })
return return
} else if (this.state.dragOk === false) { } else if (this.state.dragOk === false) {
// this.openNotification(`请拖动滑块完成验证`,2);
this.setState({ this.setState({
Phonenumberisnotcosytdhk:"请拖动滑块完成验证", Phonenumberisnotcosytdhk:"请拖动滑块完成验证",
}) })
@ -266,9 +276,7 @@ class LoginRegisterComponent extends Component {
}) })
return return
} else if (this.state.Agreetotheterms === false) { } else if (this.state.Agreetotheterms === false) {
this.setState({ this.openNotification(`请同意服务协议条款`,2);
Phonenumberisnotcosyfwtk:"请同意服务协议条款",
})
return; return;
} }
var url = "/accounts/register.json"; var url = "/accounts/register.json";
@ -284,13 +292,13 @@ class LoginRegisterComponent extends Component {
Phonenumberisnotcosyzm:"验证码不正确", Phonenumberisnotcosyzm:"验证码不正确",
}) })
return; return;
}else if(result.data.message==="验证码已失效"){ }else if(result.data.message==="验证码已失效"){
this.setState({ this.setState({
Phonenumberisnotcosyzm:"验证码不正确", Phonenumberisnotcosyzm:"验证码不正确",
}) })
return; return;
} }
}else { }else {
this.setState({ this.setState({
@ -612,11 +620,9 @@ class LoginRegisterComponent extends Component {
dragOk, dragOk,
Whethertoverify, Whethertoverify,
classpassbool, classpassbool,
Phonenumberisnotcosytdhk,
Phonenumberisnotcosyzm, Phonenumberisnotcosyzm,
Phonenumberisnotcosymmm, Phonenumberisnotcosymmm,
Phonenumberisnotcosytdhk,
Phonenumberisnotcosyfwtk,
Phonenumberisnotcobool,
// 注册 // 注册
readAgreement, readAgreement,
} = this.state } = this.state
@ -710,40 +716,19 @@ class LoginRegisterComponent extends Component {
size={"large"}>登录</Button> size={"large"}>登录</Button>
</div> </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 && parseInt(tab[0])==1 &&
<div style={{width: '340px'}}> <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} value={this.state.logins}
type="text" autoComplete="off" type="text" autoComplete="off"
onChange={this.loginInputonChanges} onChange={this.loginInputonChanges}
style={{marginTop: '30px' , height: '38px',color:'#999999',fontSize:"14px"}}></Input> 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"}}> <p className="color-red mt5 mb5 " style={{width: " 100%", height: "20px"}}>
<span className="fl" style={{textAlign:"left",width: " 100%"}}>{Phonenumberisnotcos}</span> <span className="fl" style={{textAlign:"left",width: " 100%"}}>{Phonenumberisnotcos}</span>
</p> </p>
@ -753,7 +738,7 @@ class LoginRegisterComponent extends Component {
{ {
Whethertoverify===false? Whethertoverify===false?
<DragValidator <DragValidator
height={38} className="loginInput" successGreenColor="#29bd8b" height={38} successGreenColor="#29bd8b"
style={{ height: '38px'}} style={{ height: '38px'}}
dragOkCallback={this.dragOkCallback} dragOkCallback={this.dragOkCallback}
></DragValidator> ></DragValidator>
@ -764,7 +749,7 @@ class LoginRegisterComponent extends Component {
{ {
Whethertoverify===true? Whethertoverify===true?
<DragValidatortwo <DragValidatortwo
height={38} className="loginInput" successGreenColor="#29bd8b" height={38} successGreenColor="#29bd8b"
style={{ height: '38px'}} style={{ height: '38px'}}
dragOkCallback={this.dragOkCallback} dragOkCallback={this.dragOkCallback}
></DragValidatortwo> ></DragValidatortwo>
@ -772,8 +757,8 @@ class LoginRegisterComponent extends Component {
"" ""
} }
{ {
Phonenumberisnotcosytdhk && Phonenumberisnotcosytdhk != "" ? Phonenumberisnotcosytdhk && Phonenumberisnotcosytdhk !== "" ?
<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%"}}>{Phonenumberisnotcosytdhk}</span> <span className="fl" style={{textAlign:"left",width: " 100%"}}>{Phonenumberisnotcosytdhk}</span>
</p> </p>
: <div style={{height:"25px"}}></div> : <div style={{height:"25px"}}></div>
@ -781,38 +766,44 @@ class LoginRegisterComponent extends Component {
} }
<div className=""> <div className="yslbutondls">
<Input className="fl mr5 font-14 color-grey-9 loginInputzhuche" name="codes" type="text" autoComplete="off" readonly
onfocus="this.removeAttribute('readonly')" style={{ <Input
width:'210px', className={Phonenumberisnotcosyzm && Phonenumberisnotcosyzm !== "" ?" mr5 font-14 color-grey-9 loginInputzhucheyslass bor-reds":" mr5 font-14 color-grey-9 loginInputzhuche"}
height:'38px', name="codes" type="text" autoComplete="off" readonly
}} placeholder="请输入验证码" onfocus="this.removeAttribute('readonly')" style={{
onChange={this.codesonChange} width:'210px',
value={codes} height:'38px',
> }} placeholder="请输入验证码"
</Input> onChange={this.codesonChange}
{ value={codes}
getverificationcodes === undefined ? >
<Button className="fl ml5 font-14" disabled style={{"width": "120px","text-align":"center", "height": "45px",}} </Input>
size={"large"}>重新发送{seconds}s</Button> {
: getverificationcodes === true ? getverificationcodes === undefined ?
<Button className="fl ml5 font-14" type="primary" style={{"width": "120px","text-align":"center", "height": "45px",}} <Button className=" ml5 font-14" disabled style={{"width": "120px","text-align":"center", "height": "45px",}}
onClick={() => this.getverificationcode()} size={"large"}>获取验证码</Button> 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> onClick={() => this.getverificationcode()} size={"large"}>获取验证码</Button>
} :
<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"}}>
<span className="fl" style={{textAlign:"left",width: " 100%"}}>{Phonenumberisnotcosyzm}</span>
</p>
: <div style={{height:"25px"}}></div>
}
</div> </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> <style>
{ {
@ -824,8 +815,9 @@ class LoginRegisterComponent extends Component {
` `
} }
</style> </style>
<Input className="loginInput font-14 color-grey-9 loginInputzhuche" placeholder="输入8~16位密码区分大小写" <Input placeholder="输入8~16位密码区分大小写"
type={classpassbool===false?"text":"password"} type={classpassbool===false?"text":"password"}
className={Phonenumberisnotcosymmm && Phonenumberisnotcosymmm !== "" ?" font-14 color-grey-9 loginInputzhucheysl ":" font-14 color-grey-9 loginInputzhuche"}
autoComplete="new-password" autoComplete="new-password"
onClick={this.changeType} onClick={this.changeType}
value={this.state.passwords} onChange={this.passwordonChanges} value={this.state.passwords} onChange={this.passwordonChanges}
@ -834,11 +826,11 @@ class LoginRegisterComponent extends Component {
</img> </img>
}></Input> }></Input>
{ {
Phonenumberisnotcosymmm && Phonenumberisnotcosymmm!== "" ? 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> <span className="fl" style={{textAlign:"left",width: " 100%"}}>{Phonenumberisnotcosymmm}</span>
</p> </p>
: "" : <div style={{height:"25px"}}></div>
} }
<Checkbox onChange={this.onChange} <Checkbox onChange={this.onChange}
@ -846,15 +838,7 @@ class LoginRegisterComponent extends Component {
><span className="font-14 " style={{ ><span className="font-14 " style={{
color: '#676767', color: '#676767',
}}>我已阅读并同意服务协议条款</span></Checkbox> }}>我已阅读并同意服务协议条款</span></Checkbox>
{ <Button className=" font-16" type="primary" style={{height:"46px", width: "100%",marginTop: "26px",}} onClick={() => this.postregistered()}
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> size={"large"}>注册</Button>

@ -164,4 +164,85 @@
} }
.yslgouxuanimg2{ .yslgouxuanimg2{
height: 20px; 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;
} }
Loading…
Cancel
Save