|
@@ -4,7 +4,7 @@ import './index.scss'
|
4
|
4
|
import Banner from '../banner'
|
5
|
5
|
import HelpGroupBanner from '../swiper'
|
6
|
6
|
import Poster from './poster'
|
7
|
|
-
|
|
7
|
+import { reportClient } from '@services/report'
|
8
|
8
|
import Around from './Around/around'
|
9
|
9
|
import BackHomeBtn from '@components/BackHomeBtn'
|
10
|
10
|
import AchievePhone from '@components/achievePhone'
|
|
@@ -76,30 +76,17 @@ export default class Index extends Component {
|
76
|
76
|
// console.log('-------options----->', options)
|
77
|
77
|
// if (sceneInShare(options.scene)) {
|
78
|
78
|
const router = Taro.getStorageSync('router')
|
79
|
|
- const consultant = this.$router.params.consultant || router.query.consultant
|
80
|
|
- if (consultant) {
|
81
|
|
- console.log(consultant, "$$$$$$$$$$$$$$$$$$$$$$$$$$$4444")
|
82
|
|
- getCardDetail(consultant).then(res => {
|
83
|
|
- console.log(res, "$$$$$$$$$$$$$$$$$$$$$$$$$$$")
|
84
|
|
- this.setState({
|
85
|
|
- consultData: res,
|
86
|
|
- consultShow: true
|
87
|
|
- })
|
88
|
|
- })
|
89
|
|
- }
|
90
|
79
|
const { person = {} } = this.props.userInfo || {}
|
91
|
80
|
console.log('-------person----->', person)
|
92
|
81
|
if ((person.tel || person.phone) && (person.avatarurl || '').indexOf('wx.qlogo.cn') === -1) {
|
93
|
82
|
Taro.reLaunch({ url: '/pages/auth/index' })
|
94
|
83
|
return
|
95
|
84
|
}
|
96
|
|
-
|
97
|
85
|
this.setState({
|
98
|
86
|
grantPhoneVisible: true,
|
99
|
87
|
})
|
100
|
88
|
// }
|
101
|
89
|
|
102
|
|
-
|
103
|
90
|
const id = this.$router.params.id || router.query.id
|
104
|
91
|
|
105
|
92
|
// 没有找到 id , 再重新找一次
|
|
@@ -122,6 +109,55 @@ export default class Index extends Component {
|
122
|
109
|
const { recordId } = this.state
|
123
|
110
|
recordId && updatePoint(recordId)
|
124
|
111
|
}
|
|
112
|
+ // 报备客户
|
|
113
|
+ reportClientFn() {
|
|
114
|
+
|
|
115
|
+ const router = Taro.getStorageSync('router') || { query: {} }
|
|
116
|
+ const consultant = this.$router.params.consultant || router.query.consultant || ""
|
|
117
|
+ const {
|
|
118
|
+ userInfo: { person: { phone, tel, userId } }
|
|
119
|
+ } = this.props
|
|
120
|
+
|
|
121
|
+ if (consultant && consultant != userId) {
|
|
122
|
+ const realPhone = phone || tel
|
|
123
|
+ const payload = {
|
|
124
|
+ realtyConsultant: consultant, //报备人 置业顾问
|
|
125
|
+ phone: realPhone,
|
|
126
|
+ showToast: false
|
|
127
|
+ }
|
|
128
|
+ reportClient(payload).then(res => {
|
|
129
|
+ console.log('恭喜您绑定成功')
|
|
130
|
+ }).catch(err => {
|
|
131
|
+ console.error(err)
|
|
132
|
+ })
|
|
133
|
+ }
|
|
134
|
+ }
|
|
135
|
+ onShareAppMessage = () => {
|
|
136
|
+ const {
|
|
137
|
+ projectDetail: { shareContents, buildingName, buildingId, poster },
|
|
138
|
+ userInfo: { person: { personId, personType, userId } }
|
|
139
|
+ } = this.props
|
|
140
|
+ const consultantId = personType == ROLE_CODE['CONSULTANT'] ? userId : ""
|
|
141
|
+ // 分享埋点
|
|
142
|
+ addItemShareNum(buildingId)
|
|
143
|
+ savePoint({
|
|
144
|
+ event: 'share',
|
|
145
|
+ eventType: 'building',
|
|
146
|
+ propertyName: '项目详情分享',
|
|
147
|
+ consultantId: consultantId,
|
|
148
|
+ sharePersonId: personId,
|
|
149
|
+ targetId: buildingId,
|
|
150
|
+ data: '{}'
|
|
151
|
+ }).then(res => {
|
|
152
|
+ console.log('项目详情分享')
|
|
153
|
+ })
|
|
154
|
+ const consultant = personType == ROLE_CODE['CONSULTANT'] ? personId : ""
|
|
155
|
+ return {
|
|
156
|
+ title: shareContents[0].shareContentTitle,//分享内容
|
|
157
|
+ path: `/pages/project/detail/index?id=${buildingId}&from=building_share&recommender=${personId}&consultant=${consultant}`,//分享地址
|
|
158
|
+ imageUrl: shareContents[0].shareContentImg
|
|
159
|
+ }
|
|
160
|
+ }
|
125
|
161
|
|
126
|
162
|
initPageData(id) {
|
127
|
163
|
console.log('----项目ID---->', id)
|
|
@@ -151,6 +187,17 @@ export default class Index extends Component {
|
151
|
187
|
console.log('项目详情')
|
152
|
188
|
})
|
153
|
189
|
})
|
|
190
|
+ const router = Taro.getStorageSync('router')
|
|
191
|
+ const consultant = this.$router.params.consultant || router.query.consultant
|
|
192
|
+ if (consultant) {
|
|
193
|
+ this.reportClientFn()
|
|
194
|
+ getCardDetail(consultant).then(res => {
|
|
195
|
+ this.setState({
|
|
196
|
+ consultData: res,
|
|
197
|
+ consultShow: true
|
|
198
|
+ })
|
|
199
|
+ })
|
|
200
|
+ }
|
154
|
201
|
}
|
155
|
202
|
|
156
|
203
|
loadHelpGroupList() {
|
|
@@ -293,33 +340,6 @@ export default class Index extends Component {
|
293
|
340
|
this.navigateTo('/pages/card/fans/index?type=item&id=' + buildingId)
|
294
|
341
|
}
|
295
|
342
|
|
296
|
|
- onShareAppMessage = () => {
|
297
|
|
- console.log(this.props, "his.props")
|
298
|
|
- const {
|
299
|
|
- projectDetail: { shareContents, buildingName, buildingId, poster },
|
300
|
|
- userInfo: { person: { personId, personType, userId } }
|
301
|
|
- } = this.props
|
302
|
|
- const consultantId = personType == ROLE_CODE['CONSULTANT'] ? userId : ""
|
303
|
|
- // 分享埋点
|
304
|
|
- addItemShareNum(buildingId)
|
305
|
|
- savePoint({
|
306
|
|
- event: 'share',
|
307
|
|
- eventType: 'building',
|
308
|
|
- propertyName: '项目详情分享',
|
309
|
|
- consultantId: consultantId,
|
310
|
|
- sharePersonId: personId,
|
311
|
|
- targetId: buildingId,
|
312
|
|
- data: '{}'
|
313
|
|
- }).then(res => {
|
314
|
|
- console.log('项目详情分享')
|
315
|
|
- })
|
316
|
|
- const consultant = personType == ROLE_CODE['CONSULTANT'] ? personId : ""
|
317
|
|
- return {
|
318
|
|
- title: shareContents[0].shareContentTitle,//分享内容
|
319
|
|
- path: `/pages/project/detail/index?id=${buildingId}&from=building_share&recommender=${personId}&consultant=${consultant}`,//分享地址
|
320
|
|
- imageUrl: shareContents[0].shareContentImg
|
321
|
|
- }
|
322
|
|
- }
|
323
|
343
|
|
324
|
344
|
getPhoneNumber(e, item) {
|
325
|
345
|
getUserPhone(e, (phoneNumber) => {
|
|
@@ -466,19 +486,19 @@ export default class Index extends Component {
|
466
|
486
|
}
|
467
|
487
|
|
468
|
488
|
toRecomonedPage() {
|
469
|
|
- const {
|
470
|
|
- userInfo: { person: { personType } }
|
471
|
|
- } = this.props
|
472
|
|
- if (personType === ROLE_CODE['DRIFT']) {
|
473
|
|
- // 游客或者客户 区别是否有电话|| personType === ROLE_CODE['CUSTOMER']
|
474
|
|
- Taro.navigateTo({
|
475
|
|
- url: `/pages/agent/become/index`
|
476
|
|
- })
|
477
|
|
- } else {
|
478
|
|
- Taro.navigateTo({
|
479
|
|
- url: `/pages/agent/recommend/index?type=projectDeatil`
|
480
|
|
- })
|
481
|
|
- }
|
|
489
|
+ // const {
|
|
490
|
+ // userInfo: { person: { personType } }
|
|
491
|
+ // } = this.props
|
|
492
|
+ // if (personType === ROLE_CODE['DRIFT']) {
|
|
493
|
+ // // 游客或者客户 区别是否有电话|| personType === ROLE_CODE['CUSTOMER']
|
|
494
|
+ // Taro.navigateTo({
|
|
495
|
+ // url: `/pages/agent/become/index`
|
|
496
|
+ // })
|
|
497
|
+ // } else {
|
|
498
|
+ Taro.navigateTo({
|
|
499
|
+ url: `/pages/agent/recommend/index?type=projectDeatil`
|
|
500
|
+ })
|
|
501
|
+ // }
|
482
|
502
|
}
|
483
|
503
|
|
484
|
504
|
toHome() {
|
|
@@ -690,11 +710,8 @@ export default class Index extends Component {
|
690
|
710
|
|
691
|
711
|
const listimg = list.filter(item => item.buildingImgList.length > 0)
|
692
|
712
|
|
693
|
|
-
|
694
|
713
|
return (
|
695
|
|
-
|
696
|
|
-
|
697
|
|
- <Block> {console.log(list, 'list')}
|
|
714
|
+ <Block>
|
698
|
715
|
{listimg.length > 0 &&
|
699
|
716
|
(
|
700
|
717
|
<View className='photos__type'>
|
|
@@ -708,7 +725,7 @@ export default class Index extends Component {
|
708
|
725
|
const buildingImgList = item.buildingImgList
|
709
|
726
|
const buildingImgUrl = buildingImgList.length > 0 ? buildingImgList[0].url : null
|
710
|
727
|
|
711
|
|
- console.log(buildingImgUrl, 'buildingImgUrl')
|
|
728
|
+ // console.log(buildingImgUrl, 'buildingImgUrl')
|
712
|
729
|
|
713
|
730
|
// if (buildingImgUrl != null) {
|
714
|
731
|
return (<View key={index + "listimg"}>
|
|
@@ -740,7 +757,7 @@ export default class Index extends Component {
|
740
|
757
|
</Block>
|
741
|
758
|
)
|
742
|
759
|
}
|
743
|
|
- tomapDetail() {
|
|
760
|
+ tomapDetail(e) {
|
744
|
761
|
const { buildingId } = this.state
|
745
|
762
|
Taro.navigateTo({
|
746
|
763
|
url: `/pages/project/detail/map?id=` + buildingId
|
|
@@ -752,7 +769,7 @@ export default class Index extends Component {
|
752
|
769
|
}
|
753
|
770
|
|
754
|
771
|
return (
|
755
|
|
- <View style="margin-bottom:-5px" onClick={this.tomapDetail}>
|
|
772
|
+ <View onClick={this.tomapDetail}>
|
756
|
773
|
<View className="section circum">
|
757
|
774
|
<View className="section-head">
|
758
|
775
|
<Text className="section-head__title">位置及周边配套</Text>
|
|
@@ -959,7 +976,6 @@ export default class Index extends Component {
|
959
|
976
|
{
|
960
|
977
|
activityList.length > 0 && (
|
961
|
978
|
<View className="activity" >
|
962
|
|
-
|
963
|
979
|
<View className="section-head">
|
964
|
980
|
<Text className="section-head__title" style={{ margin: '10rpx 0 40rpx 35rpx' }}>热门活动</Text>
|
965
|
981
|
<View className="section-head__more" style={{ marginRight: '20rpx' }} onClick={this.handleActivityMoreClick}>
|
|
@@ -1116,7 +1132,7 @@ export default class Index extends Component {
|
1116
|
1132
|
}
|
1117
|
1133
|
|
1118
|
1134
|
changeCurrent(current) {
|
1119
|
|
- console.log(current, 'current')
|
|
1135
|
+ // console.log(current, 'current')
|
1120
|
1136
|
this.setState({
|
1121
|
1137
|
current: current + 1
|
1122
|
1138
|
})
|