正在显示
33 个修改的文件
包含
248 行增加
和
294 行删除
@@ -18,11 +18,7 @@ const PageHeaderWrapper = ({ children, wrapperClassName, ...restProps }) => ( | @@ -18,11 +18,7 @@ const PageHeaderWrapper = ({ children, wrapperClassName, ...restProps }) => ( | ||
18 | return item.title; | 18 | return item.title; |
19 | }} | 19 | }} |
20 | /> | 20 | /> |
21 | - {children ? ( | ||
22 | - <div className={styles.content}> | ||
23 | - {children} | ||
24 | - </div> | ||
25 | - ) : null} | 21 | + {children ? <div className={styles.content}>{children}</div> : null} |
26 | </div> | 22 | </div> |
27 | ); | 23 | ); |
28 | 24 |
@@ -2,7 +2,7 @@ export default { | @@ -2,7 +2,7 @@ export default { | ||
2 | 'app.forms.basic.title': 'Basic form', | 2 | 'app.forms.basic.title': 'Basic form', |
3 | 'app.forms.basic.description': | 3 | 'app.forms.basic.description': |
4 | 'Form pages are used to collect or verify information to users, and basic forms are common in scenarios where there are fewer data items.', | 4 | 'Form pages are used to collect or verify information to users, and basic forms are common in scenarios where there are fewer data items.', |
5 | - | 5 | + |
6 | 'validation.email.required': 'Por favor insira seu email!', | 6 | 'validation.email.required': 'Por favor insira seu email!', |
7 | 'validation.email.wrong-format': 'O email está errado!', | 7 | 'validation.email.wrong-format': 'O email está errado!', |
8 | 'validation.userName.required': 'Por favor insira nome de usuário!', | 8 | 'validation.userName.required': 'Por favor insira nome de usuário!', |
@@ -20,7 +20,7 @@ export default { | @@ -20,7 +20,7 @@ export default { | ||
20 | 'validation.date.required': '请选择起止日期', | 20 | 'validation.date.required': '请选择起止日期', |
21 | 'validation.goal.required': '请输入目标描述', | 21 | 'validation.goal.required': '请输入目标描述', |
22 | 'validation.standard.required': '请输入衡量标准', | 22 | 'validation.standard.required': '请输入衡量标准', |
23 | - | 23 | + |
24 | 'form.get-captcha': '获取验证码', | 24 | 'form.get-captcha': '获取验证码', |
25 | 'form.captcha.second': '秒', | 25 | 'form.captcha.second': '秒', |
26 | 'form.optional': '(选填)', | 26 | 'form.optional': '(选填)', |
@@ -2,7 +2,7 @@ export default { | @@ -2,7 +2,7 @@ export default { | ||
2 | 'app.forms.basic.title': '基礎表單', | 2 | 'app.forms.basic.title': '基礎表單', |
3 | 'app.forms.basic.description': | 3 | 'app.forms.basic.description': |
4 | '表單頁用於向用戶收集或驗證信息,基礎表單常見於數據項較少的表單場景。', | 4 | '表單頁用於向用戶收集或驗證信息,基礎表單常見於數據項較少的表單場景。', |
5 | - | 5 | + |
6 | 'validation.email.required': '請輸入郵箱地址!', | 6 | 'validation.email.required': '請輸入郵箱地址!', |
7 | 'validation.email.wrong-format': '郵箱地址格式錯誤!', | 7 | 'validation.email.wrong-format': '郵箱地址格式錯誤!', |
8 | 'validation.userName.required': '請輸入賬戶!', | 8 | 'validation.userName.required': '請輸入賬戶!', |
@@ -5,8 +5,7 @@ import { fakeSubmitForm } from './service'; | @@ -5,8 +5,7 @@ import { fakeSubmitForm } from './service'; | ||
5 | export default { | 5 | export default { |
6 | namespace: 'form', | 6 | namespace: 'form', |
7 | 7 | ||
8 | - state: { | ||
9 | - }, | 8 | + state: {}, |
10 | 9 | ||
11 | effects: { | 10 | effects: { |
12 | *submitAdvancedForm({ payload }, { call }) { | 11 | *submitAdvancedForm({ payload }, { call }) { |
@@ -26,11 +26,7 @@ const PageHeaderWrapper = ({ children, contentWidth, wrapperClassName, top, ...r | @@ -26,11 +26,7 @@ const PageHeaderWrapper = ({ children, contentWidth, wrapperClassName, top, ...r | ||
26 | /> | 26 | /> |
27 | )} | 27 | )} |
28 | </MenuContext.Consumer> | 28 | </MenuContext.Consumer> |
29 | - {children ? ( | ||
30 | - <div className={styles.content}> | ||
31 | - {children} | ||
32 | - </div> | ||
33 | - ) : null} | 29 | + {children ? <div className={styles.content}>{children}</div> : null} |
34 | </div> | 30 | </div> |
35 | ); | 31 | ); |
36 | 32 |
@@ -22,7 +22,6 @@ import { DescriptionList } from 'ant-design-pro'; | @@ -22,7 +22,6 @@ import { DescriptionList } from 'ant-design-pro'; | ||
22 | import PageHeaderWrapper from './components/PageHeaderWrapper'; | 22 | import PageHeaderWrapper from './components/PageHeaderWrapper'; |
23 | import styles from './style.less'; | 23 | import styles from './style.less'; |
24 | 24 | ||
25 | - | ||
26 | const { Step } = Steps; | 25 | const { Step } = Steps; |
27 | const { Description } = DescriptionList; | 26 | const { Description } = DescriptionList; |
28 | const ButtonGroup = Button.Group; | 27 | const ButtonGroup = Button.Group; |
@@ -63,7 +63,7 @@ const cachedSave = (response, hashcode) => { | @@ -63,7 +63,7 @@ const cachedSave = (response, hashcode) => { | ||
63 | * @param {object} [option] The options we want to pass to "fetch" | 63 | * @param {object} [option] The options we want to pass to "fetch" |
64 | * @return {object} An object containing either "data" or "err" | 64 | * @return {object} An object containing either "data" or "err" |
65 | */ | 65 | */ |
66 | -export default function (url, option) { | 66 | +export default function(url, option) { |
67 | const options = { | 67 | const options = { |
68 | expirys: isAntdPro(), | 68 | expirys: isAntdPro(), |
69 | ...option, | 69 | ...option, |
@@ -18,11 +18,7 @@ const PageHeaderWrapper = ({ children, wrapperClassName, ...restProps }) => ( | @@ -18,11 +18,7 @@ const PageHeaderWrapper = ({ children, wrapperClassName, ...restProps }) => ( | ||
18 | return item.title; | 18 | return item.title; |
19 | }} | 19 | }} |
20 | /> | 20 | /> |
21 | - {children ? ( | ||
22 | - <div className={styles.content}> | ||
23 | - {children} | ||
24 | - </div> | ||
25 | - ) : null} | 21 | + {children ? <div className={styles.content}>{children}</div> : null} |
26 | </div> | 22 | </div> |
27 | ); | 23 | ); |
28 | 24 |
@@ -2,7 +2,7 @@ export default { | @@ -2,7 +2,7 @@ export default { | ||
2 | 'app.forms.basic.title': 'Basic form', | 2 | 'app.forms.basic.title': 'Basic form', |
3 | 'app.forms.basic.description': | 3 | 'app.forms.basic.description': |
4 | 'Form pages are used to collect or verify information to users, and basic forms are common in scenarios where there are fewer data items.', | 4 | 'Form pages are used to collect or verify information to users, and basic forms are common in scenarios where there are fewer data items.', |
5 | - | 5 | + |
6 | 'validation.email.required': 'Por favor insira seu email!', | 6 | 'validation.email.required': 'Por favor insira seu email!', |
7 | 'validation.email.wrong-format': 'O email está errado!', | 7 | 'validation.email.wrong-format': 'O email está errado!', |
8 | 'validation.userName.required': 'Por favor insira nome de usuário!', | 8 | 'validation.userName.required': 'Por favor insira nome de usuário!', |
@@ -20,7 +20,7 @@ export default { | @@ -20,7 +20,7 @@ export default { | ||
20 | 'validation.date.required': '请选择起止日期', | 20 | 'validation.date.required': '请选择起止日期', |
21 | 'validation.goal.required': '请输入目标描述', | 21 | 'validation.goal.required': '请输入目标描述', |
22 | 'validation.standard.required': '请输入衡量标准', | 22 | 'validation.standard.required': '请输入衡量标准', |
23 | - | 23 | + |
24 | 'form.get-captcha': '获取验证码', | 24 | 'form.get-captcha': '获取验证码', |
25 | 'form.captcha.second': '秒', | 25 | 'form.captcha.second': '秒', |
26 | 'form.optional': '(选填)', | 26 | 'form.optional': '(选填)', |
@@ -2,7 +2,7 @@ export default { | @@ -2,7 +2,7 @@ export default { | ||
2 | 'app.forms.basic.title': '基礎表單', | 2 | 'app.forms.basic.title': '基礎表單', |
3 | 'app.forms.basic.description': | 3 | 'app.forms.basic.description': |
4 | '表單頁用於向用戶收集或驗證信息,基礎表單常見於數據項較少的表單場景。', | 4 | '表單頁用於向用戶收集或驗證信息,基礎表單常見於數據項較少的表單場景。', |
5 | - | 5 | + |
6 | 'validation.email.required': '請輸入郵箱地址!', | 6 | 'validation.email.required': '請輸入郵箱地址!', |
7 | 'validation.email.wrong-format': '郵箱地址格式錯誤!', | 7 | 'validation.email.wrong-format': '郵箱地址格式錯誤!', |
8 | 'validation.userName.required': '請輸入賬戶!', | 8 | 'validation.userName.required': '請輸入賬戶!', |
@@ -5,8 +5,7 @@ import { fakeSubmitForm } from './service'; | @@ -5,8 +5,7 @@ import { fakeSubmitForm } from './service'; | ||
5 | export default { | 5 | export default { |
6 | namespace: 'form', | 6 | namespace: 'form', |
7 | 7 | ||
8 | - state: { | ||
9 | - }, | 8 | + state: {}, |
10 | 9 | ||
11 | effects: { | 10 | effects: { |
12 | *submitRegularForm({ payload }, { call }) { | 11 | *submitRegularForm({ payload }, { call }) { |
@@ -26,11 +26,7 @@ const PageHeaderWrapper = ({ children, contentWidth, wrapperClassName, top, ...r | @@ -26,11 +26,7 @@ const PageHeaderWrapper = ({ children, contentWidth, wrapperClassName, top, ...r | ||
26 | /> | 26 | /> |
27 | )} | 27 | )} |
28 | </MenuContext.Consumer> | 28 | </MenuContext.Consumer> |
29 | - {children ? ( | ||
30 | - <div className={styles.content}> | ||
31 | - {children} | ||
32 | - </div> | ||
33 | - ) : null} | 29 | + {children ? <div className={styles.content}>{children}</div> : null} |
34 | </div> | 30 | </div> |
35 | ); | 31 | ); |
36 | 32 |
@@ -63,7 +63,7 @@ const cachedSave = (response, hashcode) => { | @@ -63,7 +63,7 @@ const cachedSave = (response, hashcode) => { | ||
63 | * @param {object} [option] The options we want to pass to "fetch" | 63 | * @param {object} [option] The options we want to pass to "fetch" |
64 | * @return {object} An object containing either "data" or "err" | 64 | * @return {object} An object containing either "data" or "err" |
65 | */ | 65 | */ |
66 | -export default function (url, option) { | 66 | +export default function(url, option) { |
67 | const options = { | 67 | const options = { |
68 | expirys: isAntdPro(), | 68 | expirys: isAntdPro(), |
69 | ...option, | 69 | ...option, |
@@ -18,11 +18,7 @@ const PageHeaderWrapper = ({ children, wrapperClassName, ...restProps }) => ( | @@ -18,11 +18,7 @@ const PageHeaderWrapper = ({ children, wrapperClassName, ...restProps }) => ( | ||
18 | return item.title; | 18 | return item.title; |
19 | }} | 19 | }} |
20 | /> | 20 | /> |
21 | - {children ? ( | ||
22 | - <div className={styles.content}> | ||
23 | - {children} | ||
24 | - </div> | ||
25 | - ) : null} | 21 | + {children ? <div className={styles.content}>{children}</div> : null} |
26 | </div> | 22 | </div> |
27 | ); | 23 | ); |
28 | 24 |
@@ -18,11 +18,7 @@ const PageHeaderWrapper = ({ children, wrapperClassName, ...restProps }) => ( | @@ -18,11 +18,7 @@ const PageHeaderWrapper = ({ children, wrapperClassName, ...restProps }) => ( | ||
18 | return item.title; | 18 | return item.title; |
19 | }} | 19 | }} |
20 | /> | 20 | /> |
21 | - {children ? ( | ||
22 | - <div className={styles.content}> | ||
23 | - {children} | ||
24 | - </div> | ||
25 | - ) : null} | 21 | + {children ? <div className={styles.content}>{children}</div> : null} |
26 | </div> | 22 | </div> |
27 | ); | 23 | ); |
28 | 24 |
@@ -18,11 +18,7 @@ const PageHeaderWrapper = ({ children, wrapperClassName, ...restProps }) => ( | @@ -18,11 +18,7 @@ const PageHeaderWrapper = ({ children, wrapperClassName, ...restProps }) => ( | ||
18 | return item.title; | 18 | return item.title; |
19 | }} | 19 | }} |
20 | /> | 20 | /> |
21 | - {children ? ( | ||
22 | - <div className={styles.content}> | ||
23 | - {children} | ||
24 | - </div> | ||
25 | - ) : null} | 21 | + {children ? <div className={styles.content}>{children}</div> : null} |
26 | </div> | 22 | </div> |
27 | ); | 23 | ); |
28 | 24 |
@@ -41,13 +41,13 @@ export default class StepForm extends PureComponent { | @@ -41,13 +41,13 @@ export default class StepForm extends PureComponent { | ||
41 | <Step title="确认转账信息" /> | 41 | <Step title="确认转账信息" /> |
42 | <Step title="完成" /> | 42 | <Step title="完成" /> |
43 | </Steps> | 43 | </Steps> |
44 | - { | ||
45 | - /confirm\/?$/.test(pathname) ? | ||
46 | - <Step2 /> : ( | ||
47 | - /result\/?$/.test(pathname) ? | ||
48 | - <Step3 /> : <Step1 /> | ||
49 | - ) | ||
50 | - } | 44 | + {/confirm\/?$/.test(pathname) ? ( |
45 | + <Step2 /> | ||
46 | + ) : /result\/?$/.test(pathname) ? ( | ||
47 | + <Step3 /> | ||
48 | + ) : ( | ||
49 | + <Step1 /> | ||
50 | + )} | ||
51 | </Fragment> | 51 | </Fragment> |
52 | </Card> | 52 | </Card> |
53 | </PageHeaderWrapper> | 53 | </PageHeaderWrapper> |
@@ -2,7 +2,7 @@ export default { | @@ -2,7 +2,7 @@ export default { | ||
2 | 'app.forms.basic.title': 'Basic form', | 2 | 'app.forms.basic.title': 'Basic form', |
3 | 'app.forms.basic.description': | 3 | 'app.forms.basic.description': |
4 | 'Form pages are used to collect or verify information to users, and basic forms are common in scenarios where there are fewer data items.', | 4 | 'Form pages are used to collect or verify information to users, and basic forms are common in scenarios where there are fewer data items.', |
5 | - | 5 | + |
6 | 'validation.email.required': 'Por favor insira seu email!', | 6 | 'validation.email.required': 'Por favor insira seu email!', |
7 | 'validation.email.wrong-format': 'O email está errado!', | 7 | 'validation.email.wrong-format': 'O email está errado!', |
8 | 'validation.userName.required': 'Por favor insira nome de usuário!', | 8 | 'validation.userName.required': 'Por favor insira nome de usuário!', |
@@ -20,7 +20,7 @@ export default { | @@ -20,7 +20,7 @@ export default { | ||
20 | 'validation.date.required': '请选择起止日期', | 20 | 'validation.date.required': '请选择起止日期', |
21 | 'validation.goal.required': '请输入目标描述', | 21 | 'validation.goal.required': '请输入目标描述', |
22 | 'validation.standard.required': '请输入衡量标准', | 22 | 'validation.standard.required': '请输入衡量标准', |
23 | - | 23 | + |
24 | 'form.get-captcha': '获取验证码', | 24 | 'form.get-captcha': '获取验证码', |
25 | 'form.captcha.second': '秒', | 25 | 'form.captcha.second': '秒', |
26 | 'form.optional': '(选填)', | 26 | 'form.optional': '(选填)', |
@@ -2,7 +2,7 @@ export default { | @@ -2,7 +2,7 @@ export default { | ||
2 | 'app.forms.basic.title': '基礎表單', | 2 | 'app.forms.basic.title': '基礎表單', |
3 | 'app.forms.basic.description': | 3 | 'app.forms.basic.description': |
4 | '表單頁用於向用戶收集或驗證信息,基礎表單常見於數據項較少的表單場景。', | 4 | '表單頁用於向用戶收集或驗證信息,基礎表單常見於數據項較少的表單場景。', |
5 | - | 5 | + |
6 | 'validation.email.required': '請輸入郵箱地址!', | 6 | 'validation.email.required': '請輸入郵箱地址!', |
7 | 'validation.email.wrong-format': '郵箱地址格式錯誤!', | 7 | 'validation.email.wrong-format': '郵箱地址格式錯誤!', |
8 | 'validation.userName.required': '請輸入賬戶!', | 8 | 'validation.userName.required': '請輸入賬戶!', |
@@ -69,100 +69,100 @@ class LoginPage extends Component { | @@ -69,100 +69,100 @@ class LoginPage extends Component { | ||
69 | const { type, autoLogin } = this.state; | 69 | const { type, autoLogin } = this.state; |
70 | return ( | 70 | return ( |
71 | <UserLayout> | 71 | <UserLayout> |
72 | - <div className={styles.main}> | ||
73 | - <Login | ||
74 | - defaultActiveKey={type} | ||
75 | - onTabChange={this.onTabChange} | ||
76 | - onSubmit={this.handleSubmit} | ||
77 | - ref={form => { | ||
78 | - this.loginForm = form; | ||
79 | - }} | ||
80 | - > | ||
81 | - <Tab key="account" tab={formatMessage({ id: 'app.login.tab-login-credentials' })}> | ||
82 | - {login.status === 'error' && | ||
83 | - login.type === 'account' && | ||
84 | - !submitting && | ||
85 | - this.renderMessage(formatMessage({ id: 'app.login.message-invalid-credentials' }))} | ||
86 | - <UserName | ||
87 | - name="userName" | ||
88 | - placeholder={`${formatMessage({ id: 'app.login.userName' })}: admin or user`} | ||
89 | - rules={[ | ||
90 | - { | ||
91 | - required: true, | ||
92 | - message: formatMessage({ id: 'validation.userName.required' }), | ||
93 | - }, | ||
94 | - ]} | ||
95 | - /> | ||
96 | - <Password | ||
97 | - name="password" | ||
98 | - placeholder={`${formatMessage({ id: 'app.login.password' })}: ant.design`} | ||
99 | - rules={[ | ||
100 | - { | ||
101 | - required: true, | ||
102 | - message: formatMessage({ id: 'validation.password.required' }), | ||
103 | - }, | ||
104 | - ]} | ||
105 | - onPressEnter={() => this.loginForm.validateFields(this.handleSubmit)} | ||
106 | - /> | ||
107 | - </Tab> | ||
108 | - <Tab key="mobile" tab={formatMessage({ id: 'app.login.tab-login-mobile' })}> | ||
109 | - {login.status === 'error' && | ||
110 | - login.type === 'mobile' && | ||
111 | - !submitting && | ||
112 | - this.renderMessage( | ||
113 | - formatMessage({ id: 'app.login.message-invalid-verification-code' }) | ||
114 | - )} | ||
115 | - <Mobile | ||
116 | - name="mobile" | ||
117 | - placeholder={formatMessage({ id: 'form.phone-number.placeholder' })} | ||
118 | - rules={[ | ||
119 | - { | ||
120 | - required: true, | ||
121 | - message: formatMessage({ id: 'validation.phone-number.required' }), | ||
122 | - }, | ||
123 | - { | ||
124 | - pattern: /^1\d{10}$/, | ||
125 | - message: formatMessage({ id: 'validation.phone-number.wrong-format' }), | ||
126 | - }, | ||
127 | - ]} | ||
128 | - /> | ||
129 | - <Captcha | ||
130 | - name="captcha" | ||
131 | - placeholder={formatMessage({ id: 'form.verification-code.placeholder' })} | ||
132 | - countDown={120} | ||
133 | - onGetCaptcha={this.onGetCaptcha} | ||
134 | - getCaptchaButtonText={formatMessage({ id: 'form.get-captcha' })} | ||
135 | - getCaptchaSecondText={formatMessage({ id: 'form.captcha.second' })} | ||
136 | - rules={[ | ||
137 | - { | ||
138 | - required: true, | ||
139 | - message: formatMessage({ id: 'validation.verification-code.required' }), | ||
140 | - }, | ||
141 | - ]} | ||
142 | - /> | ||
143 | - </Tab> | ||
144 | - <div> | ||
145 | - <Checkbox checked={autoLogin} onChange={this.changeAutoLogin}> | ||
146 | - <FormattedMessage id="app.login.remember-me" /> | ||
147 | - </Checkbox> | ||
148 | - <a style={{ float: 'right' }} href=""> | ||
149 | - <FormattedMessage id="app.login.forgot-password" /> | ||
150 | - </a> | ||
151 | - </div> | ||
152 | - <Submit loading={submitting}> | ||
153 | - <FormattedMessage id="app.login.login" /> | ||
154 | - </Submit> | ||
155 | - <div className={styles.other}> | ||
156 | - <FormattedMessage id="app.login.sign-in-with" /> | ||
157 | - <Icon type="alipay-circle" className={styles.icon} theme="outlined" /> | ||
158 | - <Icon type="taobao-circle" className={styles.icon} theme="outlined" /> | ||
159 | - <Icon type="weibo-circle" className={styles.icon} theme="outlined" /> | ||
160 | - <Link className={styles.register} to="/user/register"> | ||
161 | - <FormattedMessage id="app.login.signup" /> | ||
162 | - </Link> | ||
163 | - </div> | ||
164 | - </Login> | ||
165 | - </div> | 72 | + <div className={styles.main}> |
73 | + <Login | ||
74 | + defaultActiveKey={type} | ||
75 | + onTabChange={this.onTabChange} | ||
76 | + onSubmit={this.handleSubmit} | ||
77 | + ref={form => { | ||
78 | + this.loginForm = form; | ||
79 | + }} | ||
80 | + > | ||
81 | + <Tab key="account" tab={formatMessage({ id: 'app.login.tab-login-credentials' })}> | ||
82 | + {login.status === 'error' && | ||
83 | + login.type === 'account' && | ||
84 | + !submitting && | ||
85 | + this.renderMessage(formatMessage({ id: 'app.login.message-invalid-credentials' }))} | ||
86 | + <UserName | ||
87 | + name="userName" | ||
88 | + placeholder={`${formatMessage({ id: 'app.login.userName' })}: admin or user`} | ||
89 | + rules={[ | ||
90 | + { | ||
91 | + required: true, | ||
92 | + message: formatMessage({ id: 'validation.userName.required' }), | ||
93 | + }, | ||
94 | + ]} | ||
95 | + /> | ||
96 | + <Password | ||
97 | + name="password" | ||
98 | + placeholder={`${formatMessage({ id: 'app.login.password' })}: ant.design`} | ||
99 | + rules={[ | ||
100 | + { | ||
101 | + required: true, | ||
102 | + message: formatMessage({ id: 'validation.password.required' }), | ||
103 | + }, | ||
104 | + ]} | ||
105 | + onPressEnter={() => this.loginForm.validateFields(this.handleSubmit)} | ||
106 | + /> | ||
107 | + </Tab> | ||
108 | + <Tab key="mobile" tab={formatMessage({ id: 'app.login.tab-login-mobile' })}> | ||
109 | + {login.status === 'error' && | ||
110 | + login.type === 'mobile' && | ||
111 | + !submitting && | ||
112 | + this.renderMessage( | ||
113 | + formatMessage({ id: 'app.login.message-invalid-verification-code' }) | ||
114 | + )} | ||
115 | + <Mobile | ||
116 | + name="mobile" | ||
117 | + placeholder={formatMessage({ id: 'form.phone-number.placeholder' })} | ||
118 | + rules={[ | ||
119 | + { | ||
120 | + required: true, | ||
121 | + message: formatMessage({ id: 'validation.phone-number.required' }), | ||
122 | + }, | ||
123 | + { | ||
124 | + pattern: /^1\d{10}$/, | ||
125 | + message: formatMessage({ id: 'validation.phone-number.wrong-format' }), | ||
126 | + }, | ||
127 | + ]} | ||
128 | + /> | ||
129 | + <Captcha | ||
130 | + name="captcha" | ||
131 | + placeholder={formatMessage({ id: 'form.verification-code.placeholder' })} | ||
132 | + countDown={120} | ||
133 | + onGetCaptcha={this.onGetCaptcha} | ||
134 | + getCaptchaButtonText={formatMessage({ id: 'form.get-captcha' })} | ||
135 | + getCaptchaSecondText={formatMessage({ id: 'form.captcha.second' })} | ||
136 | + rules={[ | ||
137 | + { | ||
138 | + required: true, | ||
139 | + message: formatMessage({ id: 'validation.verification-code.required' }), | ||
140 | + }, | ||
141 | + ]} | ||
142 | + /> | ||
143 | + </Tab> | ||
144 | + <div> | ||
145 | + <Checkbox checked={autoLogin} onChange={this.changeAutoLogin}> | ||
146 | + <FormattedMessage id="app.login.remember-me" /> | ||
147 | + </Checkbox> | ||
148 | + <a style={{ float: 'right' }} href=""> | ||
149 | + <FormattedMessage id="app.login.forgot-password" /> | ||
150 | + </a> | ||
151 | + </div> | ||
152 | + <Submit loading={submitting}> | ||
153 | + <FormattedMessage id="app.login.login" /> | ||
154 | + </Submit> | ||
155 | + <div className={styles.other}> | ||
156 | + <FormattedMessage id="app.login.sign-in-with" /> | ||
157 | + <Icon type="alipay-circle" className={styles.icon} theme="outlined" /> | ||
158 | + <Icon type="taobao-circle" className={styles.icon} theme="outlined" /> | ||
159 | + <Icon type="weibo-circle" className={styles.icon} theme="outlined" /> | ||
160 | + <Link className={styles.register} to="/user/register"> | ||
161 | + <FormattedMessage id="app.login.signup" /> | ||
162 | + </Link> | ||
163 | + </div> | ||
164 | + </Login> | ||
165 | + </div> | ||
166 | </UserLayout> | 166 | </UserLayout> |
167 | ); | 167 | ); |
168 | } | 168 | } |
@@ -180,155 +180,155 @@ class Register extends Component { | @@ -180,155 +180,155 @@ class Register extends Component { | ||
180 | const { count, prefix, help, visible } = this.state; | 180 | const { count, prefix, help, visible } = this.state; |
181 | return ( | 181 | return ( |
182 | <UserLayout> | 182 | <UserLayout> |
183 | - <div className={styles.main}> | ||
184 | - <h3> | ||
185 | - <FormattedMessage id="app.register.register" /> | ||
186 | - </h3> | ||
187 | - <Form onSubmit={this.handleSubmit}> | ||
188 | - <FormItem> | ||
189 | - {getFieldDecorator('mail', { | ||
190 | - rules: [ | ||
191 | - { | ||
192 | - required: true, | ||
193 | - message: formatMessage({ id: 'validation.email.required' }), | ||
194 | - }, | ||
195 | - { | ||
196 | - type: 'email', | ||
197 | - message: formatMessage({ id: 'validation.email.wrong-format' }), | ||
198 | - }, | ||
199 | - ], | ||
200 | - })( | ||
201 | - <Input size="large" placeholder={formatMessage({ id: 'form.email.placeholder' })} /> | ||
202 | - )} | ||
203 | - </FormItem> | ||
204 | - <FormItem help={help}> | ||
205 | - <Popover | ||
206 | - getPopupContainer={node => node.parentNode} | ||
207 | - content={ | ||
208 | - <div style={{ padding: '4px 0' }}> | ||
209 | - {passwordStatusMap[this.getPasswordStatus()]} | ||
210 | - {this.renderPasswordProgress()} | ||
211 | - <div style={{ marginTop: 10 }}> | ||
212 | - <FormattedMessage id="validation.password.strength.msg" /> | ||
213 | - </div> | ||
214 | - </div> | ||
215 | - } | ||
216 | - overlayStyle={{ width: 240 }} | ||
217 | - placement="right" | ||
218 | - visible={visible} | ||
219 | - > | ||
220 | - {getFieldDecorator('password', { | 183 | + <div className={styles.main}> |
184 | + <h3> | ||
185 | + <FormattedMessage id="app.register.register" /> | ||
186 | + </h3> | ||
187 | + <Form onSubmit={this.handleSubmit}> | ||
188 | + <FormItem> | ||
189 | + {getFieldDecorator('mail', { | ||
221 | rules: [ | 190 | rules: [ |
222 | { | 191 | { |
223 | - validator: this.checkPassword, | 192 | + required: true, |
193 | + message: formatMessage({ id: 'validation.email.required' }), | ||
194 | + }, | ||
195 | + { | ||
196 | + type: 'email', | ||
197 | + message: formatMessage({ id: 'validation.email.wrong-format' }), | ||
224 | }, | 198 | }, |
225 | ], | 199 | ], |
226 | })( | 200 | })( |
227 | - <Input | ||
228 | - size="large" | ||
229 | - type="password" | ||
230 | - placeholder={formatMessage({ id: 'form.password.placeholder' })} | ||
231 | - /> | 201 | + <Input size="large" placeholder={formatMessage({ id: 'form.email.placeholder' })} /> |
232 | )} | 202 | )} |
233 | - </Popover> | ||
234 | - </FormItem> | ||
235 | - <FormItem> | ||
236 | - {getFieldDecorator('confirm', { | ||
237 | - rules: [ | ||
238 | - { | ||
239 | - required: true, | ||
240 | - message: formatMessage({ id: 'validation.confirm-password.required' }), | ||
241 | - }, | ||
242 | - { | ||
243 | - validator: this.checkConfirm, | ||
244 | - }, | ||
245 | - ], | ||
246 | - })( | ||
247 | - <Input | ||
248 | - size="large" | ||
249 | - type="password" | ||
250 | - placeholder={formatMessage({ id: 'form.confirm-password.placeholder' })} | ||
251 | - /> | ||
252 | - )} | ||
253 | - </FormItem> | ||
254 | - <FormItem> | ||
255 | - <InputGroup compact> | ||
256 | - <Select | ||
257 | - size="large" | ||
258 | - value={prefix} | ||
259 | - onChange={this.changePrefix} | ||
260 | - style={{ width: '20%' }} | 203 | + </FormItem> |
204 | + <FormItem help={help}> | ||
205 | + <Popover | ||
206 | + getPopupContainer={node => node.parentNode} | ||
207 | + content={ | ||
208 | + <div style={{ padding: '4px 0' }}> | ||
209 | + {passwordStatusMap[this.getPasswordStatus()]} | ||
210 | + {this.renderPasswordProgress()} | ||
211 | + <div style={{ marginTop: 10 }}> | ||
212 | + <FormattedMessage id="validation.password.strength.msg" /> | ||
213 | + </div> | ||
214 | + </div> | ||
215 | + } | ||
216 | + overlayStyle={{ width: 240 }} | ||
217 | + placement="right" | ||
218 | + visible={visible} | ||
261 | > | 219 | > |
262 | - <Option value="86">+86</Option> | ||
263 | - <Option value="87">+87</Option> | ||
264 | - </Select> | ||
265 | - {getFieldDecorator('mobile', { | 220 | + {getFieldDecorator('password', { |
221 | + rules: [ | ||
222 | + { | ||
223 | + validator: this.checkPassword, | ||
224 | + }, | ||
225 | + ], | ||
226 | + })( | ||
227 | + <Input | ||
228 | + size="large" | ||
229 | + type="password" | ||
230 | + placeholder={formatMessage({ id: 'form.password.placeholder' })} | ||
231 | + /> | ||
232 | + )} | ||
233 | + </Popover> | ||
234 | + </FormItem> | ||
235 | + <FormItem> | ||
236 | + {getFieldDecorator('confirm', { | ||
266 | rules: [ | 237 | rules: [ |
267 | { | 238 | { |
268 | required: true, | 239 | required: true, |
269 | - message: formatMessage({ id: 'validation.phone-number.required' }), | 240 | + message: formatMessage({ id: 'validation.confirm-password.required' }), |
270 | }, | 241 | }, |
271 | { | 242 | { |
272 | - pattern: /^\d{11}$/, | ||
273 | - message: formatMessage({ id: 'validation.phone-number.wrong-format' }), | 243 | + validator: this.checkConfirm, |
274 | }, | 244 | }, |
275 | ], | 245 | ], |
276 | })( | 246 | })( |
277 | <Input | 247 | <Input |
278 | size="large" | 248 | size="large" |
279 | - style={{ width: '80%' }} | ||
280 | - placeholder={formatMessage({ id: 'form.phone-number.placeholder' })} | 249 | + type="password" |
250 | + placeholder={formatMessage({ id: 'form.confirm-password.placeholder' })} | ||
281 | /> | 251 | /> |
282 | )} | 252 | )} |
283 | - </InputGroup> | ||
284 | - </FormItem> | ||
285 | - <FormItem> | ||
286 | - <Row gutter={8}> | ||
287 | - <Col span={16}> | ||
288 | - {getFieldDecorator('captcha', { | 253 | + </FormItem> |
254 | + <FormItem> | ||
255 | + <InputGroup compact> | ||
256 | + <Select | ||
257 | + size="large" | ||
258 | + value={prefix} | ||
259 | + onChange={this.changePrefix} | ||
260 | + style={{ width: '20%' }} | ||
261 | + > | ||
262 | + <Option value="86">+86</Option> | ||
263 | + <Option value="87">+87</Option> | ||
264 | + </Select> | ||
265 | + {getFieldDecorator('mobile', { | ||
289 | rules: [ | 266 | rules: [ |
290 | { | 267 | { |
291 | required: true, | 268 | required: true, |
292 | - message: formatMessage({ id: 'validation.verification-code.required' }), | 269 | + message: formatMessage({ id: 'validation.phone-number.required' }), |
270 | + }, | ||
271 | + { | ||
272 | + pattern: /^\d{11}$/, | ||
273 | + message: formatMessage({ id: 'validation.phone-number.wrong-format' }), | ||
293 | }, | 274 | }, |
294 | ], | 275 | ], |
295 | })( | 276 | })( |
296 | <Input | 277 | <Input |
297 | size="large" | 278 | size="large" |
298 | - placeholder={formatMessage({ id: 'form.verification-code.placeholder' })} | 279 | + style={{ width: '80%' }} |
280 | + placeholder={formatMessage({ id: 'form.phone-number.placeholder' })} | ||
299 | /> | 281 | /> |
300 | )} | 282 | )} |
301 | - </Col> | ||
302 | - <Col span={8}> | ||
303 | - <Button | ||
304 | - size="large" | ||
305 | - disabled={count} | ||
306 | - className={styles.getCaptcha} | ||
307 | - onClick={this.onGetCaptcha} | ||
308 | - > | ||
309 | - {count | ||
310 | - ? `${count} s` | ||
311 | - : formatMessage({ id: 'app.register.get-verification-code' })} | ||
312 | - </Button> | ||
313 | - </Col> | ||
314 | - </Row> | ||
315 | - </FormItem> | ||
316 | - <FormItem> | ||
317 | - <Button | ||
318 | - size="large" | ||
319 | - loading={submitting} | ||
320 | - className={styles.submit} | ||
321 | - type="primary" | ||
322 | - htmlType="submit" | ||
323 | - > | ||
324 | - <FormattedMessage id="app.register.register" /> | ||
325 | - </Button> | ||
326 | - <Link className={styles.login} to="/User/Login"> | ||
327 | - <FormattedMessage id="app.register.sign-in" /> | ||
328 | - </Link> | ||
329 | - </FormItem> | ||
330 | - </Form> | ||
331 | - </div> | 283 | + </InputGroup> |
284 | + </FormItem> | ||
285 | + <FormItem> | ||
286 | + <Row gutter={8}> | ||
287 | + <Col span={16}> | ||
288 | + {getFieldDecorator('captcha', { | ||
289 | + rules: [ | ||
290 | + { | ||
291 | + required: true, | ||
292 | + message: formatMessage({ id: 'validation.verification-code.required' }), | ||
293 | + }, | ||
294 | + ], | ||
295 | + })( | ||
296 | + <Input | ||
297 | + size="large" | ||
298 | + placeholder={formatMessage({ id: 'form.verification-code.placeholder' })} | ||
299 | + /> | ||
300 | + )} | ||
301 | + </Col> | ||
302 | + <Col span={8}> | ||
303 | + <Button | ||
304 | + size="large" | ||
305 | + disabled={count} | ||
306 | + className={styles.getCaptcha} | ||
307 | + onClick={this.onGetCaptcha} | ||
308 | + > | ||
309 | + {count | ||
310 | + ? `${count} s` | ||
311 | + : formatMessage({ id: 'app.register.get-verification-code' })} | ||
312 | + </Button> | ||
313 | + </Col> | ||
314 | + </Row> | ||
315 | + </FormItem> | ||
316 | + <FormItem> | ||
317 | + <Button | ||
318 | + size="large" | ||
319 | + loading={submitting} | ||
320 | + className={styles.submit} | ||
321 | + type="primary" | ||
322 | + htmlType="submit" | ||
323 | + > | ||
324 | + <FormattedMessage id="app.register.register" /> | ||
325 | + </Button> | ||
326 | + <Link className={styles.login} to="/User/Login"> | ||
327 | + <FormattedMessage id="app.register.sign-in" /> | ||
328 | + </Link> | ||
329 | + </FormItem> | ||
330 | + </Form> | ||
331 | + </div> | ||
332 | </UserLayout> | 332 | </UserLayout> |
333 | ); | 333 | ); |
334 | } | 334 | } |
@@ -20,11 +20,7 @@ const PageHeaderWrapper = ({ children, contentWidth, wrapperClassName, top, ...r | @@ -20,11 +20,7 @@ const PageHeaderWrapper = ({ children, contentWidth, wrapperClassName, top, ...r | ||
20 | return item.title; | 20 | return item.title; |
21 | }} | 21 | }} |
22 | /> | 22 | /> |
23 | - {children ? ( | ||
24 | - <div className={styles.content}> | ||
25 | - { children } | ||
26 | - </div> | ||
27 | - ) : null} | 23 | + {children ? <div className={styles.content}>{children}</div> : null} |
28 | </div> | 24 | </div> |
29 | ); | 25 | ); |
30 | 26 |
请
注册
或
登录
后发表评论