|
@@ -6,7 +6,6 @@ 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'
|
10
|
9
|
import './index.scss'
|
11
|
10
|
|
12
|
11
|
const defaultSpecialImage = 'https://yz-websit.oss-cn-hangzhou.aliyuncs.com/xlk/index-icon19.jpg'
|
|
@@ -49,20 +48,20 @@ export default withLayout((props) => {
|
49
|
48
|
useEffect(() => {
|
50
|
49
|
if (CanSubmit) {
|
51
|
50
|
let url = null
|
52
|
|
- if (type === ROLE_CODE.CONSULTANT) { // 置业顾问
|
|
51
|
+ if (type === 'consultant') { // 置业顾问
|
53
|
52
|
url = API_REPORT_CUETOMER
|
54
|
|
- } else if (type === ROLE_CODE.CUSTOMER) { // 普通客户
|
|
53
|
+ } else if (type === 'customer') { // 普通客户
|
55
|
54
|
url = API_USER_ADD_CUSTOMER
|
56
|
55
|
} else { // 经纪人
|
57
|
56
|
url = API_CHANNEL_REPORT
|
58
|
57
|
}
|
59
|
58
|
let params = {}
|
60
|
|
- if (type === ROLE_CODE.CONSULTANT) {
|
|
59
|
+ if (type === 'consultant') {
|
61
|
60
|
params = { name: FormData.name, phone: FormData.phone, sex: SexId }
|
62
|
61
|
} else {
|
63
|
62
|
params = { ...FormData, sex: SexId, buildingId: BuildingId, realtyConsultant: CardId }
|
64
|
63
|
}
|
65
|
|
- if (type === ROLE_CODE.CHANNEL_AGENT) {
|
|
64
|
+ if (type === 'estateAgent') {
|
66
|
65
|
params.channelCustomerId = PersonId
|
67
|
66
|
params.channelId = user.userInfo.person.channelId
|
68
|
67
|
params.buildingId = BuildingId
|
|
@@ -145,7 +144,7 @@ export default withLayout((props) => {
|
145
|
144
|
Taro.showToast({ title: '请填写正确的客户电话', icon: 'none' })
|
146
|
145
|
return false
|
147
|
146
|
}
|
148
|
|
- if (BuildingId === null && type !== ROLE_CODE.CONSULTANT) {
|
|
147
|
+ if (BuildingId === null && type !== 'consultant') {
|
149
|
148
|
Taro.showToast({ title: '请选择客户的意向楼盘', icon: 'none' })
|
150
|
149
|
return false
|
151
|
150
|
}
|
|
@@ -185,7 +184,7 @@ export default withLayout((props) => {
|
185
|
184
|
</view>
|
186
|
185
|
|
187
|
186
|
{
|
188
|
|
- type !== ROLE_CODE.CONSULTANT &&
|
|
187
|
+ type !== 'consultant' &&
|
189
|
188
|
<Block>
|
190
|
189
|
<text>意向楼盘</text>
|
191
|
190
|
<view className='FormLine flex-h'>
|