| | |
| | | |
| | | state = { |
| | | card: null, |
| | | back: false |
| | | active: 'login' |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | |
| | | if (_card.wrap.link && _card.wrap.link === 'menu') { |
| | | _card.wrap.linkmenu = _card.uuid |
| | | } |
| | | _card.wrap.classify = _card.wrap.classify || 'login' |
| | | |
| | | let active = 'login' |
| | | if (_card.wrap.classify === 'signin') { |
| | | active = 'signin' |
| | | } |
| | | this.setState({ |
| | | active, |
| | | card: _card |
| | | }) |
| | | } |
| | |
| | | |
| | | card.wrap = res |
| | | |
| | | let active = 'login' |
| | | if (res.classify === 'signin') { |
| | | active = 'signin' |
| | | } |
| | | this.setState({ |
| | | active |
| | | }) |
| | | |
| | | this.updateComponent(card) |
| | | } |
| | | |
| | | render() { |
| | | const { card } = this.state |
| | | const { card, active } = this.state |
| | | let style = resetStyle(card.style) |
| | | if (card.wrap.maxWidth) { |
| | | style.maxWidth = card.wrap.maxWidth |
| | | |
| | | if (card.style.width) { |
| | | let left = style.marginLeft && style.marginLeft !== '0px' ? style.marginLeft : 'auto' |
| | | let right = style.marginRight && style.marginRight !== '0px' ? style.marginRight : 'auto' |
| | | style.margin = (style.marginTop || 0) + ' ' + right + ' ' + (style.marginBottom || 0) + ' ' + left |
| | | style.maxWidth = `calc(100% - ${style.marginLeft || '0px'} - ${style.marginRight || '0px'})` |
| | | delete style.marginLeft |
| | | delete style.marginRight |
| | | delete style.marginTop |
| | |
| | | } trigger="hover"> |
| | | <ToolOutlined /> |
| | | </Popover> |
| | | {card.wrap.loginWays ? <LoginForm wrap={card.wrap} /> : null} |
| | | {card.wrap.signWays ? <SignForm wrap={card.wrap} /> : null} |
| | | {card.wrap.loginWays && active === 'login' ? <LoginForm wrap={card.wrap} changeway={() => this.setState({active: 'signin'})}/> : null} |
| | | {card.wrap.signWays && active === 'signin' ? <SignForm wrap={card.wrap} changeway={() => this.setState({active: 'login'})}/> : null} |
| | | <div className="component-name"> |
| | | <div className="center"> |
| | | <div className="title">{card.name}</div> |