|
|
@ -13,6 +13,7 @@ const BrandInfo: FC = () => { |
|
|
|
const {id} = useRouter().params as unknown as Params |
|
|
|
const {id} = useRouter().params as unknown as Params |
|
|
|
const [brandInfo, setBrandInfo] = useState<BrandRecord>() |
|
|
|
const [brandInfo, setBrandInfo] = useState<BrandRecord>() |
|
|
|
const [articleList, setArticleList] = useState<ArticleRecord[]>() |
|
|
|
const [articleList, setArticleList] = useState<ArticleRecord[]>() |
|
|
|
|
|
|
|
const [curIndex,setCurIndex] = useState<number>(1) |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
|
getData() |
|
|
|
getData() |
|
|
@ -30,22 +31,26 @@ const BrandInfo: FC = () => { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function onChange(e){ |
|
|
|
|
|
|
|
console.log(e) |
|
|
|
|
|
|
|
setCurIndex(+e.detail.current+1) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<View className='flex flex-column '> |
|
|
|
<View className='flex flex-column '> |
|
|
|
{ |
|
|
|
|
|
|
|
<Swiper |
|
|
|
<Swiper |
|
|
|
className={styles['swiper']} |
|
|
|
className={styles['swiper']} |
|
|
|
indicatorColor='#999' |
|
|
|
indicatorColor='#999' |
|
|
|
indicatorActiveColor='#333' |
|
|
|
indicatorActiveColor='#333' |
|
|
|
indicatorDots |
|
|
|
indicatorDots |
|
|
|
|
|
|
|
onChange={onChange} |
|
|
|
> |
|
|
|
> |
|
|
|
<SwiperItem> |
|
|
|
{ brandInfo?.introductory_video_resource?.url && <SwiperItem> |
|
|
|
<Video |
|
|
|
<Video |
|
|
|
style={{width: '750rpx', height: '600rpx'}} |
|
|
|
style={{width: '750rpx', height: '600rpx'}} |
|
|
|
playBtnPosition={"center"} |
|
|
|
playBtnPosition={"center"} |
|
|
|
id='video' |
|
|
|
id='video' |
|
|
|
src={brandInfo?.introductory_video_resource?.url || ''} |
|
|
|
src={brandInfo?.introductory_video_resource?.url} |
|
|
|
initialTime={0} |
|
|
|
initialTime={0} |
|
|
|
controls={true} |
|
|
|
controls={true} |
|
|
|
enableProgressGesture={false} |
|
|
|
enableProgressGesture={false} |
|
|
@ -54,16 +59,17 @@ const BrandInfo: FC = () => { |
|
|
|
loop={false} |
|
|
|
loop={false} |
|
|
|
muted={false} |
|
|
|
muted={false} |
|
|
|
/> |
|
|
|
/> |
|
|
|
</SwiperItem>) |
|
|
|
</SwiperItem>} |
|
|
|
{brandInfo?.brand_album?.length |
|
|
|
{brandInfo?.brand_album?.length |
|
|
|
&& brandInfo?.brand_album?.map((d) => |
|
|
|
&& brandInfo?.brand_album?.split(',').map((d) => |
|
|
|
<SwiperItem> |
|
|
|
<SwiperItem> |
|
|
|
<Image src={d}></Image> |
|
|
|
<Image mode={'aspectFill'} style={{width:'750rpx',height:'600rpx'}} src={d}></Image> |
|
|
|
</SwiperItem>) |
|
|
|
</SwiperItem>) |
|
|
|
} |
|
|
|
} |
|
|
|
</Swiper> |
|
|
|
</Swiper> |
|
|
|
|
|
|
|
<View className={styles.curIndexBox}> |
|
|
|
} |
|
|
|
<Text>{curIndex} / {brandInfo?.brand_album?.split(',').length + ((brandInfo && brandInfo.introductory_video_resource) ? 1:0)}</Text> |
|
|
|
|
|
|
|
</View> |
|
|
|
<View className={styles['body']}> |
|
|
|
<View className={styles['body']}> |
|
|
|
<View className={styles['top']}> |
|
|
|
<View className={styles['top']}> |
|
|
|
<Text className={styles['title']}>{brandInfo?.name}</Text> |
|
|
|
<Text className={styles['title']}>{brandInfo?.name}</Text> |
|
|
|