diff --git a/src/api/brand.ts b/src/api/brand.ts index 6770503..4e636c3 100644 --- a/src/api/brand.ts +++ b/src/api/brand.ts @@ -1,6 +1,7 @@ import {request} from "@/api/request"; export type BrandRecord = { + logo: string; name: string; id: number introductory_video: string diff --git a/src/pages/preview/brand/info/info.module.scss b/src/pages/preview/brand/info/info.module.scss index 11abb71..9362555 100644 --- a/src/pages/preview/brand/info/info.module.scss +++ b/src/pages/preview/brand/info/info.module.scss @@ -1,16 +1,27 @@ +page{ + background-color: #fff !important; +} .swiper{ width:750rpx; height:600rpx; - background-color: pink; +} +.curIndexBox{ + position: absolute; + top:450rpx; + right:30rpx; + background-color: rgba(0,0,0,0.5); + border-radius: 30rpx; + padding: 5rpx 30rpx; + color:#fff; } .body{ border-radius: 32rpx 32rpx 0 0; - background-color:cadetblue; + background-color:#f1f8f6; width: 750rpx; box-sizing: border-box; display: flex; flex-direction: column; - min-height: 80vh; + min-height: 600rpx; position: absolute; top: 520rpx; .top{ diff --git a/src/pages/preview/brand/info/info.tsx b/src/pages/preview/brand/info/info.tsx index 0ac2089..f5ab470 100644 --- a/src/pages/preview/brand/info/info.tsx +++ b/src/pages/preview/brand/info/info.tsx @@ -13,6 +13,7 @@ const BrandInfo: FC = () => { const {id} = useRouter().params as unknown as Params const [brandInfo, setBrandInfo] = useState() const [articleList, setArticleList] = useState() + const [curIndex,setCurIndex] = useState(1) useEffect(() => { getData() @@ -30,22 +31,26 @@ const BrandInfo: FC = () => { } } + function onChange(e){ + console.log(e) + setCurIndex(+e.detail.current+1) + } return ( - { - + { brandInfo?.introductory_video_resource?.url && ) + } {brandInfo?.brand_album?.length - && brandInfo?.brand_album?.map((d) => + && brandInfo?.brand_album?.split(',').map((d) => - + ) } - - } + + {curIndex} / {brandInfo?.brand_album?.split(',').length + ((brandInfo && brandInfo.introductory_video_resource) ? 1:0)} + {brandInfo?.name} diff --git a/src/pages/preview/brand/list/list.tsx b/src/pages/preview/brand/list/list.tsx index 2ea9aef..fac5737 100644 --- a/src/pages/preview/brand/list/list.tsx +++ b/src/pages/preview/brand/list/list.tsx @@ -42,10 +42,10 @@ const BrandList: FC = () => { { brands.length ? brands.map((d) => jumpInfo(d.id)} className={styles.box} key={d.id}> - + {d.name} - {d.graphic_introduction.repeat(30)} + {d.graphic_introduction} ) :