|
@@ -5,7 +5,7 @@ import Banner from '@/components/Banner'
|
5
|
5
|
import Notice from '@/components/Notice'
|
6
|
6
|
import PageLoading from '@/components/PageLoading'
|
7
|
7
|
import { useModel } from '@/store'
|
8
|
|
-import { getApplicationList } from '@/services/dogAPI'
|
|
8
|
+import { getApplicationList, getBannerList } from '@/services/dogAPI'
|
9
|
9
|
import withBasic from '@/layouts/withBasic'
|
10
|
10
|
import MenuItem from './components/MenuItem'
|
11
|
11
|
|
|
@@ -24,18 +24,21 @@ const IndexPage = (props) => {
|
24
|
24
|
const { pets, cards } = useModel('userData')
|
25
|
25
|
const [totalApplyNum, setTotalApplyNum] = useState(0)
|
26
|
26
|
const [noticeList, setNoticeList] = useState([])
|
27
|
|
- const banner = [
|
28
|
|
- { imgUrl: 'https://tse3-mm.cn.bing.net/th/id/OIP-C.yd6uU_V7fqswON8cwWUfewHaE7?w=300&h=200&c=7&r=0&o=5&pid=1.7' },
|
29
|
|
- { imgUrl: 'https://tse4-mm.cn.bing.net/th/id/OIP-C.A31N2pd7ApUojqrR6x41bwHaFj?pid=ImgDet&rs=1' },
|
30
|
|
- { imgUrl: 'https://tse1-mm.cn.bing.net/th/id/R-C.413cf61f5c976cdaddafb30e3aeeb547?rik=AJJ41q9z0C1Anw&riu=http%3a%2f%2ffunpicimg.loveinhere.com%2f1008%2f1%2f4770.jpg&ehk=bP4qnBFW9Ha6lXMKKtVhAnkL2hTHv15pjb5oQpAhF6o%3d&risl=&pid=ImgRaw&r=0' },
|
31
|
|
- { imgUrl: 'https://img.zcool.cn/community/01c62e565d10e76ac7253403cbde61.jpg@1280w_1l_2o_100sh.jpg' }
|
32
|
|
- ]
|
|
27
|
+ const [bannerList, setBannerList] = useState([])
|
33
|
28
|
|
34
|
29
|
useEffect(() => {
|
35
|
30
|
getNoticeList({ pageSize: 5 }).then((res) => {
|
36
|
31
|
console.log('res', res);
|
37
|
32
|
setNoticeList(res.records)
|
38
|
33
|
})
|
|
34
|
+
|
|
35
|
+ getApplicationList().then(res => {
|
|
36
|
+ setTotalApplyNum(res.total)
|
|
37
|
+ })
|
|
38
|
+
|
|
39
|
+ getBannerList().then(res => {
|
|
40
|
+ setBannerList(res)
|
|
41
|
+ })
|
39
|
42
|
}, [])
|
40
|
43
|
|
41
|
44
|
const goNoticeList = (e) => {
|
|
@@ -55,7 +58,7 @@ const IndexPage = (props) => {
|
55
|
58
|
>
|
56
|
59
|
<View className='index-page-box'>
|
57
|
60
|
<View style={{ padding: '16px', boxSizing: 'border-box' }}>
|
58
|
|
- <Banner banner={banner} />
|
|
61
|
+ <Banner list={bannerList} />
|
59
|
62
|
</View>
|
60
|
63
|
<View className='border-card-group'>
|
61
|
64
|
<View class='weui-flex'>
|