king
8 小时以前 b09b821ef36fd1ea979e9a5daa98e95732ac81d5
src/pc/components/login/normal-login/loginform.jsx
@@ -12,7 +12,8 @@
class LoginTabForm extends Component {
  static propTpyes = {
    wrap: PropTypes.object
    wrap: PropTypes.object,
    changeway: PropTypes.func
  }
  state = {
@@ -32,22 +33,27 @@
        loginWays.push({
          type: 'sms_vcode',
          label: '短信登录',
          tempId: wrap.tempId
          tempId: wrap.tempId,
          sort: 2
        })
      } else if (way === 'uname_pwd') {
        loginWays.push({
          type: 'uname_pwd',
          label: '账号登录',
          shortcut: wrap.shortcut
          shortcut: wrap.shortcut,
          sort: 1
        })
      } else if (way === 'app_scan') {
        scanWay = {
          type: 'app_scan',
          label: '扫码登录'
          label: '扫码登录',
          sort: 3
        }
        loginWays.push(scanWay)
      }
    })
    loginWays.sort((a, b) => a.sort - b.sort)
    this.setState({
      loginWays: loginWays,
@@ -67,22 +73,26 @@
          loginWays.push({
            type: 'sms_vcode',
            label: '短信登录',
            tempId: wrap.tempId
            tempId: wrap.tempId,
            sort: 2
          })
        } else if (way === 'uname_pwd') {
          loginWays.push({
            type: 'uname_pwd',
            label: '账号登录',
            shortcut: wrap.shortcut
            shortcut: wrap.shortcut,
            sort: 1
          })
        } else if (way === 'app_scan') {
          scanWay = {
            type: 'app_scan',
            label: '扫码登录'
            label: '扫码登录',
            sort: 3
          }
          loginWays.push(scanWay)
        }
      })
      loginWays.sort((a, b) => a.sort - b.sort)
      this.setState({
        loginWays: loginWays,
@@ -126,22 +136,28 @@
  }
  render() {
    const { wrap } = this.props
    const { activeWay, loginWays, scanWay } = this.state
    let style = {}
    if (wrap.borderRadius) {
      style.borderRadius = wrap.borderRadius
    }
    return (
      <Form className="login-edit-form">
        <div className="login-way-title">{activeWay.label}</div>
        {wrap.topTip !== 'hidden' ? <div className="login-way-title">{activeWay.label}</div> : null}
        {scanWay && activeWay.type !== 'app_scan' ? <div className="scan-icon" onClick={() => this.onChangeTab(scanWay)}><QrcodeOutlined /></div> : null}
        {activeWay.type === 'uname_pwd' ? <div className={'form-item-wrap ' + (activeWay.shortcut === 'none' ? 'no-short' : '')}>
          <Form.Item>
            <Input
              prefix={<UserOutlined style={{ color: 'rgba(0,0,0,.25)' }} />}
              placeholder="用户名"
              placeholder="用户名/手机号/邮箱"
              autoComplete="off"
            />
          </Form.Item>
          <Form.Item>
            <Input.Password placeholder="密码" prefix={<LockOutlined style={{ color: 'rgba(0,0,0,.25)' }} />} />
            <Input.Password placeholder="密码" visibilityToggle={wrap.vispwd !== 'false'} prefix={<LockOutlined style={{ color: 'rgba(0,0,0,.25)' }} />} />
          </Form.Item>
          {!activeWay.shortcut || activeWay.shortcut === 'remember' ? <Form.Item className="minline">
            <Checkbox>记住密码</Checkbox>
@@ -150,7 +166,7 @@
            <Checkbox>自动登录</Checkbox>
          </Form.Item> : null}
          <Form.Item className="btn-login">
            <Button type="primary" onDoubleClick={() => this.changeMenu()} className="login-form-button">
            <Button type="primary" style={style} onDoubleClick={() => this.changeMenu()} className="login-form-button">
              登录
            </Button>
          </Form.Item>
@@ -174,7 +190,7 @@
            />
          </Form.Item>
          <Form.Item className="btn-login">
            <Button type="primary" onDoubleClick={() => this.changeMenu()} className="login-form-button">
            <Button type="primary" style={style} onDoubleClick={() => this.changeMenu()} className="login-form-button">
              登录
            </Button>
          </Form.Item>
@@ -185,9 +201,7 @@
          </div>
          请使用客户端扫一扫登录
        </div> : null}
        {/* {wrap.protocol === 'true' ? <div className={'protocol-wrap '}>
          <Checkbox>{wrap.tip}</Checkbox>{wrap.groups.map((item, i) => (<span className="protocol" key={i}>《{item.label}》</span>))}
        </div> : null} */}
        {wrap.classify !== 'login' ? <span className="mk-jump-way" onClick={() => this.props.changeway()}>没有账号,去注册?</span> : null}
        <div className={'login-ways ' + (activeWay.type === 'app_scan' ? 'center' : '')}>
          {loginWays.map(item => {
            if (item.type === 'app_scan' || activeWay.type === item.type) return null