|
|
@ -1,7 +1,7 @@ |
|
|
|
import '~/styles/home.scss' |
|
|
|
import ProductItem, { NotOpenProductItem } from '~/components/ProductItem' |
|
|
|
import { useRouter } from '~/hooks/useRouter' |
|
|
|
import { Button, CountDown, Swiper, SwiperInstance } from 'react-vant' |
|
|
|
import { Button, CountDown, PullRefresh, Swiper, SwiperInstance } from 'react-vant' |
|
|
|
import { useEffect, useRef } from 'react' |
|
|
|
import { observer } from 'mobx-react' |
|
|
|
import store from '~/store' |
|
|
@ -14,13 +14,29 @@ const Home = () => { |
|
|
|
const like = useLike() |
|
|
|
const swiperRef = useRef<SwiperInstance>(null) |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
const onRefresh = () => { |
|
|
|
return new Promise((resolve) => { |
|
|
|
getData() |
|
|
|
setTimeout(() => { |
|
|
|
resolve(true) |
|
|
|
},2000) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
const getData = () => { |
|
|
|
store.getMarketNft("sellNft") |
|
|
|
store.getMarketNft("auctionNft") |
|
|
|
store.getMarketNft("issueNft") |
|
|
|
} |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
getData() |
|
|
|
}, []) |
|
|
|
|
|
|
|
return ( |
|
|
|
<PullRefresh |
|
|
|
onRefresh={onRefresh} |
|
|
|
> |
|
|
|
<div className="home"> |
|
|
|
{issueNft.length > 0 && <div className='fz-20 mt-2 plr-3'>發行搶購</div>} |
|
|
|
<div className='row-between mt-2 plr-5px'> |
|
|
@ -147,6 +163,8 @@ const Home = () => { |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
</PullRefresh> |
|
|
|
|
|
|
|
) |
|
|
|
} |
|
|
|
|
|
|
|