king
2020-06-22 9e0a0749233c15711fd3259afa1f19867d214df7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { InputItem, Icon, Checkbox, List, Button } from 'antd-mobile'
import { createForm } from 'rc-form'
 
import zhCN from '@/locales/zh-CN/mob.js'
import enUS from '@/locales/en-US/mob.js'
// import mklogo from '@/assets/mobimg/mklogo.png'
import './index.scss'
 
const CheckboxItem = Checkbox.CheckboxItem
 
class MobLogin extends Component {
  static propTpyes = {
    card: PropTypes.object,
    triggerEdit: PropTypes.func,
    onDoubleClick: PropTypes.func
  }
 
  state = {
    dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
    rember: true,
    param: {
      background: {color: '#000000', image: ''},
      logo: {width: ''}
    }
  }
 
  UNSAFE_componentWillMount () {
 
  }
 
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState))
  }
 
  onChange = (e) => {
    const { rember } = this.state
    e.stopPropagation()
 
    this.setState({
      rember: !rember
    })
  }
 
  onChangeLang = (value) => {
    this.setState({
      lang: value
    })
  }
 
  editLogo = (e) => {
    e.stopPropagation()
  }
 
  editTitle = (e) => {
    e.stopPropagation()
  }
 
  editMsg = (e) => {
    e.stopPropagation()
  }
 
  editBox = (e) => {
    e.stopPropagation()
  }
 
  render () {
    const { card } = this.props
    const { getFieldProps } = this.props.form
    const { rember } = this.state
 
    return (
      <div className="mob-login" onClick={this.editBox} style={{paddingTop: `calc(17vh - 10px)`}}>
        <div className="logo" onClick={this.editLogo}>
          <img src={card.logo.content} alt=""/>
        </div>
        <div className="plat-name" onClick={this.editTitle}>明科商业智能开放平台</div>
        <InputItem
          placeholder="UserName"
          prefixListCls="mk-login-item am-list"
          {...getFieldProps('userName', {
            initialValue: 'admin',
          })}
          disabled={true}
        >
          <Icon type="check-circle-o" />
        </InputItem>
        <InputItem
          placeholder="Password"
          prefixListCls="mk-login-item am-list"
          {...getFieldProps('password', {
            initialValue: '123456',
          })}
          type={'password'}
          disabled={true}
        >
          <Icon type="check-circle" />
        </InputItem>
        <div className="other-setting">
          <CheckboxItem checked={rember} onChange={this.onChange}>
            <span onClick={this.onChange}>记住密码</span>
          </CheckboxItem>
          {/* <Picker data={langs} value={lang} cols={1} onChange={this.onChangeLang} className="forss">
            <List.Item>{lang}</List.Item>
          </Picker> */}
          <List.Item className="lang">中文简体</List.Item>
          <div className="clear-both"></div>
        </div>
        <Button type="primary" onDoubleClick={() => this.props.doubleClickCard(card.login)}>登录</Button>
        <div className="company-msg" onClick={this.editMsg}>
          <p>Copyright©2017  所有相关版权归  北京明科普华信息技术有限公司</p>
        </div>
      </div>
    )
  }
}
 
export default createForm()(MobLogin)