|
@@ -12,6 +12,7 @@ import { getMiniQrcode, savePoint, updatePoint } from '@/services/common'
|
12
|
12
|
import { isEmpty } from '@/utils/tools'
|
13
|
13
|
import { rule as ruleToast } from '@/utils/ruleToast'
|
14
|
14
|
import { share as shareSavePoint } from '@/utils/shareSavePoint'
|
|
15
|
+import { report as reportCustomer } from '@/utils/customer'
|
15
|
16
|
|
16
|
17
|
const bgImg = "https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/images/helpgroup/bg.png"
|
17
|
18
|
|
|
@@ -28,6 +29,7 @@ export default class Index extends Component {
|
28
|
29
|
pageInfo: {},
|
29
|
30
|
codeParams: '', // 解析二维码参数
|
30
|
31
|
h5Id: undefined,
|
|
32
|
+ reportedCustomer: false,
|
31
|
33
|
}
|
32
|
34
|
|
33
|
35
|
componentWillMount() {
|
|
@@ -316,32 +318,42 @@ export default class Index extends Component {
|
316
|
318
|
}
|
317
|
319
|
})
|
318
|
320
|
}
|
319
|
|
-
|
320
|
321
|
// 报备客户
|
321
|
322
|
reportClientFn() {
|
322
|
323
|
const { codeParams } = this.state
|
323
|
324
|
const consultant = this.$router.params.consultant || codeParams.consultant || ""
|
324
|
|
- const { userInfo: { person: { phone, tel, personId, userId, personType } } } = this.props
|
325
|
|
- const isConsultant = personType == ROLE_CODE['CONSULTANT']
|
326
|
|
- console.log(this.$router, "this.$routerthis报备客户哈哈哈哈")
|
327
|
|
- console.log(this.props.userInfo.person, "person报备客户哈哈哈哈")
|
328
|
|
-
|
329
|
|
- if (isConsultant && consultant != userId) {
|
330
|
|
- const realPhone = phone || tel
|
331
|
|
- const payload = {
|
332
|
|
- realtyConsultant: consultant, //报备人 置业顾问
|
333
|
|
- phone: realPhone,
|
334
|
|
- showToast: false
|
335
|
|
- }
|
|
325
|
+ const { userInfo: { person } } = this.props
|
336
|
326
|
|
337
|
|
- reportClient(payload).then(res => {
|
338
|
|
- console.log('恭喜您绑定成功')
|
339
|
|
- }).catch(err => {
|
340
|
|
- console.error(err)
|
|
327
|
+ if (!this.state.reportedCustomer) {
|
|
328
|
+ reportCustomer(person, consultant).then(() => {
|
|
329
|
+ this.setState({ reportedCustomer: true })
|
341
|
330
|
})
|
342
|
331
|
}
|
343
|
332
|
}
|
344
|
333
|
|
|
334
|
+ // // 报备客户
|
|
335
|
+ // reportClientFn() {
|
|
336
|
+ // const { codeParams } = this.state
|
|
337
|
+ // const consultant = this.$router.params.consultant || codeParams.consultant || ""
|
|
338
|
+ // const { userInfo: { person: { phone, tel, personId, userId, personType } } } = this.props
|
|
339
|
+ // // const isConsultant = personType == ROLE_CODE['CONSULTANT']
|
|
340
|
+ // console.log(this.$router, "this.$routerthis报备客户哈哈哈哈")
|
|
341
|
+ // console.log(this.props.userInfo.person, "person报备客户哈哈哈哈")
|
|
342
|
+ // if (isConsultant && consultant != userId) {
|
|
343
|
+ // const realPhone = phone || tel
|
|
344
|
+ // const payload = {
|
|
345
|
+ // realtyConsultant: consultant, //报备人 置业顾问
|
|
346
|
+ // phone: realPhone,
|
|
347
|
+ // showToast: false
|
|
348
|
+ // }
|
|
349
|
+ // reportClient(payload).then(res => {
|
|
350
|
+ // console.log('恭喜您绑定成功')
|
|
351
|
+ // }).catch(err => {
|
|
352
|
+ // console.error(err)
|
|
353
|
+ // })
|
|
354
|
+ // }
|
|
355
|
+ // }
|
|
356
|
+
|
345
|
357
|
renderMaskBanner() {
|
346
|
358
|
const { avatarVisible, phoneVisible, pageInfo, h5Id } = this.state
|
347
|
359
|
return (
|