Browse Source

经纪人信息

Baozhangchao 3 years ago
parent
commit
0e256bfb5f

+ 1
- 0
src/components/Auth/AuthPage/index.jsx View File

13
     page,
13
     page,
14
   } = props
14
   } = props
15
 
15
 
16
+
16
   const [loading, setLoading] = useState(false)
17
   const [loading, setLoading] = useState(false)
17
   const { updatePhoneNumber } = useAuth(consultant, router, page)
18
   const { updatePhoneNumber } = useAuth(consultant, router, page)
18
 
19
 

+ 3
- 0
src/constants/api.js View File

28
 
28
 
29
 // 获取经纪人绑定楼盘列表
29
 // 获取经纪人绑定楼盘列表
30
 export const API_GET_AGENT_BUILDINGS = resolvePath('buildingChannel/buildings')
30
 export const API_GET_AGENT_BUILDINGS = resolvePath('buildingChannel/buildings')
31
+//获取经纪人信息
32
+export const API_GET_AGENTS = resolvePath('customer/agents')
33
+
31
 
34
 
32
 // 课程
35
 // 课程
33
 export const API_COURSE_LIST = resolvePath('curriculum') // 课程列表
36
 export const API_COURSE_LIST = resolvePath('curriculum') // 课程列表

+ 9
- 1
src/services/card.js View File

6
   API_CARDS_UV,
6
   API_CARDS_UV,
7
   API_CARDS_LIKE,
7
   API_CARDS_LIKE,
8
   API_FORM_ID,
8
   API_FORM_ID,
9
-  API_CARDS_SHARE,
9
+  API_GET_AGENTS,
10
   API_CARD_FAVOR,
10
   API_CARD_FAVOR,
11
   API_UPDATE_PHOTO
11
   API_UPDATE_PHOTO
12
 } from '@/constants/api'
12
 } from '@/constants/api'
19
 export const getCardList = payload => fetch({ url: API_CARDS_LIST, payload })
19
 export const getCardList = payload => fetch({ url: API_CARDS_LIST, payload })
20
 
20
 
21
 
21
 
