feat(about): 添加关于页面的多个子页面内容
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect } from "react";
|
||||
import { useSectionStore } from "@/stores/sectionStore";
|
||||
|
||||
export default function Page() {
|
||||
const { setSections } = useSectionStore();
|
||||
useEffect(() => {
|
||||
setSections([
|
||||
{ id: "arch-vision", name: "友发愿景" },
|
||||
{ id: "arch-products", name: "产品体系" },
|
||||
{ id: "arch-application", name: "应用场景" },
|
||||
{ id: "arch-contact", name: "联系方式" },
|
||||
]);
|
||||
}, [setSections]);
|
||||
|
||||
return (
|
||||
<div className="w-full">
|
||||
<section id="arch-vision" className="container mx-auto px-4 py-12">
|
||||
<h2 className="text-3xl font-bold mb-4">友发愿景</h2>
|
||||
<p className="text-gray-600">内容占位</p>
|
||||
</section>
|
||||
<section id="arch-products" className="container mx-auto px-4 py-12">
|
||||
<h2 className="text-3xl font-bold mb-4">产品体系</h2>
|
||||
<p className="text-gray-600">内容占位</p>
|
||||
</section>
|
||||
<section id="arch-application" className="container mx-auto px-4 py-12">
|
||||
<h2 className="text-3xl font-bold mb-4">应用场景</h2>
|
||||
<p className="text-gray-600">内容占位</p>
|
||||
</section>
|
||||
<section id="arch-contact" className="container mx-auto px-4 py-12">
|
||||
<h2 className="text-3xl font-bold mb-4">联系方式</h2>
|
||||
<p className="text-gray-600">内容占位</p>
|
||||
</section>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
export default function Page() {
|
||||
return (
|
||||
<div className="container mx-auto px-4 py-12">基础介绍</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
export default function Page() {
|
||||
return (
|
||||
<div className="container mx-auto px-4 py-12">发展历程</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
export default function Page() {
|
||||
return (
|
||||
<div className="container mx-auto px-4 py-12">企业文化</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
export default function Page() {
|
||||
return (
|
||||
<div className="container mx-auto px-4 py-12">绿色发展</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
export default function Page() {
|
||||
return (
|
||||
<div className="container mx-auto px-4 py-12">荣誉资质</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
export default function Page() {
|
||||
return (
|
||||
<div className="container mx-auto px-4 py-12">公司介绍</div>
|
||||
);
|
||||
}
|
||||
@@ -1,16 +1,15 @@
|
||||
import { Locale, LOCALES, Link as I18nLink } from "@/i18n/routing";
|
||||
import ParallaxHero from "@/app/[locale]/blog/ParallaxHero";
|
||||
import TablerEyeFilled from "@/components/icons/eye";
|
||||
import { Link as I18nLink, Locale, LOCALES } from "@/i18n/routing";
|
||||
import { getPosts } from "@/lib/getBlogs";
|
||||
import { constructMetadata } from "@/lib/metadata";
|
||||
import dayjs from "dayjs";
|
||||
import { Metadata } from "next";
|
||||
import { getTranslations } from "next-intl/server";
|
||||
import Image from "next/image";
|
||||
import dayjs from "dayjs";
|
||||
import TablerEyeFilled from "@/components/icons/eye";
|
||||
import ParallaxHero from "@/app/[locale]/blog/ParallaxHero";
|
||||
|
||||
type Params = Promise<{ locale: string }>;
|
||||
|
||||
type SearchParams = { page?: string };
|
||||
type SearchParams = { page?: string; type?: string };
|
||||
|
||||
type MetadataProps = {
|
||||
params: Params;
|
||||
@@ -40,10 +39,29 @@ export default async function Page({
|
||||
searchParams?: SearchParams;
|
||||
}) {
|
||||
const { locale } = await params;
|
||||
const { posts } = await getPosts(locale);
|
||||
let { posts } = await getPosts(locale);
|
||||
|
||||
const t = await getTranslations("Blog");
|
||||
|
||||
// 分类筛选(公司新闻/专家访谈/行业动态/公告)
|
||||
const type = (searchParams?.type || "").toLowerCase();
|
||||
const typeLabelMap: Record<string, string> = {
|
||||
company: "公司新闻",
|
||||
experts: "专家访谈",
|
||||
industry: "行业动态",
|
||||
notice: "公告",
|
||||
};
|
||||
const typeLabel = typeLabelMap[type];
|
||||
if (type) {
|
||||
posts = posts.filter((p) => {
|
||||
const metaType = String((p.metadata as any)?.type || "").toLowerCase();
|
||||
const tags: string[] = (p.tags as any) || [];
|
||||
const hitMeta = metaType === type;
|
||||
const hitTag = Array.isArray(tags) && tags.some((t) => String(t).toLowerCase() === type);
|
||||
return hitMeta || hitTag;
|
||||
});
|
||||
}
|
||||
|
||||
const pageRaw = searchParams?.page;
|
||||
const page = Math.max(1, parseInt(pageRaw || "1", 10));
|
||||
const pageSize = 10;
|
||||
@@ -75,6 +93,12 @@ export default async function Page({
|
||||
<I18nLink href="/blog" prefetch={false} className="hover:underline">
|
||||
新闻中心
|
||||
</I18nLink>
|
||||
{typeLabel && (
|
||||
<>
|
||||
<span>/</span>
|
||||
<span className="text-gray-700">{typeLabel}</span>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user