|
@@ -2,15 +2,14 @@ import { useState, useEffect } from 'react'
|
2
|
2
|
import Taro from '@tarojs/taro'
|
3
|
3
|
import { useSelector } from 'react-redux'
|
4
|
4
|
import { Image } from '@tarojs/components'
|
5
|
|
-import AuthRole from '@/components/Auth/AuthRole'
|
6
|
|
-// import Poster from '@/components/Poster'
|
7
|
5
|
import { queryActivityList } from '@/services/activity'
|
8
|
|
-import { ROLE_CODE } from '@/constants/user'
|
9
|
6
|
import './index.scss'
|
10
|
7
|
|
11
|
8
|
export default function DetailBottom (props) {
|
12
|
9
|
const { Info = {}, onPoster } = props
|
13
|
10
|
|
|
11
|
+ const user = useSelector(state => state.user)
|
|
12
|
+
|
14
|
13
|
// 当前推荐置业
|
15
|
14
|
const { consultant } = useSelector(s => s.system)
|
16
|
15
|
// const [showPoster, setShowPoster] = useState(false)
|
|
@@ -40,19 +39,27 @@ export default function DetailBottom (props) {
|
40
|
39
|
}
|
41
|
40
|
|
42
|
41
|
const handleRecommender = () => {
|
43
|
|
- const params = `buildingId=${Info?.buildingId}&buildingName=${Info?.buildingName}`
|
|
42
|
+ if (user.userInfo.person.personType === 'Realty Consultant') {
|
|
43
|
+ const params = `buildingId=${Info?.buildingId}&buildingName=${Info?.buildingName}`
|
44
|
44
|
|
45
|
|
- Taro.navigateTo({
|
46
|
|
- url: `/pages/mine/recommendUser/index?${params}`
|
47
|
|
- })
|
|
45
|
+ Taro.navigateTo({
|
|
46
|
+ url: `/pages/mine/recommendUser/index?${params}`
|
|
47
|
+ })
|
|
48
|
+ } else {
|
|
49
|
+ Taro.showToast({ title: '该功能暂不能为您提供服务', icon: 'none', duration: 2000 })
|
|
50
|
+ }
|
48
|
51
|
}
|
49
|
52
|
|
50
|
53
|
const handleTuanfang = () => {
|
51
|
|
- const id = actList[0].dynamicId
|
|
54
|
+ if ((actList || []).length > 0) {
|
|
55
|
+ const id = actList[0].dynamicId
|
52
|
56
|
|
53
|
|
- Taro.navigateTo({
|
54
|
|
- url: `/pages/index/activityDetail/index?id=${id}`
|
55
|
|
- })
|
|
57
|
+ Taro.navigateTo({
|
|
58
|
+ url: `/pages/index/activityDetail/index?id=${id}`
|
|
59
|
+ })
|
|
60
|
+ } else {
|
|
61
|
+ Taro.showToast({ title: '该功能暂不能为您提供服务', icon: 'none', duration: 2000 })
|
|
62
|
+ }
|
56
|
63
|
}
|
57
|
64
|
|
58
|
65
|
useEffect(() => {
|
|
@@ -75,20 +82,14 @@ export default function DetailBottom (props) {
|
75
|
82
|
<Image mode='heightFix' src={require('@/assets/buildingDetail-icon3.png')}></Image>
|
76
|
83
|
<text>一键海报</text>
|
77
|
84
|
</view>
|
78
|
|
- {
|
79
|
|
- actList.length > 0 && (
|
80
|
|
- <view className='Item' onClick={handleTuanfang}>
|
81
|
|
- <Image mode='heightFix' src={require('@/assets/buildingDetail-icon1.png')}></Image>
|
82
|
|
- <text>一键带看</text>
|
83
|
|
- </view>
|
84
|
|
- )
|
85
|
|
- }
|
86
|
|
- <AuthRole role={ROLE_CODE.CONSULTANT}>
|
87
|
|
- <view className='Item' onClick={handleRecommender}>
|
88
|
|
- <Image mode='heightFix' src={require('@/assets/buildingDetail-icon2.png')}></Image>
|
89
|
|
- <text>一键推荐</text>
|
90
|
|
- </view>
|
91
|
|
- </AuthRole>
|
|
85
|
+ <view className='Item' onClick={handleTuanfang}>
|
|
86
|
+ <Image mode='heightFix' src={require('@/assets/buildingDetail-icon1.png')}></Image>
|
|
87
|
+ <text>一键带看</text>
|
|
88
|
+ </view>
|
|
89
|
+ <view className='Item' onClick={handleRecommender}>
|
|
90
|
+ <Image mode='heightFix' src={require('@/assets/buildingDetail-icon2.png')}></Image>
|
|
91
|
+ <text>一键推荐</text>
|
|
92
|
+ </view>
|
92
|
93
|
</view>
|
93
|
94
|
<view className='Btn'>
|
94
|
95
|
<text onClick={handleChat}>一键咨询</text>
|