From 5bd546069cb0a8cb55b7761ce339d8039e1df5e3 Mon Sep 17 00:00:00 2001 From: hailin Date: Tue, 25 Mar 2025 10:43:28 +0800 Subject: [PATCH] . --- .../app/[locale]/details/[slug]/page.tsx | 11 +- apps/blogai/components/header.tsx | 118 ++++++++++-------- 2 files changed, 70 insertions(+), 59 deletions(-) diff --git a/apps/blogai/app/[locale]/details/[slug]/page.tsx b/apps/blogai/app/[locale]/details/[slug]/page.tsx index df3f1fb..ace7eac 100644 --- a/apps/blogai/app/[locale]/details/[slug]/page.tsx +++ b/apps/blogai/app/[locale]/details/[slug]/page.tsx @@ -16,6 +16,8 @@ import { Header, NavBack, TimeP } from "@/components/header"; import { baseTitle, baseURL, keywordsRoot } from "@/lib/metadata"; import { useTranslation } from "react-i18next"; +import { DetailPageHeader } from '@/components/header' + export const runtime = "nodejs"; type Props = { @@ -89,7 +91,7 @@ const BlogArticleWrapper = async ({ params }: { params: { slug: string, locale:
-
+ {/*
- {/*

All Blogs

*/} { frontmatter.tags && frontmatter.tags?.length > 0 && frontmatter.tags?.map((item, index) => { return

{item}

@@ -112,13 +113,15 @@ const BlogArticleWrapper = async ({ params }: { params: { slug: string, locale:
+

{frontmatter.title} -

+ */} + +
{ + setLoading(true); + setStatusText(source === "icon" ? "正在处理图标操作..." : "正在处理信息操作..."); + try { + // 模拟 API 请求 + const res = await fetch("/api/stub", { + method: "POST", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify({ source }) + }); + + // 假装等待响应 + await new Promise((resolve) => setTimeout(resolve, 1000)); + + setStatusText(`操作成功:来自${source === "icon" ? "图标" : "信息区域"}`); + } catch (err) { + setStatusText("操作失败"); + } finally { + setLoading(false); + } + }; - const soonFunc = () => { - message.info(t("soon")) - } -//w-11/12 sm:w-5/6 md:w-3/4 lg:w-2/3 xl:w-3/5 2xl:w-1/2 return ( -
+
+ {/* 上方内容区域 */} +
+ {/* 左侧图标区域 - 可点击 */} + - - - - -
-
- {(!!userData && !!userData.user_name) ? ( -
- -
- - ) : ( -
- - - - -
- - - )} + {/* 右侧信息区域 - 可点击 */} +
handleClick("info")} + > +

名称:{data?.name || "未命名组件"}

+

类别:{data?.category || "未知"}

+

更新时间:{data?.updated_at || "未提供"}

+

公司:{data?.company || "未知公司"}

-
- ) + {/* 底部进度条或状态条 */} +
+
+ {loading ? "操作中..." : statusText} +
+
+
+ ); } + + // export function Header() { // const router = useRouter();