import Image from "next/image" import MainTitle from "@/components/MainTitle" import ProductMenu from "@/components/products/ProductMenuClient" import {serverGet} from "@/utils/request"; import AnimatedSection from "@/components/AnimatedSection"; import React, {Suspense} from "react"; export default async function ProductShowcase() { const res = await serverGet("/webSite/getProductCategoryAndType", null, { next: { revalidate: 180 }, cache: "force-cache" }) if (res.code !== 200) { return
服务器错误
} const hardwareProductList: { key: string; label: string }[] = [] for (let i = 0; i < res.data.length; i++) { const a = res.data[i].productTypes.map((item) => ({ key: item.productTypeName, label: item.productTypeName, // children: item.productCenters.map((center) => ({ // key: center.productCenterName, // label: center.productCenterName, // })) })) hardwareProductList.push(...a); hardwareProductList.reverse(); // if (res.data[i].productCategoryName === "硬件产品") { // hardwareProductList = res.data[i].productTypes.map((item) => ({ // key: item.productTypeName, // label: item.productTypeName, // // children: item.productCenters.map((center) => ({ // // key: center.productCenterName, // // label: center.productCenterName, // // })) // })) // }else if(res.data[i].productCategoryName === "软件产品"){ // softwareProductList = res.data[i].productTypes.map((item) => ({ // key: item.productTypeName, // label: item.productTypeName, // // children: item.productCenters.map((center) => ({ // // key: center.productCenterName, // // label: center.productCenterName, // // })) // })) // } } const products = res.data.flatMap((item) => item.productTypes.flatMap((type) => type.productCenters)) return ( <>
{"产品中心"}
加载中...}> {/**/} {/* 加载中...}>*/} {/* */} {/* */} {/**/} {/**/} {/* */} {/**/} ) }