Unverified Commit 6c5ba067 authored by 陈帅's avatar 陈帅 Committed by GitHub

Merge pull request #16 from billfeller/master

feat: AccountSettings/base add handlerSubmit
parents b99d58b6 87610e43
import React, { Component, Fragment } from 'react'; import React, { Component, Fragment } from 'react';
import { formatMessage, FormattedMessage } from 'umi-plugin-react/locale'; import { formatMessage, FormattedMessage } from 'umi-plugin-react/locale';
import { Form, Input, Upload, Select, Button } from 'antd'; import { Form, Input, Upload, Select, Button, message } from 'antd';
import { FormComponentProps } from 'antd/lib/form'; import { FormComponentProps } from 'antd/lib/form';
import { connect } from 'dva'; import { connect } from 'dva';
import styles from './BaseView.less'; import styles from './BaseView.less';
...@@ -102,6 +102,16 @@ class BaseView extends Component<BaseViewProps> { ...@@ -102,6 +102,16 @@ class BaseView extends Component<BaseViewProps> {
this.view = ref; this.view = ref;
}; };
handlerSubmit = (event: Event) => {
event.preventDefault();
const { form } = this.props;
form.validateFields((err, values) => {
if (!err) {
message.success(formatMessage({ id: 'BLOCK_NAME.basic.update.success' }));
}
});
};
render() { render() {
const { const {
form: { getFieldDecorator }, form: { getFieldDecorator },
...@@ -193,7 +203,7 @@ class BaseView extends Component<BaseViewProps> { ...@@ -193,7 +203,7 @@ class BaseView extends Component<BaseViewProps> {
], ],
})(<PhoneView />)} })(<PhoneView />)}
</FormItem> </FormItem>
<Button type="primary"> <Button type="primary" onClick={this.handlerSubmit}>
<FormattedMessage id="BLOCK_NAME.basic.update" defaultMessage="Update Information" /> <FormattedMessage id="BLOCK_NAME.basic.update" defaultMessage="Update Information" />
</Button> </Button>
</Form> </Form>
......
...@@ -21,6 +21,7 @@ export default { ...@@ -21,6 +21,7 @@ export default {
'BLOCK_NAME.basic.phone': 'Phone Number', 'BLOCK_NAME.basic.phone': 'Phone Number',
'BLOCK_NAME.basic.phone-message': 'Please input your phone!', 'BLOCK_NAME.basic.phone-message': 'Please input your phone!',
'BLOCK_NAME.basic.update': 'Update Information', 'BLOCK_NAME.basic.update': 'Update Information',
'BLOCK_NAME.basic.update.success': 'Update basic information successfully',
'BLOCK_NAME.security.strong': 'Strong', 'BLOCK_NAME.security.strong': 'Strong',
'BLOCK_NAME.security.medium': 'Medium', 'BLOCK_NAME.security.medium': 'Medium',
'BLOCK_NAME.security.weak': 'Weak', 'BLOCK_NAME.security.weak': 'Weak',
......
...@@ -21,6 +21,7 @@ export default { ...@@ -21,6 +21,7 @@ export default {
'BLOCK_NAME.basic.phone': '联系电话', 'BLOCK_NAME.basic.phone': '联系电话',
'BLOCK_NAME.basic.phone-message': '请输入您的联系电话!', 'BLOCK_NAME.basic.phone-message': '请输入您的联系电话!',
'BLOCK_NAME.basic.update': '更新基本信息', 'BLOCK_NAME.basic.update': '更新基本信息',
'BLOCK_NAME.basic.update.success': '更新基本信息成功',
'BLOCK_NAME.security.strong': '', 'BLOCK_NAME.security.strong': '',
'BLOCK_NAME.security.medium': '', 'BLOCK_NAME.security.medium': '',
'BLOCK_NAME.security.weak': '', 'BLOCK_NAME.security.weak': '',
......
...@@ -21,6 +21,7 @@ export default { ...@@ -21,6 +21,7 @@ export default {
'BLOCK_NAME.basic.phone': '聯系電話', 'BLOCK_NAME.basic.phone': '聯系電話',
'BLOCK_NAME.basic.phone-message': '請輸入您的聯系電話!', 'BLOCK_NAME.basic.phone-message': '請輸入您的聯系電話!',
'BLOCK_NAME.basic.update': '更新基本信息', 'BLOCK_NAME.basic.update': '更新基本信息',
'BLOCK_NAME.basic.update.success': '更新基本信息成功',
'BLOCK_NAME.security.strong': '', 'BLOCK_NAME.security.strong': '',
'BLOCK_NAME.security.medium': '', 'BLOCK_NAME.security.medium': '',
'BLOCK_NAME.security.weak': '', 'BLOCK_NAME.security.weak': '',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment