|
@@ -1,96 +1,49 @@
|
1
|
1
|
import { ScrollView, View, Image } from '@tarojs/components'
|
|
2
|
+import { useEffect, useState } from 'react'
|
|
3
|
+
|
2
|
4
|
import Taro from '@tarojs/taro';
|
3
|
5
|
import more from '@/assets/more.png'
|
4
|
6
|
import noticeIcon from '@/assets/noticeIcon.png'
|
|
7
|
+import { getBanner, getNoticeList } from '../../services/dogAPI'
|
|
8
|
+
|
5
|
9
|
import './style.less'
|
6
|
10
|
|
7
|
11
|
export default (props) => {
|
8
|
12
|
const onClick = () => {
|
9
|
13
|
Taro.navigateTo({ url: '/pages/noticeInfo/index' })
|
10
|
14
|
}
|
|
15
|
+ const [noticeList, setNoticeList] = useState([])
|
|
16
|
+
|
|
17
|
+ useEffect(() => {
|
|
18
|
+ getNoticeList({ pageSize: 5 }).then((res) => {
|
|
19
|
+ setNoticeList(res.records)
|
|
20
|
+ })
|
|
21
|
+
|
|
22
|
+ }, [])
|
|
23
|
+ const goDetail = (id) => {
|
|
24
|
+ Taro.navigateTo({ url: `/pages/noticeInfo/index?id=${id}` })
|
|
25
|
+ }
|
|
26
|
+
|
|
27
|
+
|
11
|
28
|
return (
|
12
|
29
|
<>
|
13
|
30
|
<View className='noticeList'>
|
14
|
|
- <View className='notice-item-row' onClick={onClick}>
|
15
|
|
- <Image className='notice' src={noticeIcon} mode='aspectFit' />
|
16
|
|
- <View className='notice-item-body'>
|
17
|
|
- <View className='notice-item-title'>望都人注意!禁养犬只名录正式出炉!快看你家狗狗能养吗</View>
|
18
|
|
- <View className='notice-item-time'>2022.05.26 16:21</View>
|
19
|
|
- </View>
|
20
|
|
- <Image className='action' src={more} mode='aspectFit' />
|
21
|
|
- </View>
|
22
|
|
- <View className='notice-item-row' onClick={onClick}>
|
23
|
|
- <Image className='notice' src={noticeIcon} mode='aspectFit' />
|
24
|
|
- <View className='notice-item-body'>
|
25
|
|
- <View className='notice-item-title'>望都人注意!禁养犬只名录正式出炉!快看你家狗狗能养吗</View>
|
26
|
|
- <View className='notice-item-time'>2022.05.26 16:21</View>
|
27
|
|
- </View>
|
28
|
|
- <Image className='action' src={more} mode='aspectFit' />
|
29
|
|
- </View>
|
30
|
|
- <View className='notice-item-row' onClick={onClick}>
|
31
|
|
- <Image className='notice' src={noticeIcon} mode='aspectFit' />
|
32
|
|
- <View className='notice-item-body'>
|
33
|
|
- <View className='notice-item-title'>望都人注意!禁养犬只名录正式出炉!快看你家狗狗能养吗</View>
|
34
|
|
- <View className='notice-item-time'>2022.05.26 16:21</View>
|
35
|
|
- </View>
|
36
|
|
- <Image className='action' src={more} mode='aspectFit' />
|
37
|
|
- </View>
|
38
|
|
- <View className='notice-item-row' onClick={onClick}>
|
39
|
|
- <Image className='notice' src={noticeIcon} mode='aspectFit' />
|
40
|
|
- <View className='notice-item-body'>
|
41
|
|
- <View className='notice-item-title'>望都人注意!禁养犬只名录正式出炉!快看你家狗狗能养吗</View>
|
42
|
|
- <View className='notice-item-time'>2022.05.26 16:21</View>
|
43
|
|
- </View>
|
44
|
|
- <Image className='action' src={more} mode='aspectFit' />
|
45
|
|
- </View>
|
46
|
|
- <View className='notice-item-row' onClick={onClick}>
|
47
|
|
- <Image className='notice' src={noticeIcon} mode='aspectFit' />
|
48
|
|
- <View className='notice-item-body'>
|
49
|
|
- <View className='notice-item-title'>望都人注意!禁养犬只名录正式出炉!快看你家狗狗能养吗</View>
|
50
|
|
- <View className='notice-item-time'>2022.05.26 16:21</View>
|
51
|
|
- </View>
|
52
|
|
- <Image className='action' src={more} mode='aspectFit' />
|
53
|
|
- </View>
|
54
|
|
- <View className='notice-item-row' onClick={onClick}>
|
55
|
|
- <Image className='notice' src={noticeIcon} mode='aspectFit' />
|
56
|
|
- <View className='notice-item-body'>
|
57
|
|
- <View className='notice-item-title'>望都人注意!禁养犬只名录正式出炉!快看你家狗狗能养吗</View>
|
58
|
|
- <View className='notice-item-time'>2022.05.26 16:21</View>
|
59
|
|
- </View>
|
60
|
|
- <Image className='action' src={more} mode='aspectFit' />
|
61
|
|
- </View>
|
62
|
|
- <View className='notice-item-row' onClick={onClick}>
|
63
|
|
- <Image className='notice' src={noticeIcon} mode='aspectFit' />
|
64
|
|
- <View className='notice-item-body'>
|
65
|
|
- <View className='notice-item-title'>望都人注意!禁养犬只名录正式出炉!快看你家狗狗能养吗</View>
|
66
|
|
- <View className='notice-item-time'>2022.05.26 16:21</View>
|
67
|
|
- </View>
|
68
|
|
- <Image className='action' src={more} mode='aspectFit' />
|
69
|
|
- </View>
|
70
|
|
- <View className='notice-item-row' onClick={onClick}>
|
71
|
|
- <Image className='notice' src={noticeIcon} mode='aspectFit' />
|
72
|
|
- <View className='notice-item-body'>
|
73
|
|
- <View className='notice-item-title'>望都人注意!禁养犬只名录正式出炉!快看你家狗狗能养吗</View>
|
74
|
|
- <View className='notice-item-time'>2022.05.26 16:21</View>
|
75
|
|
- </View>
|
76
|
|
- <Image className='action' src={more} mode='aspectFit' />
|
77
|
|
- </View>
|
78
|
|
- <View className='notice-item-row' onClick={onClick}>
|
79
|
|
- <Image className='notice' src={noticeIcon} mode='aspectFit' />
|
80
|
|
- <View className='notice-item-body'>
|
81
|
|
- <View className='notice-item-title'>望都人注意!禁养犬只名录正式出炉!快看你家狗狗能养吗</View>
|
82
|
|
- <View className='notice-item-time'>2022.05.26 16:21</View>
|
83
|
|
- </View>
|
84
|
|
- <Image className='action' src={more} mode='aspectFit' />
|
85
|
|
- </View>
|
86
|
|
- <View className='notice-item-row' onClick={onClick}>
|
87
|
|
- <Image className='notice' src={noticeIcon} mode='aspectFit' />
|
88
|
|
- <View className='notice-item-body'>
|
89
|
|
- <View className='notice-item-title'>望都人注意!禁养犬只名录正式出炉!快看你家狗狗能养吗</View>
|
90
|
|
- <View className='notice-item-time'>2022.05.26 16:21</View>
|
91
|
|
- </View>
|
92
|
|
- <Image className='action' src={more} mode='aspectFit' />
|
93
|
|
- </View>
|
|
31
|
+ {
|
|
32
|
+ noticeList.map((item, index) => {
|
|
33
|
+ return (
|
|
34
|
+ <View key={index} className='notice-item-row' onClick={() => { goDetail(item.noticeId) }}>
|
|
35
|
+ <Image className='notice' src={noticeIcon} mode='aspectFit' />
|
|
36
|
+ <View className='notice-item-body'>
|
|
37
|
+ <View className='notice-item-title'>{item.title}</View>
|
|
38
|
+ <View className='notice-item-time'>{item.createDate}</View>
|
|
39
|
+ </View>
|
|
40
|
+ <Image className='action' src={more} mode='aspectFit' />
|
|
41
|
+ </View>
|
|
42
|
+ )
|
|
43
|
+ })
|
|
44
|
+ }
|
|
45
|
+
|
|
46
|
+
|
94
|
47
|
</View>
|
95
|
48
|
</>
|
96
|
49
|
)
|