|
@@ -27,6 +27,8 @@ import { connect } from '@tarojs/redux'
|
27
|
27
|
import { dispatchProjectDetail } from '@actions/project'
|
28
|
28
|
import getUserPhone from '@utils/getUserPhone'
|
29
|
29
|
import { ROLE_CODE } from '@constants/user'
|
|
30
|
+import { getCardDetail } from '@services/card'
|
|
31
|
+import Consultant from '@components/consultant'
|
30
|
32
|
const buildBg = 'https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/images/buildbg.png'
|
31
|
33
|
const dotImg = require('@assets/dot.png')
|
32
|
34
|
|
|
@@ -61,6 +63,8 @@ export default class Index extends Component {
|
61
|
63
|
albumCurrent: 0,
|
62
|
64
|
videoPlayShow: 'flex',
|
63
|
65
|
grantPhoneVisible: false, // 授权手机弹框
|
|
66
|
+ consultData: {}, // 分享的置业顾问信息
|
|
67
|
+ consultShow: false // 置业顾问悬浮框显示隐藏
|
64
|
68
|
}
|
65
|
69
|
|
66
|
70
|
componentWillMount() {
|
|
@@ -69,19 +73,31 @@ export default class Index extends Component {
|
69
|
73
|
// const options = wx.getLaunchOptionsSync()
|
70
|
74
|
// console.log('-------options----->', options)
|
71
|
75
|
// if (sceneInShare(options.scene)) {
|
72
|
|
- const { person = {} } = this.props.userInfo || {}
|
73
|
|
- console.log('-------person----->', person)
|
74
|
|
- if ((person.tel || person.phone) && (person.avatarurl || '').indexOf('wx.qlogo.cn') === -1) {
|
75
|
|
- Taro.reLaunch({ url: '/pages/auth/index' })
|
76
|
|
- return
|
77
|
|
- }
|
78
|
|
-
|
79
|
|
- this.setState({
|
80
|
|
- grantPhoneVisible: true,
|
|
76
|
+ const router = Taro.getStorageSync('router')
|
|
77
|
+ const consultant = this.$router.params.consultant || router.query.consultant
|
|
78
|
+ if (consultant) {
|
|
79
|
+ console.log(consultant, "$$$$$$$$$$$$$$$$$$$$$$$$$$$4444")
|
|
80
|
+ getCardDetail(consultant).then(res => {
|
|
81
|
+ console.log(res, "$$$$$$$$$$$$$$$$$$$$$$$$$$$")
|
|
82
|
+ this.setState({
|
|
83
|
+ consultData: res,
|
|
84
|
+ consultShow: true
|
|
85
|
+ })
|
81
|
86
|
})
|
|
87
|
+ }
|
|
88
|
+ const { person = {} } = this.props.userInfo || {}
|
|
89
|
+ console.log('-------person----->', person)
|
|
90
|
+ if ((person.tel || person.phone) && (person.avatarurl || '').indexOf('wx.qlogo.cn') === -1) {
|
|
91
|
+ Taro.reLaunch({ url: '/pages/auth/index' })
|
|
92
|
+ return
|
|
93
|
+ }
|
|
94
|
+
|
|
95
|
+ this.setState({
|
|
96
|
+ grantPhoneVisible: true,
|
|
97
|
+ })
|
82
|
98
|
// }
|
83
|
99
|
|
84
|
|
- const router = Taro.getStorageSync('router')
|
|
100
|
+
|
85
|
101
|
const id = this.$router.params.id || router.query.id
|
86
|
102
|
|
87
|
103
|
// 没有找到 id , 再重新找一次
|
|
@@ -291,10 +307,11 @@ export default class Index extends Component {
|
291
|
307
|
}).then(res => {
|
292
|
308
|
console.log('项目详情分享')
|
293
|
309
|
})
|
294
|
|
-
|
|
310
|
+ const router = Taro.getStorageSync('router')
|
|
311
|
+ const consultant = this.$router.params.consultant || router.query.consultant || " "
|
295
|
312
|
return {
|
296
|
313
|
title: shareContents[0].shareContentTitle,//分享内容
|
297
|
|
- path: `/pages/project/detail/index?id=${buildingId}&from=building_share&recommender=${personId}`,//分享地址
|
|
314
|
+ path: `/pages/project/detail/index?id=${buildingId}&from=building_share&recommender=${personId}&consultant=${consultant}`,//分享地址
|
298
|
315
|
imageUrl: shareContents[0].shareContentImg
|
299
|
316
|
}
|
300
|
317
|
}
|
|
@@ -1056,17 +1073,16 @@ export default class Index extends Component {
|
1056
|
1073
|
}
|
1057
|
1074
|
|
1058
|
1075
|
render() {
|
1059
|
|
- const { posterStatus, posterData, loaded, btnstate, grantPhoneVisible } = this.state
|
|
1076
|
+ const { posterStatus, posterData, loaded, btnstate, grantPhoneVisible, consultData, consultShow } = this.state
|
1060
|
1077
|
const { projectDetail, userInfo } = this.props
|
1061
|
1078
|
const { uvList = {} } = projectDetail
|
1062
|
1079
|
const { total = 0, records = [] } = uvList
|
1063
|
1080
|
const openDate = projectDetail.openingDate ? dayjs(projectDetail.openingDate).locale('zh-cn').format('YYYY年M月D日') : '暂无'
|
1064
|
|
-
|
1065
|
1081
|
return (
|
1066
|
1082
|
<Block>
|
1067
|
1083
|
{
|
1068
|
1084
|
(grantPhoneVisible && userInfo.person.personId && !userInfo.person.phone) &&
|
1069
|
|
- <AchievePhone user={userInfo.person} onSuccess={this.handleAuthPhoneSuccess}></AchievePhone>
|
|
1085
|
+ <AchievePhone user={person} onSuccess={this.handleAuthPhoneSuccess}></AchievePhone>
|
1070
|
1086
|
}
|
1071
|
1087
|
{
|
1072
|
1088
|
loaded && (
|
|
@@ -1217,7 +1233,10 @@ export default class Index extends Component {
|
1217
|
1233
|
<Text className="iconfont icon-shouyeshouye"></Text>
|
1218
|
1234
|
<Text className="text">首页</Text>
|
1219
|
1235
|
</View> */}
|
1220
|
|
- <BackHomeBtn></BackHomeBtn>
|
|
1236
|
+ <BackHomeBtn style={consultShow ? "bottom:320rpx" : ''}></BackHomeBtn>
|
|
1237
|
+ {
|
|
1238
|
+ consultShow && <Consultant style="bottom:170rpx" personId={userInfo.person.personId} name={userInfo.person.name || userInfo.person.nickname} data={consultData}></Consultant>
|
|
1239
|
+ }
|
1221
|
1240
|
</View>
|
1222
|
1241
|
)
|
1223
|
1242
|
}
|