pref: ErrorPage 功能增强

ErrorPage 新增功能:
 - 浮动动画效果 (keyframes)
 - 可配置错误原因列表 (reasons prop)
 - 技术详情折叠面板 (techDetails prop)
 - 可选搜索功能 (search prop)
 - 更丰富的导航选项
This commit is contained in:
zdl
2025-12-05 14:34:03 +08:00
parent 39f14fb148
commit 302acbafe3
3 changed files with 747 additions and 82 deletions

View File

@@ -66,15 +66,43 @@ const EventDetail = () => {
}
// 错误状态
if (!error) {
if (error) {
return (
<ErrorPage
title="页面找不到了"
description={error}
title="事件走丢了"
subtitle={encodedId ? `ID: ${encodedId}` : undefined}
description="抱歉,我们找不到您请求的事件,这可能是因为:"
detail={eventId}
detailLabel="事件ID"
reasons={[
{
icon: '🔍',
title: '事件ID输入错误',
description: '请检查URL中的事件ID是否正确',
},
{
icon: '🗑️',
title: '该事件已被删除或下架',
description: '该事件可能因过期或内容调整而被移除',
},
{
icon: '🔄',
title: '系统暂时无法访问该事件',
description: '请稍后重试或联系技术支持',
},
]}
techDetails={{
requestUrl: window.location.href,
errorType: '404 - Event Not Found',
errorMessage: error,
timestamp: new Date().toISOString(),
relatedId: eventId,
}}
showRetry
onRetry={() => window.location.reload()}
showBack
showHome
homePath="/community"
/>
);
}