|
@@ -1,21 +1,44 @@
|
1
|
|
-import React, { useState, useEffect } from 'react'
|
|
1
|
+import { useState, useEffect } from 'react'
|
2
|
2
|
import withLayout from '@/layout'
|
3
|
|
-import './index.scss'
|
4
|
|
-import { ScrollView, Input, Image } from '@tarojs/components'
|
|
3
|
+import { ScrollView, Input, Image, Block, Picker } from '@tarojs/components'
|
5
|
4
|
import '@/assets/css/iconfont.css'
|
|
5
|
+import { getCardList } from '@/services/card'
|
|
6
|
+import './index.scss'
|
6
|
7
|
|
7
|
8
|
export default withLayout((props) => {
|
8
|
9
|
|
9
|
|
- // const [PageProps] = useState(props)
|
|
10
|
+ const { router } = props
|
|
11
|
+ const { name, buildingId, type } = router.params
|
|
12
|
+
|
|
13
|
+ const RenChouData = {
|
|
14
|
+ name,
|
|
15
|
+ realtyConsultant: '',
|
|
16
|
+ remark: ''
|
|
17
|
+ }
|
|
18
|
+
|
|
19
|
+ const QianYueData = {
|
|
20
|
+ name,
|
|
21
|
+ realtyConsultant: '',
|
|
22
|
+ remark: ''
|
|
23
|
+ }
|
|
24
|
+
|
|
25
|
+ const JieYongData = {
|
|
26
|
+ name,
|
|
27
|
+ realtyConsultant: '',
|
|
28
|
+ remark: ''
|
|
29
|
+ }
|
|
30
|
+
|
|
31
|
+ const [FormData, setFormData] = useState({ ...RenChouData })
|
|
32
|
+
|
|
33
|
+ const [ConsultantList, setConsultantList] = useState([])
|
|
34
|
+ const [CurrnetConsultant, setCurrnetConsultant] = useState({})
|
|
35
|
+
|
10
|
36
|
const [StatusList] = useState([
|
11
|
|
- { name: '认筹', id: 1 },
|
12
|
|
- { name: '认购', id: 2 },
|
13
|
|
- { name: '签约', id: 3 },
|
14
|
|
- { name: '待结佣', id: 4 },
|
15
|
|
- { name: '已结佣', id: 5 },
|
16
|
|
- { name: '作废', id: 6 }
|
|
37
|
+ { name: '认筹', id: 3 },
|
|
38
|
+ { name: '签约', id: 4 },
|
|
39
|
+ { name: '结佣', id: 5 },
|
17
|
40
|
])
|
18
|
|
- const [CurrentStatusId, setCurrentStatusId] = useState(null)
|
|
41
|
+ const [CurrentStatusId, setCurrentStatusId] = useState(3)
|
19
|
42
|
|
20
|
43
|
const [RoomTypeList] = useState([
|
21
|
44
|
{ name: '二室一厅', id: 1 },
|
|
@@ -25,9 +48,23 @@ export default withLayout((props) => {
|
25
|
48
|
])
|
26
|
49
|
const [CurrentRoomTypeId, setCurrentRoomTypeId] = useState(null)
|
27
|
50
|
|
|
51
|
+ useEffect(() => {
|
|
52
|
+ if (buildingId) {
|
|
53
|
+ const params = {
|
|
54
|
+ pageNumber: 1,
|
|
55
|
+ pageSize: 50,
|
|
56
|
+ buildingId,
|
|
57
|
+ }
|
|
58
|
+ getCardList(params).then((res) => {
|
|
59
|
+ const { records } = res
|
|
60
|
+ setConsultantList(records || [])
|
|
61
|
+ })
|
|
62
|
+ }
|
|
63
|
+ }, [buildingId])
|
|
64
|
+
|
28
|
65
|
const CutStatus = (item) => {
|
29
|
66
|
return () => {
|
30
|
|
- setCurrentStatusId(item.id === CurrentStatusId ? null : item.id)
|
|
67
|
+ setCurrentStatusId(item.id)
|
31
|
68
|
}
|
32
|
69
|
}
|
33
|
70
|
|
|
@@ -37,10 +74,26 @@ export default withLayout((props) => {
|
37
|
74
|
}
|
38
|
75
|
}
|
39
|
76
|
|
|
77
|
+ const InputChange = (key, e) => {
|
|
78
|
+ let resData = FormData
|
|
79
|
+ resData[key] = e.detail.value
|
|
80
|
+ setFormData(resData)
|
|
81
|
+ }
|
|
82
|
+
|
|
83
|
+ const PickerChange = (key, e) => {
|
|
84
|
+ let resData = FormData
|
|
85
|
+ if (key === 'realtyConsultant') {
|
|
86
|
+ resData[key] = ConsultantList[e.detail.value].id
|
|
87
|
+ resData.realtyConsultantName = ConsultantList[e.detail.value].name
|
|
88
|
+ setCurrnetConsultant(ConsultantList[e.detail.value])
|
|
89
|
+ }
|
|
90
|
+ setFormData(resData)
|
|
91
|
+ }
|
|
92
|
+
|
40
|
93
|
return (
|
41
|
94
|
<view className='Page changeVisit'>
|
42
|
95
|
|
43
|
|
- <ScrollView scroll-y={true} refresher-enabled={false} refresher-background='#fff'>
|
|
96
|
+ <ScrollView scroll-y>
|
44
|
97
|
<view className='PageContent'>
|
45
|
98
|
|
46
|
99
|
<text className='required'>变更状态</text>
|
|
@@ -53,7 +106,7 @@ export default withLayout((props) => {
|
53
|
106
|
<text>{item.name}</text>
|
54
|
107
|
{
|
55
|
108
|
CurrentStatusId === item.id &&
|
56
|
|
- <Image mode='widthFix' src={require('../../../assets/findHouse-icon1.png')}></Image>
|
|
109
|
+ <Image mode='widthFix' src={require('@/assets/findHouse-icon1.png')}></Image>
|
57
|
110
|
}
|
58
|
111
|
</view>
|
59
|
112
|
))
|
|
@@ -62,26 +115,41 @@ export default withLayout((props) => {
|
62
|
115
|
</view>
|
63
|
116
|
</view>
|
64
|
117
|
|
65
|
|
- <text className='required'>客户姓名</text>
|
66
|
|
- <view className='FormLine flex-h'>
|
67
|
|
- <view className='flex-item'>
|
68
|
|
- <Input placeholder='请输入姓名'></Input>
|
69
|
|
- </view>
|
70
|
|
- </view>
|
71
|
|
-
|
72
|
|
- <text>归属渠道</text>
|
73
|
|
- <view className='FormLine flex-h'>
|
74
|
|
- <view className='flex-item'>
|
75
|
|
- <Input placeholder='请输入渠道'></Input>
|
76
|
|
- </view>
|
77
|
|
- </view>
|
78
|
|
-
|
79
|
|
- <text className='required'>内场接待</text>
|
80
|
|
- <view className='FormLine flex-h'>
|
81
|
|
- <view className='flex-item'>
|
82
|
|
- <Input placeholder='请输入内场接待'></Input>
|
83
|
|
- </view>
|
84
|
|
- </view>
|
|
118
|
+ {
|
|
119
|
+ CurrentStatusId === 3 &&
|
|
120
|
+ <Block>
|
|
121
|
+ <text className='required'>客户姓名</text>
|
|
122
|
+ <view className='FormLine flex-h'>
|
|
123
|
+ <view className='flex-item'>
|
|
124
|
+ <Input placeholder='请输入姓名' value={FormData.name} onInput={InputChange.bind(this, 'name')}></Input>
|
|
125
|
+ </view>
|
|
126
|
+ </view>
|
|
127
|
+ </Block>
|
|
128
|
+ }
|
|
129
|
+
|
|
130
|
+ {
|
|
131
|
+ CurrentStatusId === 3 &&
|
|
132
|
+ <Block>
|
|
133
|
+ <text>归属渠道</text>
|
|
134
|
+ <view className='FormLine flex-h'>
|
|
135
|
+ <view className='flex-item'>
|
|
136
|
+ <Input placeholder='请输入渠道' disabled value={type === 'customer' ? '-' : ''}></Input>
|
|
137
|
+ </view>
|
|
138
|
+ </view>
|
|
139
|
+ </Block>
|
|
140
|
+ }
|
|
141
|
+
|
|
142
|
+ {
|
|
143
|
+ CurrentStatusId === 3 &&
|
|
144
|
+ <Block>
|
|
145
|
+ <text className='required'>内场接待</text>
|
|
146
|
+ <view className='FormLine flex-h'>
|
|
147
|
+ <view className='flex-item'>
|
|
148
|
+ <Picker range-key='name' range={ConsultantList} value={0} onChange={PickerChange.bind(this, 'realtyConsultant')}>{CurrnetConsultant.name || '请选择'}</Picker>
|
|
149
|
+ </view>
|
|
150
|
+ </view>
|
|
151
|
+ </Block>
|
|
152
|
+ }
|
85
|
153
|
|
86
|
154
|
<text className='required'>业绩分成人|占比/%</text>
|
87
|
155
|
<view className='FormLine flex-h'>
|
|
@@ -93,7 +161,7 @@ export default withLayout((props) => {
|
93
|
161
|
<text className='required'>户型</text>
|
94
|
162
|
<view className='FormLine flex-h'>
|
95
|
163
|
<view className='flex-item'>
|
96
|
|
- <view className='CheckBoxList'>
|
|
164
|
+ <view className='CheckBoxList'>
|
97
|
165
|
{
|
98
|
166
|
RoomTypeList.map((item, index) => (
|
99
|
167
|
<view key={`RoomTypeItem-${index}`} onClick={CutRoomType(item)}>
|