浏览代码

静态页面

1002884655 3 年前
父节点
当前提交
708a3cf374

+ 1
- 1
src/pages/index/addedValueService/formData.js 查看文件

9
   },
9
   },
10
   {
10
   {
11
     question: '房屋现状?',
11
     question: '房屋现状?',
12
-    key: 'status',
12
+    key: 'houseStatus',
13
     type: 'checkbox',
13
     type: 'checkbox',
14
     result: '',
14
     result: '',
15
     resultId: null,
15
     resultId: null,

+ 26
- 25
src/pages/index/buildingDetail/components/DetailBottom/index.jsx 查看文件

2
 import Taro from '@tarojs/taro'
2
 import Taro from '@tarojs/taro'
3
 import { useSelector } from 'react-redux'
3
 import { useSelector } from 'react-redux'
4
 import { Image } from '@tarojs/components'
4
 import { Image } from '@tarojs/components'
5
-import AuthRole from '@/components/Auth/AuthRole'
6
-// import Poster from '@/components/Poster'
7
 import { queryActivityList } from '@/services/activity'
5
 import { queryActivityList } from '@/services/activity'
8
-import { ROLE_CODE } from '@/constants/user'
9
 import './index.scss'
6
 import './index.scss'
10
 
7
 
11
 export default function DetailBottom (props) {
8
 export default function DetailBottom (props) {
12
   const { Info = {}, onPoster } = props
9
   const { Info = {}, onPoster } = props
13
 
10
 
11
+  const user = useSelector(state => state.user)
12
+
14
   // 当前推荐置业
13
   // 当前推荐置业
15
   const { consultant } = useSelector(s => s.system)
14
   const { consultant } = useSelector(s => s.system)
16
   // const [showPoster, setShowPoster] = useState(false)
15
   // const [showPoster, setShowPoster] = useState(false)
40
   }
39
   }
41
 
40
 
42
   const handleRecommender = () => {
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
   const handleTuanfang = () => {
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
   useEffect(() => {
65
   useEffect(() => {
75
             <Image mode='heightFix' src={require('@/assets/buildingDetail-icon3.png')}></Image>
82
             <Image mode='heightFix' src={require('@/assets/buildingDetail-icon3.png')}></Image>
76
             <text>一键海报</text>
83
             <text>一键海报</text>
77
           </view>
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
         </view>
93
         </view>
93
         <view className='Btn'>
94
         <view className='Btn'>
94
           <text onClick={handleChat}>一键咨询</text>
95
           <text onClick={handleChat}>一键咨询</text>

+ 4
- 4
src/pages/index/buildingDetail/index.jsx 查看文件

93
 
93
 
94
                 {/* 特价房源 */}
94
                 {/* 特价房源 */}
95
                 {
95
                 {
96
-                  DetailInfo?.specialRoomList.length > 0 &&
96
+                  (DetailInfo?.specialRoomList || []).length > 0 &&
97
                   <view className='SpecialPriceHouse' style={{minHeight: 0}}>
97
                   <view className='SpecialPriceHouse' style={{minHeight: 0}}>
98
                     <SpecialPriceHouse List={DetailInfo?.specialRoomList}></SpecialPriceHouse>
98
                     <SpecialPriceHouse List={DetailInfo?.specialRoomList}></SpecialPriceHouse>
99
                   </view>
99
                   </view>
101
 
101
 
102
                 {/* 项目动态 */}
102
                 {/* 项目动态 */}
103
                 {
103
                 {
104
-                  DetailInfo?.trendList.length > 0 &&
104
+                  (DetailInfo?.trendList || []).length > 0 &&
105
                   <view className='ProjectDynamic' style={{minHeight: 0}}>
105
                   <view className='ProjectDynamic' style={{minHeight: 0}}>
106
                     <ProjectDynamic List={DetailInfo?.trendList}></ProjectDynamic>
106
                     <ProjectDynamic List={DetailInfo?.trendList}></ProjectDynamic>
107
                   </view>
107
                   </view>
122
 
122
 
123
                 {/* 户型介绍 */}
123
                 {/* 户型介绍 */}
124
                 {
124
                 {
125
-                  houseTypeImages.length > 0 &&
125
+                  (houseTypeImages.length || []) > 0 &&
126
                   <view className='HouseTypeIntro' style={{minHeight: 0}}>
126
                   <view className='HouseTypeIntro' style={{minHeight: 0}}>
127
                     <HouseTypeIntro Info={houseTypeImages}></HouseTypeIntro>
127
                     <HouseTypeIntro Info={houseTypeImages}></HouseTypeIntro>
128
                   </view>
128
                   </view>
148
 
148
 
149
                 {/* 相册 */}
149
                 {/* 相册 */}
150
                 {
150
                 {
151
-                  PictureList.length > 0 &&
151
+                  (PictureList || []).length > 0 &&
152
                   <view className='Pictures'>
152
                   <view className='Pictures'>
153
                     <Pictures List={PictureList}></Pictures>
153
                     <Pictures List={PictureList}></Pictures>
154
                   </view>
154
                   </view>