|
@@ -1,22 +1,47 @@
|
1
|
1
|
import { useState, useEffect } from 'react'
|
2
|
|
-import './index.scss'
|
3
|
2
|
import { ScrollView, Input, Picker } from '@tarojs/components'
|
|
3
|
+import './index.scss'
|
4
|
4
|
|
5
|
5
|
export default function EditUserDetailBasicInfo (props) {
|
6
|
6
|
const { Data = {}, close = () => { } } = props
|
7
|
7
|
|
8
|
8
|
const [FormData, setFormData] = useState({ ...Data })
|
9
|
9
|
|
10
|
|
- const [SexList] = useState([
|
11
|
|
- {name: '男', id: 1},
|
12
|
|
- {name: '女', id: 2}
|
13
|
|
- ])
|
14
|
10
|
const [AgeRange] = useState(['18-25', '26-30', '30-35', '36-45', '46-50', '50-60', '60以上'])
|
15
|
11
|
const [IncomeRange] = useState(['10万以下', '10-15万', '15-20万', '20-30万', '30-50万', '50-75万', '75-100万', '100万以上'])
|
16
|
12
|
const [BuyTimeRange] = useState(['1月以内', '1至3月', '半年以内', '一年以内', '一年以上'])
|
|
13
|
+ const [CanSubmit, setCanSubmit] = useState(false)
|
|
14
|
+
|
|
15
|
+ useEffect(() => {
|
|
16
|
+ if(CanSubmit) {
|
|
17
|
+ setCanSubmit(false)
|
|
18
|
+ console.log(FormData)
|
|
19
|
+ close()
|
|
20
|
+ }
|
|
21
|
+ }, [CanSubmit])
|
|
22
|
+
|
|
23
|
+ const PickerChange = (key, e) => {
|
|
24
|
+ let resData = FormData
|
|
25
|
+ if (key === 'age') {
|
|
26
|
+ resData[key] = AgeRange[e.detail.value]
|
|
27
|
+ } else if(key === 'householdIncome') {
|
|
28
|
+ resData[key] = IncomeRange[e.detail.value]
|
|
29
|
+ } else if(key === 'estimatedPurchaseTime') {
|
|
30
|
+ resData[key] = BuyTimeRange[e.detail.value]
|
|
31
|
+ }
|
|
32
|
+ setFormData(resData)
|
|
33
|
+ }
|
17
|
34
|
|
18
|
|
- const PickerChange = (e, type) => {
|
|
35
|
+ const InputChange = (key, e) => {
|
|
36
|
+ let resData = FormData
|
|
37
|
+ resData[key] = e.detail.value
|
|
38
|
+ setFormData(resData)
|
|
39
|
+ }
|
19
|
40
|
|
|
41
|
+ const Submit = () => {
|
|
42
|
+ if(!CanSubmit) {
|
|
43
|
+ setCanSubmit(true)
|
|
44
|
+ }
|
20
|
45
|
}
|
21
|
46
|
|
22
|
47
|
return (
|
|
@@ -27,52 +52,42 @@ export default function EditUserDetailBasicInfo (props) {
|
27
|
52
|
<text>姓名</text>
|
28
|
53
|
<view className='FormLine flex-h'>
|
29
|
54
|
<view className='flex-item'>
|
30
|
|
- <Input placeholder='请输入姓名'></Input>
|
|
55
|
+ <Input placeholder='请输入姓名' onInput={InputChange.bind(this, 'name')}></Input>
|
31
|
56
|
</view>
|
32
|
57
|
</view>
|
33
|
58
|
|
34
|
59
|
<text>昵称</text>
|
35
|
60
|
<view className='FormLine flex-h'>
|
36
|
61
|
<view className='flex-item'>
|
37
|
|
- <Input placeholder='请输入昵称'></Input>
|
|
62
|
+ <Input placeholder='请输入昵称' onInput={InputChange.bind(this, 'nickname')}></Input>
|
38
|
63
|
</view>
|
39
|
64
|
</view>
|
40
|
65
|
|
41
|
66
|
<text>手机号码</text>
|
42
|
67
|
<view className='FormLine flex-h'>
|
43
|
68
|
<view className='flex-item'>
|
44
|
|
- <Input placeholder='请输入手机号码'></Input>
|
45
|
|
- </view>
|
46
|
|
- </view>
|
47
|
|
-
|
48
|
|
- <text>性别</text>
|
49
|
|
- <view className='FormLine flex-h'>
|
50
|
|
- <view className='flex-item'>
|
51
|
|
- <Picker range-key='name' onChange={PickerChange.bind(this, 'sex')} value={0} range={SexList}>
|
52
|
|
- <text>请选择</text>
|
53
|
|
- </Picker>
|
|
69
|
+ <Input placeholder='请输入手机号码' onInput={InputChange.bind(this, 'phone')}></Input>
|
54
|
70
|
</view>
|
55
|
|
- <text className='iconfont icon-jiantoudown'></text>
|
56
|
71
|
</view>
|
57
|
72
|
|
58
|
73
|
<text>家庭住址</text>
|
59
|
74
|
<view className='FormLine flex-h'>
|
60
|
75
|
<view className='flex-item'>
|
61
|
|
- <Input placeholder='请输入家庭住址'></Input>
|
|
76
|
+ <Input placeholder='请输入家庭住址' onInput={InputChange.bind(this, 'homeAddress')}></Input>
|
62
|
77
|
</view>
|
63
|
78
|
</view>
|
64
|
79
|
|
65
|
80
|
<text>工作地址</text>
|
66
|
81
|
<view className='FormLine flex-h'>
|
67
|
82
|
<view className='flex-item'>
|
68
|
|
- <Input placeholder='请输入工作地址'></Input>
|
|
83
|
+ <Input placeholder='请输入工作地址' onInput={InputChange.bind(this, 'firmAddress')}></Input>
|
69
|
84
|
</view>
|
70
|
85
|
</view>
|
71
|
86
|
|
72
|
87
|
<text>年龄段</text>
|
73
|
88
|
<view className='FormLine flex-h'>
|
74
|
89
|
<view className='flex-item'>
|
75
|
|
- <Picker onChange={PickerChange.bind(this, 'age')} value={0} range={AgeRange}>
|
|
90
|
+ <Picker onChange={PickerChange.bind(this, 'age')} value={null} range={AgeRange}>
|
76
|
91
|
<text>请选择</text>
|
77
|
92
|
</Picker>
|
78
|
93
|
</view>
|
|
@@ -82,14 +97,14 @@ export default function EditUserDetailBasicInfo (props) {
|
82
|
97
|
<text>职业</text>
|
83
|
98
|
<view className='FormLine flex-h'>
|
84
|
99
|
<view className='flex-item'>
|
85
|
|
- <Input placeholder='请输入职业'></Input>
|
|
100
|
+ <Input placeholder='请输入职业' onInput={InputChange.bind(this, 'career')}></Input>
|
86
|
101
|
</view>
|
87
|
102
|
</view>
|
88
|
103
|
|
89
|
104
|
<text>家庭年收入范围</text>
|
90
|
105
|
<view className='FormLine flex-h'>
|
91
|
106
|
<view className='flex-item'>
|
92
|
|
- <Picker onChange={PickerChange.bind(this, 'income')} value={0} range={IncomeRange}>
|
|
107
|
+ <Picker onChange={PickerChange.bind(this, 'householdIncome')} value={null} range={IncomeRange}>
|
93
|
108
|
<text>请选择</text>
|
94
|
109
|
</Picker>
|
95
|
110
|
</view>
|
|
@@ -99,28 +114,28 @@ export default function EditUserDetailBasicInfo (props) {
|
99
|
114
|
<text>家庭成员数</text>
|
100
|
115
|
<view className='FormLine flex-h'>
|
101
|
116
|
<view className='flex-item'>
|
102
|
|
- <Input placeholder='请输入家庭成员数'></Input>
|
|
117
|
+ <Input placeholder='请输入家庭成员数' onInput={InputChange.bind(this, 'familyNumber')}></Input>
|
103
|
118
|
</view>
|
104
|
119
|
</view>
|
105
|
120
|
|
106
|
121
|
<text>已有房产数</text>
|
107
|
122
|
<view className='FormLine flex-h'>
|
108
|
123
|
<view className='flex-item'>
|
109
|
|
- <Input placeholder='请输入已有房产数'></Input>
|
|
124
|
+ <Input placeholder='请输入已有房产数' onInput={InputChange.bind(this, 'houseNumber')}></Input>
|
110
|
125
|
</view>
|
111
|
126
|
</view>
|
112
|
127
|
|
113
|
128
|
<text>已有车辆数</text>
|
114
|
129
|
<view className='FormLine flex-h'>
|
115
|
130
|
<view className='flex-item'>
|
116
|
|
- <Input placeholder='请输入已有车辆数'></Input>
|
|
131
|
+ <Input placeholder='请输入已有车辆数' onInput={InputChange.bind(this, 'carNumber')}></Input>
|
117
|
132
|
</view>
|
118
|
133
|
</view>
|
119
|
134
|
|
120
|
135
|
<text>预计购房时间</text>
|
121
|
136
|
<view className='FormLine flex-h'>
|
122
|
137
|
<view className='flex-item'>
|
123
|
|
- <Picker onChange={PickerChange.bind(this, 'time')} value={0} range={BuyTimeRange}>
|
|
138
|
+ <Picker onChange={PickerChange.bind(this, 'estimatedPurchaseTime')} value={null} range={BuyTimeRange}>
|
124
|
139
|
<text>请选择</text>
|
125
|
140
|
</Picker>
|
126
|
141
|
</view>
|
|
@@ -130,40 +145,40 @@ export default function EditUserDetailBasicInfo (props) {
|
130
|
145
|
<text>客户咨询重点</text>
|
131
|
146
|
<view className='FormLine flex-h'>
|
132
|
147
|
<view className='flex-item'>
|
133
|
|
- <Input placeholder='请填写 如:地段、交通、社区配套、户型、价格等'></Input>
|
|
148
|
+ <Input placeholder='请填写 如:地段、交通、社区配套、户型、价格等' onInput={InputChange.bind(this, 'consultation')}></Input>
|
134
|
149
|
</view>
|
135
|
150
|
</view>
|
136
|
151
|
|
137
|
152
|
<text>购房动机</text>
|
138
|
153
|
<view className='FormLine flex-h'>
|
139
|
154
|
<view className='flex-item'>
|
140
|
|
- <Input placeholder='请填写 如结婚、养老、二孩、改善、学区、投资等'></Input>
|
|
155
|
+ <Input placeholder='请填写 如结婚、养老、二孩、改善、学区、投资等' onInput={InputChange.bind(this, 'motivation')}></Input>
|
141
|
156
|
</view>
|
142
|
157
|
</view>
|
143
|
158
|
|
144
|
159
|
<text>客户抗性分析</text>
|
145
|
160
|
<view className='FormLine flex-h'>
|
146
|
161
|
<view className='flex-item'>
|
147
|
|
- <Input placeholder='请填写 如:地段、交通、社区配套、户型、价格等'></Input>
|
|
162
|
+ <Input placeholder='请填写 如:地段、交通、社区配套、户型、价格等' onInput={InputChange.bind(this, 'resistanceAnalysis')}></Input>
|
148
|
163
|
</view>
|
149
|
164
|
</view>
|
150
|
165
|
|
151
|
166
|
<text>客户对项目认可点</text>
|
152
|
167
|
<view className='FormLine flex-h'>
|
153
|
168
|
<view className='flex-item'>
|
154
|
|
- <Input placeholder='请填写 如:地段、交通、社区配套、户型、价格等;'></Input>
|
|
169
|
+ <Input placeholder='请填写 如:地段、交通、社区配套、户型、价格等' onInput={InputChange.bind(this, 'approval')}></Input>
|
155
|
170
|
</view>
|
156
|
171
|
</view>
|
157
|
172
|
|
158
|
173
|
<text>备注</text>
|
159
|
174
|
<view className='FormLine flex-h'>
|
160
|
175
|
<view className='flex-item'>
|
161
|
|
- <Input placeholder='补充说明(选填)'></Input>
|
|
176
|
+ <Input placeholder='补充说明(选填)' onInput={InputChange.bind(this, 'remark')}></Input>
|
162
|
177
|
</view>
|
163
|
178
|
</view>
|
164
|
179
|
|
165
|
180
|
<view className='Btn'>
|
166
|
|
- <text onClick={close}>提交</text>
|
|
181
|
+ <text onClick={Submit}>提交</text>
|
167
|
182
|
</view>
|
168
|
183
|
|
169
|
184
|
</view>
|