feat(posts): 类型帖截止时间、抽奖奖品表与悬赏发帖体验

统一投票/悬赏/抽奖截止与状态展示,抽奖支持多奖品行;发帖页悬赏积分对齐表格输入,并在余额不足时于底部就地提示。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-16 10:21:05 +08:00
parent 6b772380c9
commit b2d3d6dd26
23 changed files with 2711 additions and 1007 deletions

View File

@@ -14,6 +14,7 @@ type Props = {
initialTypeMeta?: string;
initialAttachments?: PostAttachment[];
canEditPollOptions?: boolean;
canEditLotteryPrizes?: boolean;
boardName: string;
boardId: number;
boardColorIndex?: number;
@@ -30,6 +31,7 @@ export default function EditPostClient({
initialTypeMeta,
initialAttachments,
canEditPollOptions,
canEditLotteryPrizes,
boardName,
boardId,
boardColorIndex = 0,
@@ -47,6 +49,7 @@ export default function EditPostClient({
initialTypeMeta={initialTypeMeta}
initialAttachments={initialAttachments}
canEditPollOptions={canEditPollOptions}
canEditLotteryPrizes={canEditLotteryPrizes}
boardName={boardName}
boardId={boardId}
boardColorIndex={boardColorIndex}

View File

@@ -65,6 +65,7 @@ export default async function EditPostPage({ params }: PageProps) {
initialTypeMeta={post.type_meta}
initialAttachments={post.attachments || []}
canEditPollOptions={post.poll?.can_edit_options !== false}
canEditLotteryPrizes={post.lottery?.can_edit_prizes !== false}
boardName={post.board?.name || "未知板块"}
boardId={post.board_id}
boardColorIndex={post.board?.color_index ?? 0}

View File

@@ -714,8 +714,11 @@ export default async function PostDetailPage({ params, searchParams }: PageProps
<AcceptedAnswerCard
answer={acceptedAnswer}
variant={acceptedAnswerVariant}
postId={post.id}
canReopen={!!post.question?.can_reopen}
solvedAt={
post.question?.solved_at ||
post.bounty?.accepted_answer?.created_at ||
acceptedAnswer.created_at
}
/>
) : questionState ? (
<QuestionStatusCard postId={post.id} state={questionState} />