From bed0de67dce2f8d2488264f3f34fa6f875528824 Mon Sep 17 00:00:00 2001 From: Montia37 Date: Fri, 5 Sep 2025 20:27:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=9B=BA=E5=AE=9A?= =?UTF-8?q?=E9=A2=9C=E8=89=B2=E6=A0=87=E8=AF=86=E4=BB=A5=E5=A2=9E=E5=BC=BA?= =?UTF-8?q?=E5=88=B0=E6=9C=9F=E6=97=B6=E9=97=B4=E5=8F=AF=E8=AF=BB=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useNodeCommons.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/hooks/useNodeCommons.ts b/src/hooks/useNodeCommons.ts index 460c4ad..9c35539 100644 --- a/src/hooks/useNodeCommons.ts +++ b/src/hooks/useNodeCommons.ts @@ -42,11 +42,15 @@ export const useNodeCommons = (node: NodeWithStatus) => { let daysLeftTag = null; if (daysLeft !== null) { if (daysLeft < 0) { - daysLeftTag = "已过期"; + daysLeftTag = "已过期"; + } else if (daysLeft <= 7) { + daysLeftTag = `余 ${daysLeft} 天`; + } else if (daysLeft <= 15) { + daysLeftTag = `余 ${daysLeft} 天`; } else if (daysLeft < 36500) { - daysLeftTag = `余 ${daysLeft} 天`; + daysLeftTag = `余 ${daysLeft} 天`; } else { - daysLeftTag = "长期"; + daysLeftTag = "长期"; } } @@ -59,7 +63,7 @@ export const useNodeCommons = (node: NodeWithStatus) => { const tagList = [ ...(price ? [price] : []), - ...(daysLeftTag && price ? [daysLeftTag] : []), + ...(daysLeftTag ? [daysLeftTag] : []), ...(typeof node.tags === "string" ? node.tags .split(";")