|
|
@@ -98,21 +98,23 @@ export default function HomeContent({ homeData }: HomeContentProps) {
|
|
|
sections,
|
|
|
// categories
|
|
|
} = homeData;
|
|
|
+ console.log('sections-----------------aaaa:',sections);
|
|
|
+
|
|
|
// 过滤出 banner 板块
|
|
|
- const bannerSection = sections.find(sec => sec.name === "banner");
|
|
|
+ const bannerSection = sections.find(sec => sec.sort_order === 2);
|
|
|
const bannerImages = bannerSection?.images ?? [];
|
|
|
// 过滤出 banner 板块
|
|
|
- const jinGangSection = sections.find(sec => sec.id === 13);
|
|
|
+ const jinGangSection = sections.find(sec => sec.sort_order === 3);
|
|
|
|
|
|
// 2. 筛选热销板块,假设后端name为 best_sellers,自行修改匹配后端标识
|
|
|
- const bestSellerSection = sections.find(sec => sec.name === "BestSellers");
|
|
|
+ const bestSellerSection = sections.find(sec => sec.sort_order === 4);
|
|
|
// 过滤出 banner 板块
|
|
|
- const middleBannerSection = sections.find(sec => sec.id === 15);
|
|
|
+ const middleBannerSection = sections.find(sec => sec.sort_order === 5);
|
|
|
const middleBanner = middleBannerSection?.images ?? [];
|
|
|
// 3. 筛选new Arrival板块
|
|
|
- const newArrivalSection = sections.find(sec => sec.name === "New_Arrival");
|
|
|
+ const newArrivalSection = sections.find(sec => sec.sort_order === 6);
|
|
|
// 4. 筛选7板块
|
|
|
- const zeroWearImageSection = sections.find(sec => sec.id === 18);
|
|
|
+ const zeroWearImageSection = sections.find(sec => sec.sort_order === 8);
|
|
|
const zeroWearImage= zeroWearImageSection?.images ?? [];
|
|
|
// 4. 筛选7板块
|
|
|
const zeroWearSection = sections.find(sec => sec.name === "7");
|
|
|
@@ -125,7 +127,7 @@ export default function HomeContent({ homeData }: HomeContentProps) {
|
|
|
// const recommended: HomeProduct[] = recommendedSection?.products ?? [];
|
|
|
|
|
|
return (<>
|
|
|
- <div className="min-h-screen pt-[162px] bg-white font-sans">
|
|
|
+ <div className="min-h-screen bg-white font-sans">
|
|
|
{/* 顶部Banner */}
|
|
|
<div className="w-full relative">
|
|
|
<TopImageSwiper bannerImages={bannerImages} />
|