feat: 站点媒体库与移动端底部导航,服务测试补强
- 新增媒体库:media_library/media_thumbs 服务(WebP 缩略图)、管理端 media 页面 - 移动端底部导航 MobileTabBar 替换 MobilePostBar - 旧数据导入增强与测试、路由与登录会话/板块侧边栏测试补强 - site-doc 组件精简(移除 Breadcrumb),文档新增迁移公告说明
This commit is contained in:
@@ -29,8 +29,6 @@ import CommentSection from "@/components/CommentSection";
|
||||
import PostActions from "@/components/PostActions";
|
||||
import LikeButton from "@/components/LikeButton";
|
||||
import FavoriteButton from "@/components/FavoriteButton";
|
||||
import { SiteDocBreadcrumb } from "@/components/site-doc";
|
||||
import MobilePostBar from "@/components/MobilePostBar";
|
||||
import Avatar from "@/components/Avatar";
|
||||
import RoleBadge from "@/components/RoleBadge";
|
||||
import LevelBadge from "@/components/LevelBadge";
|
||||
@@ -119,7 +117,10 @@ function RelatedPosts({
|
||||
if (posts.length === 0) return null;
|
||||
const titleId = `${uid}-title`;
|
||||
return (
|
||||
<section className="j13-module shrink-0" aria-labelledby={titleId}>
|
||||
<section
|
||||
className="j13-module shrink-0 max-sm:-mx-4 max-sm:rounded-none max-sm:border-x-0 max-sm:shadow-none"
|
||||
aria-labelledby={titleId}
|
||||
>
|
||||
<p className="j13-module-title mb-1.5" id={titleId}>
|
||||
<Flame size={15} style={{ color: "var(--clay)" }} /> 同板块热议
|
||||
</p>
|
||||
@@ -175,7 +176,7 @@ function AuthorCardStacked({
|
||||
const signature = (u.signature || "").trim();
|
||||
const { post_count, comment_count, points, streak } = profile.stats;
|
||||
return (
|
||||
<div className="panel p-5 sm:p-6">
|
||||
<div className="panel p-4 sm:p-6 max-sm:-mx-4 max-sm:rounded-none max-sm:border-x-0 max-sm:shadow-none">
|
||||
<p
|
||||
className="text-[11.5px] font-medium tracking-[0.08em] uppercase mb-3.5"
|
||||
style={{ color: "var(--ink-3)" }}
|
||||
@@ -477,15 +478,6 @@ export default async function PostDetailPage({ params, searchParams }: PageProps
|
||||
return (
|
||||
<>
|
||||
<JsonLd data={jsonLd} />
|
||||
{/* 移动端浮动操作条:长文读到中途可点赞 / 跳评论框 */}
|
||||
<MobilePostBar
|
||||
postId={id}
|
||||
liked={post.liked}
|
||||
likeCount={post.like_count}
|
||||
favorited={post.favorited === true}
|
||||
allowComments={allowComments}
|
||||
/>
|
||||
|
||||
{/* 三栏阅读布局:宽度与首页工作台一致——lg = 左224 + 正文 + 右280,xl = 左240 + 正文 + 右300;以下单栏
|
||||
侧栏两列均可被站长清空,网格随之退化为两栏/单栏 */}
|
||||
<div
|
||||
@@ -506,15 +498,8 @@ export default async function PostDetailPage({ params, searchParams }: PageProps
|
||||
{/* 中栏:正文主体 */}
|
||||
<div className="min-w-0">
|
||||
<article className="w-full">
|
||||
<div className="panel p-6 sm:p-8">
|
||||
<SiteDocBreadcrumb
|
||||
className="is-ruled"
|
||||
items={[
|
||||
{ href: "/", label: "首页" },
|
||||
{ href: `/?board=${post.board.id}`, label: post.board.name },
|
||||
]}
|
||||
/>
|
||||
<header className="mb-7">
|
||||
<div className="panel p-4 sm:p-6 lg:p-8 max-sm:-mx-4 max-sm:rounded-none max-sm:border-x-0 max-sm:shadow-none">
|
||||
<header className="mb-5 sm:mb-7">
|
||||
<div className="flex items-start gap-2 flex-wrap mb-6">
|
||||
{/* 仅置顶/推荐在标题左侧 */}
|
||||
{post.pinned > 0 && <span className="badge-pin shrink-0 mt-2 sm:mt-3">置顶</span>}
|
||||
@@ -690,7 +675,7 @@ export default async function PostDetailPage({ params, searchParams }: PageProps
|
||||
|
||||
{/* 文末点赞/收藏:分隔线后居中,唯一的互动入口(作者行不再放置) */}
|
||||
<div
|
||||
className="mt-9 pt-7 flex justify-center gap-3"
|
||||
className="mt-6 pt-5 sm:mt-9 sm:pt-7 flex justify-center gap-3"
|
||||
style={{ borderTop: "1px solid var(--line)" }}
|
||||
>
|
||||
<LikeButton
|
||||
@@ -705,7 +690,7 @@ export default async function PostDetailPage({ params, searchParams }: PageProps
|
||||
|
||||
{/* 窄屏作者卡(lg 起由左栏承载,避免重复展示) */}
|
||||
{profile && (
|
||||
<div className="lg:hidden mt-6">
|
||||
<div className="lg:hidden mt-4">
|
||||
<AuthorCardStacked
|
||||
profile={profile}
|
||||
allowComments={allowComments}
|
||||
@@ -745,7 +730,10 @@ export default async function PostDetailPage({ params, searchParams }: PageProps
|
||||
}
|
||||
/>
|
||||
) : allowComments ? (
|
||||
<section className="panel p-6 sm:p-8 mt-6 text-center" aria-label="评论区">
|
||||
<section
|
||||
className="panel p-4 sm:p-6 lg:p-8 mt-4 text-center max-sm:-mx-4 max-sm:rounded-none max-sm:border-x-0 max-sm:shadow-none"
|
||||
aria-label="评论区"
|
||||
>
|
||||
<p className="text-[14px]" style={{ color: "var(--ink-2)" }}>
|
||||
{post.status === "pending" ? "帖子审核通过后开放评论" : "帖子未通过审核,评论已关闭"}
|
||||
</p>
|
||||
@@ -760,7 +748,7 @@ export default async function PostDetailPage({ params, searchParams }: PageProps
|
||||
) : null}
|
||||
|
||||
{/* 窄屏相关讨论(lg 起由右栏承载) */}
|
||||
<div className="lg:hidden mt-6">
|
||||
<div className="lg:hidden mt-4">
|
||||
<RelatedPosts
|
||||
posts={related}
|
||||
boardId={post.board_id}
|
||||
@@ -782,9 +770,6 @@ export default async function PostDetailPage({ params, searchParams }: PageProps
|
||||
</aside>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* 给移动端浮动操作条让位,避免遮住页尾内容 */}
|
||||
<div className="lg:hidden h-16" aria-hidden />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user