'use client' import { Link as I18nLink } from "@/i18n/routing"; import { useTranslations } from "next-intl"; export default function HomeComponent() { const t = useTranslations("Home"); // 客户端组件中直接使用翻译键,next-intl 会自动处理 // 注意:在客户端组件中,我们不能使用 raw() 函数,需要直接访问翻译键 return ( <>
{/* 轮播图区域, 先用一张图片占位, 宽度100%, 盖度100vh */} {t("carousel")} {/* 公司介绍 - 左右布局 */}
{/* 左边视频(图片占位) */}
{t("company_video")}
{/* 右边内容 - 分三部分 */}
{/* 第一部分:标题 */}

{t("company.title")}

{/* 第二部分:介绍 */}
{/* 左对齐首行缩进2字符 */}

{t("company.description")}

{/* 第三部分:按钮 */}
{/* 隐式轮播图,没有控件,每张四个卡片 */}
{/* 第一组卡片 */}
{t("stats.card1.number")}
{t("stats.card1.title")}
{t("stats.card2.number")}
{t("stats.card2.title")}
{t("stats.card3.number")}
{t("stats.card3.title")}
{t("stats.card4.number")}
{t("stats.card4.title")}
{/* 第二组卡片 - 用于无缝轮播 */}
{t("stats.card1.number")}
{t("stats.card1.title")}
{t("stats.card2.number")}
{t("stats.card2.title")}
{t("stats.card3.number")}
{t("stats.card3.title")}
{t("stats.card4.number")}
{t("stats.card4.title")}
{/* 最新资讯 */}
{/* 标题 */}

{t("news.title")}

{/* 资讯卡片列表 */}
{/* 第一张卡片 */}
{t("news.items.news1.date")}
{t("news.items.news1.title")}
{t("news.items.news1.title")}
{/* 第二张卡片 */}
{t("news.items.news2.date")}
{t("news.items.news2.title")}
{t("news.items.news2.title")}
{/* 第三张卡片 */}
{t("news.items.news3.date")}
{t("news.items.news3.title")}
{t("news.items.news3.title")}
{/* 了解更多按钮 */}
{/* 产品中心 */}

{t("products.title")}

{/* 左右布局,左3右2 */}
{/* 左侧产品图 - 占3份 */}
{/* 默认显示第一张产品图 */} {t("products.list.product1.alt")} {/* 产品标题覆盖层 */}

{t("products.list.product1.name")}

{/* 右侧产品列表 - 占2份,两列布局 */}
{/* 产品1 */}
{ document.getElementById('productImage')?.setAttribute('src', t("products.list.product1.image")); document.getElementById('productImage')?.setAttribute('alt', t("products.list.product1.alt")); document.getElementById('productTitle')!.textContent = t("products.list.product1.name"); }} > {t("products.list.product1.name")}
{/* 产品2 */}
{ document.getElementById('productImage')?.setAttribute('src', t("products.list.product2.image")); document.getElementById('productImage')?.setAttribute('alt', t("products.list.product2.alt")); document.getElementById('productTitle')!.textContent = t("products.list.product2.name"); }} > {t("products.list.product2.name")}
{/* 产品3 */}
{ document.getElementById('productImage')?.setAttribute('src', t("products.list.product3.image")); document.getElementById('productImage')?.setAttribute('alt', t("products.list.product3.alt")); document.getElementById('productTitle')!.textContent = t("products.list.product3.name"); }} > {t("products.list.product3.name")}
{/* 产品4 */}
{ document.getElementById('productImage')?.setAttribute('src', t("products.list.product4.image")); document.getElementById('productImage')?.setAttribute('alt', t("products.list.product4.alt")); document.getElementById('productTitle')!.textContent = t("products.list.product4.name"); }} > {t("products.list.product4.name")}
{/* 产品5 */}
{ document.getElementById('productImage')?.setAttribute('src', t("products.list.product5.image")); document.getElementById('productImage')?.setAttribute('alt', t("products.list.product5.alt")); document.getElementById('productTitle')!.textContent = t("products.list.product5.name"); }} > {t("products.list.product5.name")}
{/* 产品6 */}
{ document.getElementById('productImage')?.setAttribute('src', t("products.list.product6.image")); document.getElementById('productImage')?.setAttribute('alt', t("products.list.product6.alt")); document.getElementById('productTitle')!.textContent = t("products.list.product6.name"); }} > {t("products.list.product6.name")}
{/* 应用领域 */}
{/* 标题 */}

{t("applications.title")}

{/* 轮播容器 */}
{/* 左切换按钮 */} {/* 右切换按钮 */} {/* 轮播内容 */}
{/* 第一组卡片拼图 */}
{/* 第一行 */}
{/* 电梯井道 */}
{t("applications.groups.group1.items.app1.alt")}
{t("applications.groups.group1.items.app1.name")}
{/* 塔机制造 - 宽度为其他卡片的两倍 */}
{t("applications.groups.group1.items.app2.alt")}
{t("applications.groups.group1.items.app2.name")}
{/* 工程机械 */}
{t("applications.groups.group1.items.app3.alt")}
{t("applications.groups.group1.items.app3.name")}
{/* 第二行 */}
{/* 高速护栏 - 宽度为其他卡片的两倍 */}
{t("applications.groups.group1.items.app4.alt")}
{t("applications.groups.group1.items.app4.name")}
{/* 桥梁 */}
{t("applications.groups.group1.items.app5.alt")}
{t("applications.groups.group1.items.app5.name")}
{/* 钢结构 */}
{t("applications.groups.group1.items.app6.alt")}
{t("applications.groups.group1.items.app6.name")}
{/* 第二组卡片拼图(可扩展更多组) */}
{/* 第一行 */}
{/* 建筑工程 */}
{t("applications.groups.group2.items.app7.alt")}
{t("applications.groups.group2.items.app7.name")}
{/* 水利水电 */}
{t("applications.groups.group2.items.app8.alt")}
{t("applications.groups.group2.items.app8.name")}
{/* 轨道交通 */}
{t("applications.groups.group2.items.app9.alt")}
{t("applications.groups.group2.items.app9.name")}
{/* 第二行 */}
{/* 市政工程 */}
{t("applications.groups.group2.items.app10.alt")}
{t("applications.groups.group2.items.app10.name")}
{/* 农业设施 */}
{t("applications.groups.group2.items.app11.alt")}
{t("applications.groups.group2.items.app11.name")}
{/* 能源化工 */}
{t("applications.groups.group2.items.app12.alt")}
{t("applications.groups.group2.items.app12.name")}
{/* 生产案例 */}
); }