1002884655 3 lat temu
rodzic
commit
b01f904769

+ 4
- 0
src/constants/api.js Wyświetl plik

14
 
14
 
15
 export const API_CITY_AREA = resolvePath('tdCityList/tdAreaCity') // 城市下区域查询
15
 export const API_CITY_AREA = resolvePath('tdCityList/tdAreaCity') // 城市下区域查询
16
 
16
 
17
+// 客户
18
+export const API_SAVE_CUSTOMER_INFO = resolvePath('customerInfo') // 保存客户信息
19
+export const API_GET_CUSTOMER_INFO = resolvePath('customerInfo/') // 查询客户信息
20
+
17
 // 课程
21
 // 课程
18
 export const API_COURSE_LIST = resolvePath('curriculum') // 课程列表
22
 export const API_COURSE_LIST = resolvePath('curriculum') // 课程列表
19
 export const API_MY_COLLECT_COURSE_LIST = resolvePath('curriculum/save') // 我收藏的课程列表
23
 export const API_MY_COLLECT_COURSE_LIST = resolvePath('curriculum/save') // 我收藏的课程列表

+ 28
- 32
src/pages/mine/addCustomer/index.jsx Wyświetl plik

6
 import { fetch } from '@/utils/request'
6
 import { fetch } from '@/utils/request'
7
 import { API_ITEMS_LIST, API_CARDS_LIST, API_REPORT_CUETOMER, API_USER_ADD_CUSTOMER, API_CHANNEL_REPORT } from '@/constants/api'
7
 import { API_ITEMS_LIST, API_CARDS_LIST, API_REPORT_CUETOMER, API_USER_ADD_CUSTOMER, API_CHANNEL_REPORT } from '@/constants/api'
8
 import Taro from '@tarojs/taro'
8
 import Taro from '@tarojs/taro'
9
+import { ROLE_CODE } from '@/constants/user'
9
 import './index.scss'
10
 import './index.scss'
10
 
11
 
11
 const defaultSpecialImage = 'https://yz-websit.oss-cn-hangzhou.aliyuncs.com/xlk/index-icon19.jpg'
12
 const defaultSpecialImage = 'https://yz-websit.oss-cn-hangzhou.aliyuncs.com/xlk/index-icon19.jpg'
