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