React实现页面部分:
//login.js
import React, {
Component } from 'react';
import PropTypes from 'prop-types';
import {
Button} from 'react-bootstrap';
const styles = {
zhihuLogo:{
stroke:"blue",
strokeWidth:"0",
fill:"blue",
},
titleContent:{
color:"blue",
},
loginContainer: {
textAlign: "center",
backgroundColor: "#fff",
borderRadius: "2px",
width: "400px",
height: "350px",
position: "absolute",
left: "50%",
top: "50%",
marginLeft: "-200px",
marginTop: "-200px",
},
footer: {
width: "400px",
height: "48px",
},
loginBody: {
padding: "0px 24px",
}
}
class Login extends Component {
static propTypes = {
phoneNumber: PropTypes.string.isRequired,
validateCode: PropTypes.string.isRequired,
}
static defaultProps = {
phoneNumber: '请输入合理的号码',
validateCode: '请输入验证码',
}
constructor(props) {
super(props);
this.onValidateNumChange = this.onValidateNumChange.bind(this);
this.onPhoneChange = this.onPhoneChange.bind(this);
this.state = {
phoneNumber: '',