瀏覽代碼

静态页面

1002884655 3 年之前
父節點
當前提交
b01f904769
共有 3 個檔案被更改,包括 34 行新增34 行删除
  1. 4
    0
      src/constants/api.js
  2. 28
    32
      src/pages/mine/addCustomer/index.jsx
  3. 2
    2
      src/pages/mine/index.jsx

+ 4
- 0
src/constants/api.js 查看文件

@@ -14,6 +14,10 @@ export const resolvePath = api => `${host + pathname}/${api}`
14 14
 
15 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 22
 export const API_COURSE_LIST = resolvePath('curriculum') // 课程列表
19 23
 export const API_MY_COLLECT_COURSE_LIST = resolvePath('curriculum/save') // 我收藏的课程列表

+ 28
- 32
src/pages/mine/addCustomer/index.jsx 查看文件

@@ -6,6 +6,7 @@ import { useSelector } from 'react-redux'
6 6
 import { fetch } from '@/utils/request'
7 7
 import { API_ITEMS_LIST, API_CARDS_LIST, API_REPORT_CUETOMER, API_USER_ADD_CUSTOMER, API_CHANNEL_REPORT } from '@/constants/api'
8 8
 import Taro from '@tarojs/taro'
9
+import { ROLE_CODE } from '@/constants/user'
9 10
 import './index.scss'
10 11
 
11 12
 const defaultSpecialImage = 'https://yz-websit.oss-cn-hangzhou.aliyuncs.com/xlk/index-icon19.jpg'
@@ -48,20 +49,20 @@ export default withLayout((props) => {
48 49
   useEffect(() => {
49 50
     if (CanSubmit) {
50 51
       let url = null
51
-      if (type === 'consultant') { // 置业顾问
52
+      if (type === ROLE_CODE.CONSULTANT) { // 置业顾问
52 53
         url = API_REPORT_CUETOMER
53
-      } else if (type === 'customer') { // 普通客户
54
+      } else if (type === ROLE_CODE.CUSTOMER) { // 普通客户
54 55
         url = API_USER_ADD_CUSTOMER
55 56
       } else { // 经纪人
56 57
         url = API_CHANNEL_REPORT
57 58
       }
58 59
       let params = {}
59
-      if (type === 'consultant') {
60
+      if (type === ROLE_CODE.CONSULTANT) {
60 61
         params = { name: FormData.name, phone: FormData.phone, sex: SexId }
61 62
       } else {
62 63
         params = { ...FormData, sex: SexId, intention: BuildingId, realtyConsultant: CardId }
63 64
       }
64
-      if (type === 'estateAgent') {
65
+      if (type === ROLE_CODE.CHANNEL_AGENT) {
65 66
         params.channelCustomerId = PersonId
66 67
         params.channelId = user.userInfo.person.channelId
67 68
         params.buildingId = BuildingId
@@ -144,14 +145,10 @@ export default withLayout((props) => {
144 145
       Taro.showToast({ title: '请填写正确的客户电话', icon: 'none' })
145 146
       return false
146 147
     }
147
-    if (BuildingId === null) {
148
+    if (BuildingId === null && type !== ROLE_CODE.CONSULTANT) {
148 149
       Taro.showToast({ title: '请选择客户的意向楼盘', icon: 'none' })
149 150
       return false
150 151
     }
151
-    if (CardId === null) {
152
-      Taro.showToast({ title: '请选择内场接待', icon: 'none' })
153
-      return false
154
-    }
155 152
     if (!CanSubmit) {
156 153
       setCanSubmit(true)
157 154
     }
@@ -180,37 +177,36 @@ export default withLayout((props) => {
180 177
           <text>性别</text>
181 178
           <view className='FormLine flex-h'>
182 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 181
                 <text>{SexName || '请选择'}</text>
185 182
               </Picker>
186 183
             </view>
187 184
             <text className='iconfont icon-jiantoudown'></text>
188 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 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 210
               <text>备注</text>
215 211
               <view className='FormLine flex-h'>
216 212
                 <view className='flex-item'>

+ 2
- 2
src/pages/mine/index.jsx 查看文件

@@ -7,7 +7,7 @@ import '@/assets/css/iconfont.css'
7 7
 import { fetch } from '@/utils/request'
8 8
 import { API_PUT_REGISTERCONSULTANT } from '@/constants/api'
9 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 11
 import store from '@/store'
12 12
 import './index.scss'
13 13
 import NeedLogin from './components/NeedLogin'
@@ -29,7 +29,7 @@ export default withLayout(() => {
29 29
     setShowLogin(false)
30 30
     if (user?.userInfo?.person?.personId) {
31 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 34
   }, [user])
35 35