22
+/**
23
+ * 获取经纪人信息
24
+ * @param {*} payload 
25
+ */
26
+export const getAgents = payload => fetch({ url: API_GET_AGENTS, payload })
27
+
28
+
29
+
22
 /**
30
 /**
23
  * 获取名片详情
31
  * 获取名片详情
24
  * @param {*} id
32
  * @param {*} id

+ 34
- 11
src/subpackages/pages/marketing/changeVisit/index.jsx View File

2
 import withLayout from '@/layout'
2
 import withLayout from '@/layout'
3
 import { ScrollView, Input, Image, Block, Picker } from '@tarojs/components'
3
 import { ScrollView, Input, Image, Block, Picker } from '@tarojs/components'
4
 import '@/assets/css/iconfont.css'
4
 import '@/assets/css/iconfont.css'
5
-import { getCardList } from '@/services/card'
5
+import { getCardList, getAgents } from '@/services/card'
6
 import { fetch } from '@/utils/request'
6
 import { fetch } from '@/utils/request'
7
 import Taro from '@tarojs/taro'
7
 import Taro from '@tarojs/taro'
8
 import { formatDate } from "@/utils/chatDate";
8
 import { formatDate } from "@/utils/chatDate";
14
   const { router } = props
14
   const { router } = props
15
   const { name, buildingId, type, id, channelId } = router.params
15
   const { name, buildingId, type, id, channelId } = router.params
16
 
16
 
17
+
17
   const [RenChouData, setRenChouData] = useState({
18
   const [RenChouData, setRenChouData] = useState({
18
     name,
19
     name,
19
     realtyConsultant: '',
20
     realtyConsultant: '',
20
     remark: '',
21
     remark: '',
21
   })
22
   })
22
 
23
 
24
+
23
   const [QianYueData, setQianYueData] = useState({
25
   const [QianYueData, setQianYueData] = useState({
24
     name,
26
     name,
25
     realtyConsultant: '',
27
     realtyConsultant: '',
64
     }
66
     }
65
   }, [buildingId])
67
   }, [buildingId])
66
 
68
 
69
+
70
+
71
+  const [agentsInfo, setAgentsInfo] = useState({
72
+    name: '',
73
+    channelName: ' ',
74
+  })
75
+
76
+
67
   useEffect(() => {
77
   useEffect(() => {
68
     fetch({ url: `${API_CUSTOMER_DETAILINFO}/${id}`, method: 'get' }).then((res) => {
78
     fetch({ url: `${API_CUSTOMER_DETAILINFO}/${id}`, method: 'get' }).then((res) => {
69
-      if(CurrentStatusId - 0 === 3) {
79
+      //获取经纪人信息
80
+      setAgentsInfo({ name: res.name })
81
+      getAgents({ personId: res?.recommendPerson }).then((e) => {
82
+        let ganentsList = e.records
83
+        if ((ganentsList || []).length) {
84
+          // ganentsList
85
+          setAgentsInfo({ name: res.name, channelName: ganentsList[0].channelName })
86
+        }
87
+      })
88
+      if (CurrentStatusId - 0 === 3) {
70
         setFormData({ ...FormData, ...res?.customerPreparatory, realtyConsultant: res.customerPreparatory?.realtyConsultant })
89
         setFormData({ ...FormData, ...res?.customerPreparatory, realtyConsultant: res.customerPreparatory?.realtyConsultant })
71
       }
90
       }
72
       setChannelCustomerId(res?.channelCustomer?.channelCustomerId)
91
       setChannelCustomerId(res?.channelCustomer?.channelCustomerId)
73
       setRenChouData({ ...RenChouData, ...res?.customerPreparatory, realtyConsultant: res.customerPreparatory?.realtyConsultant })
92
       setRenChouData({ ...RenChouData, ...res?.customerPreparatory, realtyConsultant: res.customerPreparatory?.realtyConsultant })
74
-      if((res.customerSignatory || []).length) {
93
+      if ((res.customerSignatory || []).length) {
75
         let customerSignatory = res.customerSignatory[0]
94
         let customerSignatory = res.customerSignatory[0]
76
         customerSignatory.dividendsPer = customerSignatory.dividendsName.substring(customerSignatory.dividendsName.indexOf('|') + 1, customerSignatory.dividendsName.indexOf('%'))
95
         customerSignatory.dividendsPer = customerSignatory.dividendsName.substring(customerSignatory.dividendsName.indexOf('|') + 1, customerSignatory.dividendsName.indexOf('%'))
77
         customerSignatory.dividendsName = customerSignatory.dividendsName.substring(0, customerSignatory.dividendsName.indexOf('|'))
96
         customerSignatory.dividendsName = customerSignatory.dividendsName.substring(0, customerSignatory.dividendsName.indexOf('|'))
78
-        setQianYueData({...QianYueData, ...customerSignatory, realtyConsultant: (res.customerSignatory|| []).length ? res.customerSignatory[0].realtyConsultant : null})
97
+        setQianYueData({ ...QianYueData, ...customerSignatory, realtyConsultant: (res.customerSignatory || []).length ? res.customerSignatory[0].realtyConsultant : null })
98
+
79
         HouseTypeList.map((item) => {
99
         HouseTypeList.map((item) => {
80
-          if(item.apartmentId === res.customerSignatory[0].houseType) {
100
+          if (item.apartmentId === res.customerSignatory[0].houseType) {
81
             setCurrentRoomTypeId(item.apartmentId)
101
             setCurrentRoomTypeId(item.apartmentId)
82
           }
102
           }
83
         })
103
         })
84
         setSuccessDate(res.customerSignatory[0].successDate.substring(0, 10))
104
         setSuccessDate(res.customerSignatory[0].successDate.substring(0, 10))
85
       }
105
       }
86
-      const ConsultantId = CurrentStatusId === 3 ? res.customerPreparatory?.realtyConsultant : (res.customerSignatory|| []).length ? res.customerSignatory[0].realtyConsultant : null
106
+      const ConsultantId = CurrentStatusId === 3 ? res.customerPreparatory?.realtyConsultant : (res.customerSignatory || []).length ? res.customerSignatory[0].realtyConsultant : null
87
       console.log(`ConsultantId is`, ConsultantId)
107
       console.log(`ConsultantId is`, ConsultantId)
88
       ConsultantList.map((item) => {
108
       ConsultantList.map((item) => {
89
-        if(item.id === ConsultantId) {
109
+        if (item.id === ConsultantId) {
90
           setCurrnetConsultant(item)
110
           setCurrnetConsultant(item)
91
         }
111
         }
92
       })
112
       })
93
     })
113
     })
94
-  }, [ConsultantList, HouseTypeList])
114
+  }, [ConsultantList, HouseTypeList, CurrentStatusId])
95
 
115
 
96
   useEffect(() => {
116
   useEffect(() => {
97
     if (CurrentStatusId - 0 !== 3 && buildingId) {
117
     if (CurrentStatusId - 0 !== 3 && buildingId) {
102
   }, [CurrentStatusId, buildingId])
122
   }, [CurrentStatusId, buildingId])
103
 
123
 
104
   useEffect(() => {
124
   useEffect(() => {
105
-    console.log(FormData)
125
+    console.log('FormData', FormData)
106
   }, [FormData])
126
   }, [FormData])
107
 
127
 
108
   const CutStatus = (item) => {
128
   const CutStatus = (item) => {
110
       setCurrentStatusId(item.id)
130
       setCurrentStatusId(item.id)
111
       if (item.id - 0 === 3) {
131
       if (item.id - 0 === 3) {
112
         setFormData({ ...RenChouData })
132
         setFormData({ ...RenChouData })
133
+
113
       } else if (item.id - 0 === 4) {
134
       } else if (item.id - 0 === 4) {
114
         setFormData({ ...QianYueData })
135
         setFormData({ ...QianYueData })
136
+
115
       } else if (item.id - 0 === 5) {
137
       } else if (item.id - 0 === 5) {
116
         setFormData({ ...QianYueData })
138
         setFormData({ ...QianYueData })
117
       }
139
       }
205
     setSuccessDate(e.detail.value)
227
     setSuccessDate(e.detail.value)
206
   }
228
   }
207
 
229
 
230
+
208
   return (
231
   return (
209
     <view className='Page changeVisit'>
232
     <view className='Page changeVisit'>
210
 
233
 
233
           <text className='required'>客户姓名</text>
256
           <text className='required'>客户姓名</text>
234
           <view className='FormLine flex-h'>
257
           <view className='FormLine flex-h'>
235
             <view className='flex-item'>
258
             <view className='flex-item'>
236
-              <Input placeholder='请输入姓名' disabled={CurrentStatusId === 5} value={FormData.name} onInput={InputChange.bind(this, 'name')}></Input>
259
+              <Input placeholder='请输入姓名' disabled={CurrentStatusId === 5} value={agentsInfo.name} onInput={InputChange.bind(this, 'name')}></Input>
237
             </view>
260
             </view>
238
           </view>
261
           </view>
239
 
262
 
241
           <text>归属渠道</text>
264
           <text>归属渠道</text>
242
           <view className='FormLine flex-h'>
265
           <view className='FormLine flex-h'>
243
             <view className='flex-item'>
266
             <view className='flex-item'>
244
-              <Input placeholder='请输入渠道' disabled value={type === 'customer' ? '-' : ''}></Input>
267
+              <Input placeholder='请输入渠道' disabled value={agentsInfo.channelName}></Input>
245
             </view>
268
             </view>
246
           </view>
269
           </view>
247
 
270