48
   useEffect(() => {
49
   useEffect(() => {
49
     if (CanSubmit) {
50
     if (CanSubmit) {
50
       let url = null
51
       let url = null
51
-      if (type === 'consultant') { // 置业顾问
52
+      if (type === ROLE_CODE.CONSULTANT) { // 置业顾问
52
         url = API_REPORT_CUETOMER
53
         url = API_REPORT_CUETOMER
53
-      } else if (type === 'customer') { // 普通客户
54
+      } else if (type === ROLE_CODE.CUSTOMER) { // 普通客户
54
         url = API_USER_ADD_CUSTOMER
55
         url = API_USER_ADD_CUSTOMER
55
       } else { // 经纪人
56
       } else { // 经纪人
56
         url = API_CHANNEL_REPORT
57
         url = API_CHANNEL_REPORT
57
       }
58
       }
58
       let params = {}
59
       let params = {}
59
-      if (type === 'consultant') {
60
+      if (type === ROLE_CODE.CONSULTANT) {
60
         params = { name: FormData.name, phone: FormData.phone, sex: SexId }
61
         params = { name: FormData.name, phone: FormData.phone, sex: SexId }
61
       } else {
62
       } else {
62
         params = { ...FormData, sex: SexId, intention: BuildingId, realtyConsultant: CardId }
63
         params = { ...FormData, sex: SexId, intention: BuildingId, realtyConsultant: CardId }
63
       }
64
       }
64
-      if (type === 'estateAgent') {
65
+      if (type === ROLE_CODE.CHANNEL_AGENT) {
65
         params.channelCustomerId = PersonId
66
         params.channelCustomerId = PersonId
66
         params.channelId = user.userInfo.person.channelId
67
         params.channelId = user.userInfo.person.channelId
67
         params.buildingId = BuildingId
68
         params.buildingId = BuildingId
144
       Taro.showToast({ title: '请填写正确的客户电话', icon: 'none' })
145
       Taro.showToast({ title: '请填写正确的客户电话', icon: 'none' })
145
       return false
146
       return false
146
     }
147
     }
147
-    if (BuildingId === null) {
148
+    if (BuildingId === null && type !== ROLE_CODE.CONSULTANT) {
148
       Taro.showToast({ title: '请选择客户的意向楼盘', icon: 'none' })
149
       Taro.showToast({ title: '请选择客户的意向楼盘', icon: 'none' })
149
       return false
150
       return false
150
     }
151
     }
151
-    if (CardId === null) {
152
-      Taro.showToast({ title: '请选择内场接待', icon: 'none' })
153
-      return false
154
-    }
155
     if (!CanSubmit) {
152
     if (!CanSubmit) {
156
       setCanSubmit(true)
153
       setCanSubmit(true)
157
     }
154
     }
180
           <text>性别</text>
177
           <text>性别</text>
181
           <view className='FormLine flex-h'>
178
           <view className='FormLine flex-h'>
182
             <view className='flex-item'>
179
             <view className='flex-item'>
183
-              <Picker range-key='name' onChange={SexPickerChange} value={0} range={SexList}>
180
+              <Picker range-key='name' onChange={SexPickerChange} value={null} range={SexList}>
184
                 <text>{SexName || '请选择'}</text>
181
                 <text>{SexName || '请选择'}</text>
185
               </Picker>
182
               </Picker>
186
             </view>
183
             </view>
187
             <text className='iconfont icon-jiantoudown'></text>
184
             <text className='iconfont icon-jiantoudown'></text>
188
           </view>
185
           </view>
189
 
186
 
190
-
191
-          <text>意向楼盘</text>
192
-          <view className='FormLine flex-h'>
193
-            <view className='flex-item'>
194
-              <Picker range-key='name' onChange={PickerChange} value={0} range={BuildingList}>
195
-                <text>{BuildingName || '请选择'}</text>
196
-              </Picker>
197
-            </view>
198
-          </view>
199
-
200
-          <text>内场接待(选填)</text>
201
-          <view className='FormLine flex-h'>
202
-            <view className='flex-item'>
203
-              <Picker range-key='name' onChange={CardPickerChange} value={0} range={CardList}>
204
-                <text>{CardName || '请选择'}</text>
205
-              </Picker>
206
-            </view>
207
-            <Image mode='heightFix' src={defaultSpecialImage}></Image>
208
-            <text>选择</text>
209
-          </view>
210
-
211
           {
187
           {
212
-            type !== 'consultant' &&
188
+            type !== ROLE_CODE.CONSULTANT &&
213
             <Block>
189
             <Block>
190
+              <text>意向楼盘</text>
191
+              <view className='FormLine flex-h'>
192
+                <view className='flex-item'>
193
+                  <Picker range-key='name' onChange={PickerChange} value={null} range={BuildingList}>
194
+                    <text>{BuildingName || '请选择'}</text>
195
+                  </Picker>
196
+                </view>
197
+              </view>
198
+
199
+              <text>内场接待(选填)</text>
200
+              <view className='FormLine flex-h'>
201
+                <view className='flex-item'>
202
+                  <Picker range-key='name' onChange={CardPickerChange} value={null} range={CardList}>
203
+                    <text>{CardName || '请选择'}</text>
204
+                  </Picker>
205
+                </view>
206
+                <Image mode='heightFix' src={defaultSpecialImage}></Image>
207
+                <text>选择</text>
208
+              </view>
209
+
214
               <text>备注</text>
210
               <text>备注</text>
215
               <view className='FormLine flex-h'>
211
               <view className='FormLine flex-h'>
216
                 <view className='flex-item'>
212
                 <view className='flex-item'>

+ 2
- 2
src/pages/mine/index.jsx Wyświetl plik

7
 import { fetch } from '@/utils/request'
7
 import { fetch } from '@/utils/request'
8
 import { API_PUT_REGISTERCONSULTANT } from '@/constants/api'
8
 import { API_PUT_REGISTERCONSULTANT } from '@/constants/api'
9
 import { getImgURL } from '@/utils/image'
9
 import { getImgURL } from '@/utils/image'
10
-import { UPDATE_USER_INFO } from '@/constants/user'
10
+import { UPDATE_USER_INFO, ROLE_CODE } from '@/constants/user'
11
 import store from '@/store'
11
 import store from '@/store'
12
 import './index.scss'
12
 import './index.scss'
13
 import NeedLogin from './components/NeedLogin'
13
 import NeedLogin from './components/NeedLogin'
29
     setShowLogin(false)
29
     setShowLogin(false)
30
     if (user?.userInfo?.person?.personId) {
30
     if (user?.userInfo?.person?.personId) {
31
       const person = user.userInfo.person
31
       const person = user.userInfo.person
32
-      setUserRole(person.personType === 'customer' || person.personType === 'drift' ? 1 : person.personType === 'estate agent' || person.personType === 'channel agent' ? 2 : person.personType === 'Realty Consultant' ? 3 : 4)
32
+      setUserRole(person.personType === ROLE_CODE.CUSTOMER ? 1 : person.personType === ROLE_CODE.CHANNEL_AGENT ? 2 : person.personType === ROLE_CODE.CONSULTANT ? 3 : 4)
33
     }
33
     }
34
   }, [user])
34
   }, [user])
35
 
35