|
@@ -1,9 +1,11 @@
|
1
|
|
-import Taro from '@tarojs/taro'
|
|
1
|
+import Taro, { useDidShow } from '@tarojs/taro'
|
2
|
2
|
import { React, useState, useEffect, useRef, useMemo } from 'react'
|
3
|
3
|
import iconsearch from '@/assets/icons/housemantj/search.png'
|
4
|
4
|
import locationimg from '@/assets/icons/housemantj/location.png'
|
5
|
5
|
import Tip from '@/components/tip'
|
6
|
6
|
import List from '@/components/List';
|
|
7
|
+import NoData from '@/components/NoData'
|
|
8
|
+import Waterfall from '@/components/MasonryLayout/Waterfall';
|
7
|
9
|
import MasonryLayout from '@/components/MasonryLayout';
|
8
|
10
|
import { getIndexType, getResourceList } from '@/services/home'
|
9
|
11
|
import { random } from '@/utils'
|
|
@@ -11,7 +13,7 @@ import Card from '../components/Card'
|
11
|
13
|
import './less/Recommend.less'
|
12
|
14
|
import { OfficialAccount } from '@tarojs/components'
|
13
|
15
|
|
14
|
|
-const listStyle = { height: 'calc(100% - 145px)' }
|
|
16
|
+const listStyle = { height: '100%' }
|
15
|
17
|
|
16
|
18
|
export default (props) => {
|
17
|
19
|
const { router, person, location } = props
|
|
@@ -31,7 +33,7 @@ export default (props) => {
|
31
|
33
|
|
32
|
34
|
//分类标签
|
33
|
35
|
const tabs = [{ title: '附近' }].concat(typeList.map(x => ({ ...x, title: x.typeName })))
|
34
|
|
- const details=(index,tab)=>{
|
|
36
|
+ const details = (index, tab) => {
|
35
|
37
|
setActiveTab(index)
|
36
|
38
|
setQueryParams({
|
37
|
39
|
...queryParams,
|
|
@@ -41,7 +43,7 @@ export default (props) => {
|
41
|
43
|
//切换上面的标签
|
42
|
44
|
const handleTabChange = (e) => {
|
43
|
45
|
const { index } = e.detail
|
44
|
|
- details(index,tabs[index].typeId||'')
|
|
46
|
+ details(index, tabs[index].typeId || '')
|
45
|
47
|
}
|
46
|
48
|
|
47
|
49
|
const handleDataChange = (value, e) => {
|
|
@@ -61,7 +63,7 @@ export default (props) => {
|
61
|
63
|
//查询分类标签表
|
62
|
64
|
getIndexType({ pageSize: 20 }).then((res) => {
|
63
|
65
|
setTypeList(res.records || [])
|
64
|
|
- details(1,res.records[0].typeId)
|
|
66
|
+ details(1, res.records[0].typeId)
|
65
|
67
|
|
66
|
68
|
})
|
67
|
69
|
}, [])
|
|
@@ -76,7 +78,7 @@ export default (props) => {
|
76
|
78
|
// })
|
77
|
79
|
|
78
|
80
|
return (
|
79
|
|
- <>
|
|
81
|
+ <view style={{ height: '100%', overflow: 'hidden', display: 'flex', flexDirection: 'column' }}>
|
80
|
82
|
<OfficialAccount>s21</OfficialAccount>
|
81
|
83
|
<view className='search' onClick={onSearch} >
|
82
|
84
|
<input className='searchInput' disabled />
|
|
@@ -103,7 +105,7 @@ export default (props) => {
|
103
|
105
|
</mp-tabs>
|
104
|
106
|
</scroll-view>
|
105
|
107
|
</view>
|
106
|
|
-
|
|
108
|
+ <view className={listClass} style={{ flex: '1', overflow: 'hidden' }}>
|
107
|
109
|
<List
|
108
|
110
|
ref={listRef}
|
109
|
111
|
style={listStyle}
|
|
@@ -120,7 +122,7 @@ export default (props) => {
|
120
|
122
|
/>
|
121
|
123
|
</view>
|
122
|
124
|
</List>
|
123
|
|
-
|
124
|
|
- </>
|
|
125
|
+ </view>
|
|
126
|
+ </view>
|
125
|
127
|
)
|
126
|
128
|
}
|