浏览代码

静态页面

1002884655 3 年前
父节点
当前提交
5a2250f163

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

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

+ 7
- 7
src/pages/index/components/HotRecommend/index.jsx 查看文件

1
 import { useState, useEffect } from 'react'
1
 import { useState, useEffect } from 'react'
2
 import { useSelector } from 'react-redux'
2
 import { useSelector } from 'react-redux'
3
 import Taro from '@tarojs/taro'
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
 import '@/assets/css/iconfont.css'
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
   const city = useSelector(state => state.city)
11
   const city = useSelector(state => state.city)
13
   const [MenuList] = useState([{ name: '热门活动', id: 'dymic' }, { name: '热门团房', id: 'house' }])
12
   const [MenuList] = useState([{ name: '热门活动', id: 'dymic' }, { name: '热门团房', id: 'house' }])
14
   const [CurrentId, setCurrentId] = useState('dymic')
13
   const [CurrentId, setCurrentId] = useState('dymic')
24
   const GetRecommendActivity = () => {
23
   const GetRecommendActivity = () => {
25
     
24
     
26
       queryActivityList({home:1,cityId: city.curCity.id}).then((res)=>{
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 查看文件

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

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

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