add userinfo page
parent
7d7d8df7d3
commit
0841fc91fc
|
|
@ -1,10 +1,61 @@
|
|||
import { View } from '@tarojs/components';
|
||||
import { Component, ReactNode } from 'react';
|
||||
import { AtForm, AtInput, AtButton } from 'taro-ui';
|
||||
import Taro from '@tarojs/taro';
|
||||
import './inform.scss';
|
||||
|
||||
export default class InformPage extends Component {
|
||||
state = {
|
||||
phone: '',
|
||||
name: '',
|
||||
};
|
||||
handleChangePhone(phone: string) {
|
||||
this.setState({
|
||||
phone: phone,
|
||||
});
|
||||
return phone;
|
||||
}
|
||||
handleChangeName(name: string) {
|
||||
this.setState({
|
||||
name: name,
|
||||
});
|
||||
return name;
|
||||
}
|
||||
onSubmit() {
|
||||
console.log(this.state.name, this.state.phone);
|
||||
}
|
||||
onReset() {
|
||||
this.setState({
|
||||
phone: '',
|
||||
name: '',
|
||||
});
|
||||
}
|
||||
|
||||
render(): ReactNode {
|
||||
return <View></View>;
|
||||
return (
|
||||
<AtForm
|
||||
onSubmit={this.onSubmit.bind(this)}
|
||||
onReset={this.onReset.bind(this)}
|
||||
>
|
||||
<AtInput
|
||||
name='phone'
|
||||
title='手机号码'
|
||||
type='text'
|
||||
placeholder='便于查询工单'
|
||||
value={this.state.phone}
|
||||
onChange={this.handleChangePhone.bind(this)}
|
||||
/>
|
||||
<AtInput
|
||||
required
|
||||
name='name'
|
||||
title='真实姓名'
|
||||
type='text'
|
||||
placeholder='必填,与工单绑定'
|
||||
value={this.state.name}
|
||||
onChange={this.handleChangeName.bind(this)}
|
||||
/>
|
||||
<AtButton formType='submit'>提交</AtButton>
|
||||
<AtButton formType='reset'>重置</AtButton>
|
||||
</AtForm>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue