From 138e1c1deb51ead865340dcdeddcf0d2a02f6e94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=B3=E6=B8=85=E7=88=BD?= Date: Mon, 12 May 2025 13:57:24 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=81=E5=9F=9F=E6=93=8D=E7=9B=98=E6=89=8B?= =?UTF-8?q?=20-=20=E5=BE=AE=E4=BF=A1=E5=8F=B7=E8=B4=A6=E5=8F=B7=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E9=A1=B5=E9=9D=A2=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cunkebao/app/wechat-accounts/[id]/page.tsx | 38 ++++++++++++++++++---- 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/Cunkebao/app/wechat-accounts/[id]/page.tsx b/Cunkebao/app/wechat-accounts/[id]/page.tsx index a5f7d89b..55d926ed 100644 --- a/Cunkebao/app/wechat-accounts/[id]/page.tsx +++ b/Cunkebao/app/wechat-accounts/[id]/page.tsx @@ -593,6 +593,30 @@ export default function WechatAccountDetailPage({ params }: { params: { id: stri setShowFriendDetail(true) } + // 修改获取限制等级颜色的函数 + const getRestrictionLevelColor = (level: string) => { + const colorMap = { + "1": "text-gray-600", + "2": "text-yellow-600", + "3": "text-red-600" + }; + return colorMap[level as keyof typeof colorMap] || "text-gray-600"; + } + + // 添加时间格式化函数 + const formatDateTime = (dateString: string) => { + const date = new Date(dateString); + return date.toLocaleString('zh-CN', { + year: 'numeric', + month: '2-digit', + day: '2-digit', + hour: '2-digit', + minute: '2-digit', + second: '2-digit', + hour12: false + }).replace(/\//g, '-'); + } + return ( {isLoading ? ( @@ -810,10 +834,10 @@ export default function WechatAccountDetailPage({ params }: { params: { id: stri {accountSummary.restrictions.slice(0, 2).map((record) => (
- + {record.reason} - {new Date(record.date).toLocaleDateString()} + {formatDateTime(record.date)}
))} @@ -938,13 +962,15 @@ export default function WechatAccountDetailPage({ params }: { params: { id: stri
- {account.restrictionRecords.map((record) => ( + {accountSummary && accountSummary.restrictions.map((record) => (
-
{record.reason}
- {record.date} +
+ {record.reason} +
+ {formatDateTime(record.date)}
-
恢复时间:{record.recoveryTime}
+
恢复时间:{formatDateTime(record.date)}
))}