调整盲盒

This commit is contained in:
myf 2022-06-22 09:30:55 +08:00
parent 29a3724bba
commit 6aefb4c721
2 changed files with 24 additions and 11 deletions

BIN
build.zip Normal file

Binary file not shown.

View File

@ -14,6 +14,7 @@ import { checkBuyResult } from 'services/blindBox'
import useRefresh from 'hooks/useRefresh' import useRefresh from 'hooks/useRefresh'
import useToast from 'hooks/useToast' import useToast from 'hooks/useToast'
import { UnOpenModel } from 'components/Modal' import { UnOpenModel } from 'components/Modal'
import Empty from 'components/Empty'
import tokens from 'config/constants/tokens' import tokens from 'config/constants/tokens'
import { ListProp } from 'types/blindBox' import { ListProp } from 'types/blindBox'
import Header from './component/Header' import Header from './component/Header'
@ -169,6 +170,11 @@ const AuthorizationBtn = styled(Button)`
width: 500px; width: 500px;
} }
` `
const EmptyFlex = styled(Flex)`
width: 100%;
align-items: center;
justify-content: center;
`
const BlindBox: React.FC = () => { const BlindBox: React.FC = () => {
const { t } = useTranslation() const { t } = useTranslation()
@ -357,6 +363,7 @@ const BlindBox: React.FC = () => {
return ( return (
<MainFlex> <MainFlex>
{/* <UnOpenModel /> */} {/* <UnOpenModel /> */}
{blindBoxList && blindBoxList.length > 0 && (
<SwiperDiv <SwiperDiv
color={blindBoxList?.length === 1 ? 'none' : ''} color={blindBoxList?.length === 1 ? 'none' : ''}
onSlideChange={swiperChange} onSlideChange={swiperChange}
@ -368,6 +375,12 @@ const BlindBox: React.FC = () => {
> >
{renderContent()} {renderContent()}
</SwiperDiv> </SwiperDiv>
)}
{blindBoxList && blindBoxList.length === 0 && (
<EmptyFlex>
<Empty />
</EmptyFlex>
)}
</MainFlex> </MainFlex>
) )
} }