Ver código fonte

静态页面

1002884655 3 anos atrás
pai
commit
5a2250f163

+ 0
- 4
src/pages/index/buildingDetail/components/DetailBottom/index.jsx Ver arquivo

@@ -88,10 +88,6 @@ export default function DetailBottom (props) {
88 88
               <Image mode='heightFix' src={require('@/assets/buildingDetail-icon2.png')}></Image>
89 89
               <text>一键推荐</text>
90 90
             </view>
91
-            <view className='Item'>
92
-              <Image mode='heightFix' src={require('@/assets/buildingDetail-icon1.png')}></Image>
93
-              <text>一键带看</text>
94
-            </view>
95 91
           </AuthRole>
96 92
         </view>
97 93
         <view className='Btn'>

+ 7
- 7
src/pages/index/components/HotRecommend/index.jsx Ver arquivo

@@ -1,14 +1,13 @@
1 1
 import { useState, useEffect } from 'react'
2 2
 import { useSelector } from 'react-redux'
3 3
 import Taro from '@tarojs/taro'
4
-import { fetch } from '@/utils/request'
5
-import { API_ACTIVITY_LIST } from '@/constants/api'
6
-import { queryActivityList, getActNewList } from '@/services/activity'
7
-import './index.scss'
4
+import { queryActivityList } from '@/services/activity'
8 5
 import '@/assets/css/iconfont.css'
6
+import './index.scss'
9 7
 
10
-export default function HotRecommend () {
8
+export default function HotRecommend (props) {
11 9
 
10
+  const { change = () => {} } = props
12 11
   const city = useSelector(state => state.city)
13 12
   const [MenuList] = useState([{ name: '热门活动', id: 'dymic' }, { name: '热门团房', id: 'house' }])
14 13
   const [CurrentId, setCurrentId] = useState('dymic')
@@ -24,8 +23,9 @@ export default function HotRecommend () {
24 23
   const GetRecommendActivity = () => {
25 24
     
26 25
       queryActivityList({home:1,cityId: city.curCity.id}).then((res)=>{
27
-        console.log(res,'-----------------')
28
-        setList(res.list)
26
+        const resArr = res.list || []
27
+        setList(resArr)
28
+        change(!!resArr.length)
29 29
       })
30 30
   }
31 31
 

+ 4
- 2
src/pages/index/components/LiveSale/index.jsx Ver arquivo

@@ -5,11 +5,12 @@ import { useSelector } from 'react-redux'
5 5
 import { fetch } from '@/utils/request'
6 6
 import { getImgURL } from '@/utils/image'
7 7
 import { API_LIVE_LIST } from '@/constants/api'
8
-import './index.scss'
9 8
 import '@/assets/css/iconfont.css'
9
+import './index.scss'
10 10
 
11
-export default function LiveSale () {
11
+export default function LiveSale (props) {
12 12
 
13
+  const { change = () => {} } = props
13 14
   const city = useSelector(state => state.city)
14 15
   const [MenuList] = useState([{ name: '全部', id: 1 }, { name: '预告', id: 2 }, { name: '直播中', id: 3 }, { name: '新房推荐', id: 4 }])
15 16
   const [CurrentId, setCurrentId] = useState(1)
@@ -24,6 +25,7 @@ export default function LiveSale () {
24 25
   const GetLiveList = () => {
25 26
     fetch({url: API_LIVE_LIST, method: 'get', payload: {cityId: city.curCity.id, pageNum: 1, pageSize: 20}}).then((res) => {
26 27
       setPageList(res.records || [])
28
+      change(!!(res.records || []).length)
27 29
     })
28 30
   }
29 31
 

+ 14
- 4
src/pages/index/index.jsx Ver arquivo

@@ -23,6 +23,8 @@ export default withLayout(() => {
23 23
   const [ProjectList, setProjectList] = useState([])
24 24
   const [IsPull, setPull] = useState(false)
25 25
   const [PullTimer, setPullTimer] = useState(null)
26
+  const [ShowHotRecommend, setShowHotRecommend] = useState(false)
27
+  const [ShowLive, setShowLive] = useState(false)
26 28
 
27 29
   useEffect(() => {
28 30
     if (city.curCity.name) {
@@ -47,6 +49,14 @@ export default withLayout(() => {
47 49
     setPull(true)
48 50
   }
49 51
 
52
+  const HotRecommendChange = (e) => {
53
+    setShowHotRecommend(e)
54
+  }
55
+
56
+  const LiveChange = (e) => {
57
+    setShowLive(e)
58
+  }
59
+
50 60
   useEffect(() => { // 下拉刷新触发
51 61
     if (IsPull) {
52 62
       clearTimeout(PullTimer)
@@ -82,15 +92,15 @@ export default withLayout(() => {
82 92
           </view>
83 93
 
84 94
           {/* 热门推荐 */}
85
-          <view className='HotRecommend'>
95
+          <view className='HotRecommend' style={{display: ShowHotRecommend ? 'block' : 'none'}}>
86 96
             <ColumnTitle Name='热门推荐' Icon='icon-shoucang'></ColumnTitle>
87
-            <HotRecommend></HotRecommend>
97
+            <HotRecommend change={HotRecommendChange}></HotRecommend>
88 98
           </view>
89 99
 
90 100
           {/* 直播购房 */}
91
-          <view className='LiveSale'>
101
+          <view className='LiveSale' style={{display: ShowLive ? 'block' : 'none'}}>
92 102
             <ColumnTitle Name='直播购房' Icon='icon-yinpin' ShowMore ToMore={() => { Taro.switchTab({ url: `/pages/video/index` }) }}></ColumnTitle>
93
-            <LiveSale></LiveSale>
103
+            <LiveSale change={LiveChange}></LiveSale>
94 104
           </view>
95 105
 
96 106
           {/* 全部项目 */}