You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
873 B
31 lines
873 B
import { useEffect, useState } from 'react'
|
|
import { Swiper } from '@nutui/nutui-react-taro'
|
|
import {CmsAd} from "@/api/cms/cmsAd/model";
|
|
import {Image} from '@nutui/nutui-react-taro'
|
|
import {getCmsAd} from "@/api/cms/cmsAd";
|
|
|
|
const MyPage = () => {
|
|
const [item, setItem] = useState<CmsAd>()
|
|
const reload = () => {
|
|
getCmsAd(439).then(data => {
|
|
setItem(data)
|
|
})
|
|
}
|
|
|
|
useEffect(() => {
|
|
reload()
|
|
}, [])
|
|
|
|
return (
|
|
<>
|
|
<Swiper defaultValue={0} height={item?.height} indicator style={{ height: item?.height + 'px', display: 'none' }}>
|
|
{item?.imageList?.map((item) => (
|
|
<Swiper.Item key={item}>
|
|
<Image width="100%" height="100%" src={item.url} mode={'scaleToFill'} lazyLoad={false} style={{ height: item.height + 'px' }} />
|
|
</Swiper.Item>
|
|
))}
|
|
</Swiper>
|
|
</>
|
|
)
|
|
}
|
|
export default MyPage
|