1002884655 3 lat temu
rodzic
commit
708a3cf374

+ 1
- 1
src/pages/index/addedValueService/formData.js Wyświetl plik

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

+ 26
- 25
src/pages/index/buildingDetail/components/DetailBottom/index.jsx Wyświetl plik

@@ -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>

+ 4
- 4
src/pages/index/buildingDetail/index.jsx Wyświetl plik

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