|
@@ -5,6 +5,7 @@ import CustomNav from '@/components/CustomNav'
|
5
|
5
|
import Taro from '@tarojs/taro'
|
6
|
6
|
import Card from '../index/components/Card'
|
7
|
7
|
import {getResourceList } from '@/services/home'
|
|
8
|
+import List from '@/components/List';
|
8
|
9
|
import './searchResult.less'
|
9
|
10
|
import withLayout from '@/layouts'
|
10
|
11
|
|
|
@@ -51,10 +52,11 @@ export default withLayout((props) => {
|
51
|
52
|
// 用绝对路径
|
52
|
53
|
Taro.navigateTo({ url: '/pages/search/search' });
|
53
|
54
|
}
|
|
55
|
+ const [total,setTotal]=useState()
|
54
|
56
|
|
55
|
57
|
useEffect(() => {
|
56
|
58
|
getResourceList(queryParams).then((res) => {
|
57
|
|
- setAllList(res.records || [])
|
|
59
|
+ setTotal(res.total)
|
58
|
60
|
})
|
59
|
61
|
}, [queryParams])
|
60
|
62
|
|
|
@@ -82,15 +84,21 @@ export default withLayout((props) => {
|
82
|
84
|
>
|
83
|
85
|
</mp-tabs>
|
84
|
86
|
</view>
|
|
87
|
+ <List
|
|
88
|
+ style={{ height: 'calc(100% - 160px)' }}
|
|
89
|
+ request={getResourceList}
|
|
90
|
+ params={queryParams}
|
|
91
|
+ onDataChange={setAllList}
|
|
92
|
+ >
|
|
93
|
+ <view className='waterfall'>
|
|
94
|
+ {
|
|
95
|
+ alllist.map((item) => <Card key={item.resourceNo} item={item} />)
|
|
96
|
+ }
|
|
97
|
+ </view>
|
|
98
|
+ <view className='botton' style={{display:alllist.length==total?'none':''}}>已经到底了~</view>
|
|
99
|
+ </List>
|
|
100
|
+
|
85
|
101
|
|
86
|
|
- <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{height:'100vh'}} >
|
87
|
|
- <view className="waterfall">
|
88
|
|
- {
|
89
|
|
- alllist?.map((item) => <Card key={item.resourceNo} item={item} />)
|
90
|
|
- }
|
91
|
|
- </view>
|
92
|
|
- <view className='botton'>已经到底了~</view>
|
93
|
|
- </scroll-view>
|
94
|
102
|
</view>
|
95
|
103
|
</view>
|
96
|
104
|
)
|