loginContent.jsx 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import React from 'react';
  2. import { Icon, Tabs, Spin } from 'antd';
  3. import LoginForm from './loginForm.jsx';
  4. import loginqq from '../../../image/login_qq.png';
  5. import loginweixin from '../../../image/login_weixin.png';
  6. import loginweibo from '../../../image/login_weibo.png';
  7. import loginmore from '../../../image/login_more.png';
  8. import './login.less';
  9. const TabPane = Tabs.TabPane;
  10. const LoginContent = React.createClass({
  11. getInitialState() {
  12. return {
  13. theKey: "0",
  14. loading: false
  15. };
  16. },
  17. tabChange(key) {
  18. this.setState({
  19. theKey: key
  20. })
  21. },
  22. spinChange(e) {
  23. this.setState({
  24. loading: e
  25. });
  26. },
  27. componentWillMount() {
  28. if (window.location.search === "?1") {
  29. this.state.theKey = '1'
  30. }
  31. },
  32. render() {
  33. return (
  34. <div className="content clearfix">
  35. <div className="login-left">
  36. <img src="" alt="" />
  37. </div>
  38. <div className="login-right">
  39. <Spin spinning={this.state.loading} className='spin-box'>
  40. <Tabs defaultActiveKey={this.state.theKey} onChange={this.tabChange} className="login-from">
  41. <TabPane tab="个人登录" key="0">
  42. <LoginForm loginProp={this.state.theKey} spinState={this.spinChange} />
  43. </TabPane>
  44. <TabPane tab="公司登录" key="1" className="tabtwo">
  45. <LoginForm loginProp={this.state.theKey} spinState={this.spinChange} />
  46. </TabPane>
  47. </Tabs>
  48. <div className="login-other clearfix">
  49. <ul className="clearfix">
  50. <li style={{ 'display': 'none' }}><img src={loginqq} alt="" /><p>QQ</p></li>
  51. <li style={{ 'display': 'none' }}><img src={loginweixin} alt="" /><p>微信</p></li>
  52. <li style={{ 'display': 'none' }}><img src={loginweibo} alt="" /><p>微博</p></li>
  53. <li className="join"><img src={loginmore} alt="" /><p><a href="./signIn.html">立即注册</a></p></li>
  54. </ul>
  55. </div>
  56. </Spin>
  57. </div>
  58. </div>
  59. )
  60. }
  61. });
  62. export default LoginContent;