Commit 0bc43677 authored by billfeller's avatar billfeller

feat: AccountSettings/base add handlerSubmit

parent 9d54a0ea
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.updatesucc' }));
}
});
};
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.updatesucc': '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.updatesucc': '更新基本信息成功',
'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.updatesucc': '更新基本信息成功',
'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