From 23641d26299e0aaf5fe54249820938793e21d8d3 Mon Sep 17 00:00:00 2001 From: claw_bot Date: Tue, 24 Mar 2026 08:31:51 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E4=BA=A4=E6=98=93?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=97=B6=E9=97=B4=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 今天的交易只显示时间 (16:15) - 非今天的交易显示月-日 时间 (03-24 16:15) - 缩短时间字符串,避免布局变形 --- pages/detail/detail.vue | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/pages/detail/detail.vue b/pages/detail/detail.vue index c17ccc2..23173be 100755 --- a/pages/detail/detail.vue +++ b/pages/detail/detail.vue @@ -266,7 +266,7 @@ - {{ log.date }} {{ log.time || '' }} + {{ formatLogTime(log.date, log.time) }} @@ -577,6 +577,21 @@ const getCurrencySymbol = (currency?: string): string => { return symbols[currency || 'CNY'] || '¥'; }; +const formatLogTime = (date?: string, time?: string): string => { + if (!date) return ''; + const today = new Date(); + const todayStr = today.toISOString().split('T')[0]; + const isToday = date === todayStr; + + const datePart = isToday ? '' : date.slice(5); + const timePart = time ? time.slice(0, 5) : ''; + + if (isToday) { + return timePart || '今天'; + } + return datePart + (timePart ? ' ' + timePart : ''); +}; + const portfolioId = ref(''); const portfolioData = ref({ id: '',