| | |
| | | { |
| | | "appId": "201912040924165801464FF1788654BC5AC73", |
| | | "appkey": "20191106103859640976D6E924E464D029CF0", |
| | | "appId": "202108312122504607B107A83F55B40C98CCF", |
| | | "appkey": "20210831212235413F287EC3BF489424496C8", |
| | | "mainSystemApi": "http://sso.mk9h.cn/cloud/webapi/dostars", |
| | | "systemType": "", |
| | | "externalDatabase": "false", |
| | | "lineColor": "", |
| | | "filter": "false", |
| | | "defaultApp": "mk", |
| | | "defaultApp": "mkindustry", |
| | | "defaultLang": "zh-CN", |
| | | "WXAppID": "", |
| | | "WXminiAppID": "", |
| | |
| | | "probation": "", |
| | | "keepPassword": "true", |
| | | "platforms": ["H5", "wechat", "android", "ios", "wxMiniProgram"], |
| | | "host": "http://qingqiumarket.cn", |
| | | "service": "MKWMS/" |
| | | "host": "http://demo.mk9h.cn", |
| | | "service": "erp_new/" |
| | | } |
| | |
| | | |
| | | 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> |
| | |
| | | background-repeat: no-repeat; |
| | | background-size: cover; |
| | | min-height: 100px; |
| | | max-width: 100%; |
| | | |
| | | .card-control { |
| | | position: absolute; |
| | |
| | | .ant-form-item:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | .mk-jump-way { |
| | | cursor: pointer; |
| | | float: right; |
| | | color: #1890ff; |
| | | margin-bottom: 15px; |
| | | } |
| | | } |
| | | .login-way-title { |
| | | font-size: 18px; |
| | |
| | | .protocol-wrap { |
| | | padding: 0 20px 15px; |
| | | span { |
| | | font-size: 13px; |
| | | font-size: 12px; |
| | | } |
| | | .ant-checkbox + span { |
| | | padding-right: 0px; |
| | | } |
| | | .protocol { |
| | | color: #1890ff; |
| | |
| | | } |
| | | .login-ways.center { |
| | | text-align: center; |
| | | } |
| | | .sign-ways { |
| | | clear: both; |
| | | text-align: center; |
| | | margin-top: 25px; |
| | | .title { |
| | | color: #959595; |
| | | display: flex; |
| | | padding: 0 15%; |
| | | } |
| | | .title::before, .title::after { |
| | | display: inline-block; |
| | | content: ' '; |
| | | height: 0.5px; |
| | | flex: 1; |
| | | background-color: rgba(0, 0, 0, 0.15); |
| | | position: relative; |
| | | top: 12px; |
| | | } |
| | | .title::before { |
| | | margin: 0 25px 0 0; |
| | | } |
| | | .title::after { |
| | | margin: 0 0 0 25px; |
| | | } |
| | | .content { |
| | | display: flex; |
| | | .item { |
| | | flex: 1; |
| | | cursor: pointer; |
| | | padding-top: 10px; |
| | | .anticon { |
| | | font-size: 20px; |
| | | width: 40px; |
| | | height: 40px; |
| | | line-height: 45px; |
| | | border-radius: 40px; |
| | | background: #e6f7ff; |
| | | color: #1890ff; |
| | | } |
| | | .name { |
| | | color: #000000; |
| | | display: block; |
| | | margin-top: 10px; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | .form-scan-wrap { |
| | |
| | | |
| | | .mk-mob-view .login-edit-box { |
| | | display: block; |
| | | // .login-way-wrap.simple { |
| | | // display: none; |
| | | // } |
| | | .login-way-wrap { |
| | | padding: 0 15px; |
| | | border-radius: 0; |
| | |
| | | border: 0; |
| | | border-radius: 0; |
| | | } |
| | | .protocol-wrap { |
| | | span { |
| | | font-size: 13px; |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | class LoginTabForm extends Component { |
| | | static propTpyes = { |
| | | wrap: PropTypes.object |
| | | wrap: PropTypes.object, |
| | | changeway: PropTypes.func |
| | | } |
| | | |
| | | state = { |
| | |
| | | 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, |
| | |
| | | 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, |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { wrap } = this.props |
| | | const { activeWay, loginWays, scanWay } = this.state |
| | | |
| | | return ( |
| | |
| | | </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 |
| | |
| | | precision: 0, |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'number', |
| | | field: 'maxWidth', |
| | | label: '最大宽度', |
| | | initval: wrap.maxWidth || '', |
| | | tooltip: '登录框的最大宽度值。', |
| | | min: 100, |
| | | max: 2000, |
| | | precision: 0, |
| | | required: false |
| | | }, |
| | | // { |
| | | // type: 'number', |
| | | // field: 'maxWidth', |
| | | // label: '最大宽度', |
| | | // initval: wrap.maxWidth || '', |
| | | // tooltip: '登录框的最大宽度值。', |
| | | // min: 100, |
| | | // max: 2000, |
| | | // precision: 0, |
| | | // required: false |
| | | // }, |
| | | { |
| | | type: 'styleInput', |
| | | field: 'height', |
| | |
| | | field: 'signWays', |
| | | label: '注册方式', |
| | | initval: wrap.signWays || [], |
| | | tooltip: '微信授权只在小程序中有效。', |
| | | required: true, |
| | | options: [ |
| | | { label: '账号', value: 'uname_pwd' }, |
| | |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Form, Input, Button, notification, Checkbox } from 'antd' |
| | | import { UserOutlined, LockOutlined } from '@ant-design/icons' |
| | | import { UserOutlined, LockOutlined, MobileOutlined, WechatOutlined } from '@ant-design/icons' |
| | | |
| | | import MKEmitter from '@/utils/events.js' |
| | | import './index.scss' |
| | | |
| | | class LoginTabForm extends Component { |
| | | static propTpyes = { |
| | | wrap: PropTypes.object |
| | | wrap: PropTypes.object, |
| | | changeway: PropTypes.func |
| | | } |
| | | |
| | | state = { |
| | | activeWay: null, |
| | | appType: sessionStorage.getItem('appType'), |
| | | signWays: [] |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { wrap } = this.props |
| | | |
| | | let signWays = [] |
| | | wrap.signWays.forEach(way => { |
| | | if (way === 'sms_vcode') { |
| | | signWays.push({ |
| | | type: 'sms_vcode', |
| | | label: '手机号注册', |
| | | icon: <MobileOutlined />, |
| | | tempId: wrap.signTempId, |
| | | sort: 2 |
| | | }) |
| | | } else if (way === 'uname_pwd') { |
| | | signWays.push({ |
| | | type: 'uname_pwd', |
| | | label: '账号注册', |
| | | icon: <LockOutlined />, |
| | | sort: 1 |
| | | }) |
| | | } else if (way === 'weixin') { |
| | | signWays.push({ |
| | | type: 'weixin', |
| | | label: '微信登录', |
| | | icon: <WechatOutlined />, |
| | | sort: 3 |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | signWays.sort((a, b) => a.sort - b.sort) |
| | | |
| | | this.setState({ |
| | | signWays: wrap.signWays, |
| | | activeWay: wrap.signWays[0] |
| | | signWays: signWays, |
| | | activeWay: signWays[0] |
| | | }) |
| | | } |
| | | |
| | |
| | | const { wrap } = this.props |
| | | |
| | | if (!is(fromJS(wrap), fromJS(nextProps.wrap))) { |
| | | let signWays = [] |
| | | nextProps.wrap.signWays.forEach(way => { |
| | | if (way === 'sms_vcode') { |
| | | signWays.push({ |
| | | type: 'sms_vcode', |
| | | label: '手机号注册', |
| | | tempId: nextProps.wrap.signTempId, |
| | | sort: 2 |
| | | }) |
| | | } else if (way === 'uname_pwd') { |
| | | signWays.push({ |
| | | type: 'uname_pwd', |
| | | label: '账号注册', |
| | | sort: 1 |
| | | }) |
| | | } else if (way === 'weixin') { |
| | | signWays.push({ |
| | | type: 'weixin', |
| | | label: '微信登录', |
| | | sort: 3 |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | signWays.sort((a, b) => a.sort - b.sort) |
| | | |
| | | this.setState({ |
| | | signWays: nextProps.wrap.signWays, |
| | | activeWay: nextProps.wrap.signWays[0] |
| | | signWays: signWays, |
| | | activeWay: signWays[0] |
| | | }) |
| | | } |
| | | } |
| | | |
| | | onChangeTab = (activeWay) => { |
| | | if (activeWay.type === 'weixin') return |
| | | |
| | | this.setState({activeWay}) |
| | | } |
| | | |
| | |
| | | |
| | | render() { |
| | | const { wrap } = this.props |
| | | const { activeWay, signWays } = this.state |
| | | const { activeWay, signWays, appType } = this.state |
| | | |
| | | return ( |
| | | <Form className="login-edit-form"> |
| | | {activeWay === 'uname_pwd' ? <div className="form-item-wrap"> |
| | | {appType === 'pc' ? <div className="login-way-title">{activeWay.label}</div> : null} |
| | | {activeWay.type === 'uname_pwd' ? <div className="form-item-wrap"> |
| | | <Form.Item> |
| | | <Input |
| | | prefix={<UserOutlined style={{ color: 'rgba(0,0,0,.25)' }} />} |
| | |
| | | <Form.Item> |
| | | <Input.Password placeholder="密码" prefix={<LockOutlined style={{ color: 'rgba(0,0,0,.25)' }} />} /> |
| | | </Form.Item> |
| | | {wrap.groups ? <div className={'protocol-wrap '}> |
| | | <Checkbox>{wrap.tip}</Checkbox>{wrap.groups.map((item, i) => (<span className="protocol" key={i}>《{item.label}》</span>))} |
| | | {wrap.groups ? <div className="protocol-wrap"> |
| | | <Checkbox>{wrap.tip}</Checkbox>{wrap.groups.map((item, i) => (<span><span className="protocol" key={i}>《{item.label}》</span>{wrap.groups.length > i + 1 ? (wrap.groups.length > i + 2 ? '、' : '和') : null}</span>))} |
| | | </div> : null} |
| | | <Form.Item className="btn-login"> |
| | | <Button type="primary" onDoubleClick={() => this.changeMenu()} className="sign-form-button"> |
| | |
| | | </Button> |
| | | </Form.Item> |
| | | </div> : null} |
| | | {activeWay === 'sms_vcode' ? <div className="form-item-wrap"> |
| | | {activeWay.type === 'sms_vcode' ? <div className="form-item-wrap"> |
| | | <Form.Item> |
| | | <Input |
| | | placeholder="手机号" |
| | | autoComplete="off" |
| | | /> |
| | | </Form.Item> |
| | | <Form.Item style={{marginBottom: '35px'}}> |
| | | <Form.Item style={{marginBottom: wrap.groups ? '15px' : '35px'}}> |
| | | <Input |
| | | addonAfter={ |
| | | <Button type="link" className="vercode" size="small"> |
| | |
| | | autoComplete="off" |
| | | /> |
| | | </Form.Item> |
| | | {wrap.groups ? <div className={'protocol-wrap '}> |
| | | <Checkbox>{wrap.tip}</Checkbox>{wrap.groups.map((item, i) => (<span className="protocol" key={i}>《{item.label}》</span>))} |
| | | {wrap.groups ? <div className="protocol-wrap"> |
| | | <Checkbox>{wrap.tip}</Checkbox>{wrap.groups.map((item, i) => (<span><span className="protocol" key={i}>《{item.label}》</span>{wrap.groups.length > i + 1 ? (wrap.groups.length > i + 2 ? '、' : '和') : null}</span>))} |
| | | </div> : null} |
| | | <Form.Item className="btn-login"> |
| | | <Button type="primary" onDoubleClick={() => this.changeMenu()} className="sign-form-button"> |
| | |
| | | </Button> |
| | | </Form.Item> |
| | | </div> : null} |
| | | <div className={'login-ways '}> |
| | | <div>其他登录方式</div> |
| | | {signWays.map((item, i) => { |
| | | return (<span key={i} onClick={() => this.onChangeTab(item)}>{item}</span>) |
| | | {activeWay.type === 'weixin' ? <div className="form-item-wrap"> |
| | | <Form.Item className="btn-login" style={{marginBottom: wrap.groups ? '0px' : '15px'}}> |
| | | <Button type="primary" onDoubleClick={() => this.changeMenu()} className="sign-form-button"> |
| | | 微信一键登录 |
| | | </Button> |
| | | </Form.Item> |
| | | {wrap.groups ? <div className="protocol-wrap"> |
| | | <Checkbox>{wrap.tip}</Checkbox>{wrap.groups.map((item, i) => (<span><span className="protocol" key={i}>《{item.label}》</span>{wrap.groups.length > i + 1 ? (wrap.groups.length > i + 2 ? '、' : '和') : null}</span>))} |
| | | </div> : null} |
| | | </div> : null} |
| | | {wrap.classify !== 'signin' ? <span className="mk-jump-way" onClick={() => this.props.changeway()}>已有账号,去登陆?</span> : null} |
| | | {appType === 'mob' && signWays.length > 1 ? <div className="sign-ways"> |
| | | <div className="title">其他登录方式</div> |
| | | <div className="content"> |
| | | {signWays.map((item, i) => { |
| | | if (activeWay.type === item.type) return null |
| | | return (<div key={i} className="item" onClick={() => this.onChangeTab(item)}>{item.icon}<span className="name">{item.label}</span></div>) |
| | | })} |
| | | </div> |
| | | </div> : null} |
| | | {appType === 'pc' && signWays.length > 1 ? <div className="login-ways"> |
| | | {signWays.map(item => { |
| | | if (activeWay.type === item.type) return null |
| | | return (<span key={item.type} onClick={() => this.onChangeTab(item)}>{item.label}</span>) |
| | | })} |
| | | </div> |
| | | </div> : null} |
| | | </Form> |
| | | ) |
| | | } |
| | |
| | | className={className} |
| | | onClick={(e) => {e.stopPropagation(); this.actionTrigger()}} |
| | | >{label}</Button> |
| | | {this.getModels()} |
| | | <span onClick={(e) => {e.stopPropagation()}}>{this.getModels()}</span> |
| | | {loadingTotal ? <Progress className="mk-button-progress" percent={(loadingTotal - loadingNumber) / loadingTotal * 100} size="small" showInfo={false} /> : null} |
| | | </> |
| | | } |
| | |
| | | className={className} |
| | | onClick={(e) => {e.stopPropagation(); this.actionTrigger()}} |
| | | >{label}</Button> |
| | | {this.getPop()} |
| | | <span onClick={(e) => {e.stopPropagation()}}>{this.getPop()}</span> |
| | | </> |
| | | ) |
| | | } |
| | |
| | | className={className} |
| | | onClick={(e) => {e.stopPropagation(); this.actionTrigger()}} |
| | | >{label}</Button> |
| | | {this.getModels()} |
| | | <span onClick={(e) => {e.stopPropagation()}}>{this.getModels()}</span> |
| | | </> |
| | | } |
| | | } |