bug修复

This commit is contained in:
2025-12-22 23:40:47 +08:00
parent 7d53a059d7
commit 1fefd98d74
19 changed files with 1339 additions and 534 deletions
+32 -16
View File
@@ -62,11 +62,18 @@ const TimelineView = () => {
};
/**
* 按时间倒序排列事件
* 按事件时间倒序排列(最新的在最上面)
* 空日期的事件排在最后
*/
const sortedEvents = [...lifeEvents].sort(
(a, b) => new Date(b.time) - new Date(a.time)
);
const sortedEvents = [...lifeEvents].sort((a, b) => {
// 如果两个都没有时间,保持原顺序
if (!a.time && !b.time) return 0;
// 没有时间的排在后面
if (!a.time) return 1;
if (!b.time) return -1;
// 按时间倒序(最新的在前)
return new Date(b.time) - new Date(a.time);
});
return (
<div>
@@ -98,7 +105,14 @@ const TimelineView = () => {
{/* 事件卡片 */}
<GlassCard className="border-white/5 hover:border-orange-200/20 transition-all duration-700">
<div className="flex justify-between items-start mb-4">
<h4 className="text-xl font-medium text-white/80">{event.title}</h4>
<div className="flex items-center gap-3">
<h4 className="text-xl font-medium text-white/80">{event.title}</h4>
{event.tags && event.tags.length > 0 && (
<span className="text-[9px] px-2 py-1 rounded-full bg-orange-200/10 text-orange-200/60 uppercase tracking-wider">
{event.tags[0] === 'childhood' ? '童年' : event.tags[0] === 'joy' ? '高光' : event.tags[0] === 'low' ? '低谷' : event.tags[0]}
</span>
)}
</div>
<span className="text-[10px] font-mono tracking-widest text-white/30 uppercase">
{event.time}
</span>
@@ -107,18 +121,20 @@ const TimelineView = () => {
{event.content}
</p>
{/* AI 反馈区域 */}
<div className="ai-glow-card p-5 rounded-2xl bg-orange-200/[0.02] border border-orange-200/5">
<div className="flex items-center gap-2 mb-2">
<Sparkles className="w-3 h-3 text-orange-200" />
<span className="text-[9px] uppercase tracking-[0.2em] text-orange-200/60 font-bold">
引路人洞察
</span>
{/* AI 反馈区域 - 仅在有反馈时显示 */}
{event.aiFeedback && (
<div className="ai-glow-card p-5 rounded-2xl bg-orange-200/[0.02] border border-orange-200/5">
<div className="flex items-center gap-2 mb-2">
<Sparkles className="w-3 h-3 text-orange-200" />
<span className="text-[9px] uppercase tracking-[0.2em] text-orange-200/60 font-bold">
引路人洞察
</span>
</div>
<p className="text-xs italic text-white/50 leading-loose">
{event.aiFeedback}
</p>
</div>
<p className="text-xs italic text-white/50 leading-loose">
{event.aiFeedback}
</p>
</div>
)}
</GlassCard>
</div>
))