|
@@ -2,6 +2,8 @@
|
2
|
2
|
import CustomNav from '@/components/CustomNav'
|
3
|
3
|
import { useState, useEffect } from "react";
|
4
|
4
|
import withLayout from '@/layouts'
|
|
5
|
+import List from '@/components/List';
|
|
6
|
+import NoData from '@/components/NoData'
|
5
|
7
|
import { getCollectList } from '@/services/home'
|
6
|
8
|
import MyCollect from '@/components/CollectList/MyCollect'
|
7
|
9
|
import './style.less'
|
|
@@ -9,29 +11,49 @@ import './style.less'
|
9
|
11
|
export default withLayout((props) => {
|
10
|
12
|
const { router, person, location } = props
|
11
|
13
|
const [collectContent, setCollectContent] = useState([])
|
|
14
|
+ const [queryParams, setQueryParams] = useState({ location: location, pageNum: 1, pageSize: 10 })
|
12
|
15
|
|
13
|
|
- useEffect(() => {
|
14
|
|
- getCollectList({
|
15
|
|
- pageNum: 1,
|
16
|
|
- pageSize: 99,
|
17
|
|
- location: location,
|
18
|
|
-
|
19
|
|
- }).then(val => {
|
20
|
|
- setCollectContent(val.records)
|
21
|
|
- })
|
22
|
|
- }, [location])
|
|
16
|
+ // useEffect(() => {
|
|
17
|
+ // getCollectList({
|
|
18
|
+ // pageNum: 1,
|
|
19
|
+ // pageSize: 99,
|
|
20
|
+ // location: location,
|
|
21
|
+ // }).then(val => {
|
|
22
|
+ // setCollectContent(val.records)
|
|
23
|
+ // })
|
|
24
|
+ // }, [location])
|
23
|
25
|
|
24
|
26
|
return (
|
25
|
|
- <view className='box-content'>
|
26
|
|
- <CustomNav title='我的收藏' />
|
27
|
|
- <view >
|
|
27
|
+ <view className='page-index box-content'>
|
|
28
|
+ <view className='index-navbar'>
|
|
29
|
+ <CustomNav title='我的收藏' />
|
|
30
|
+ </view>
|
|
31
|
+ <view style={{ overflow: 'hidden', height: '100%' }}>
|
|
32
|
+ <List
|
|
33
|
+ style={{ height: '100%' }}
|
|
34
|
+ request={getCollectList}
|
|
35
|
+ params={queryParams}
|
|
36
|
+ onDataChange={setCollectContent}
|
|
37
|
+ >
|
|
38
|
+ {
|
|
39
|
+ collectContent.length == 0 ?
|
|
40
|
+ <NoData /> :
|
|
41
|
+ <view className='waterfall'>
|
|
42
|
+ {
|
|
43
|
+ collectContent.map((item, index) => { return <MyCollect key={(index)} item={item} /> })
|
|
44
|
+ }
|
|
45
|
+ </view>
|
|
46
|
+ }
|
|
47
|
+ </List>
|
|
48
|
+ </view>
|
|
49
|
+ {/* <view >
|
28
|
50
|
{
|
29
|
51
|
collectContent.map((item, index) => { return <MyCollect key={(index)} item={item} /> })
|
30
|
52
|
}
|
31
|
53
|
</view>
|
32
|
|
- <view className='foot'>
|
|
54
|
+ <view className='foot'>
|
33
|
55
|
已经到底了~
|
34
|
|
- </view>
|
|
56
|
+ </view>*/}
|
35
|
57
|
</view>
|
36
|
58
|
)
|
37
|
59
|
})
|