diff --git a/src/pages/index/index.module.scss b/src/pages/index/index.module.scss index 1023c43..6cdffe3 100644 --- a/src/pages/index/index.module.scss +++ b/src/pages/index/index.module.scss @@ -4,6 +4,7 @@ padding-bottom: 40px; } +// loading 分支与空态分支共用(error 分支已由 StateView 自带 margin) .stateWrap { margin-top: 80px; display: flex; @@ -11,106 +12,149 @@ align-items: center; } -// ===== 家庭圈入口 ===== +// ===== 家庭圈入口:渐变横幅卡 ===== .familyEntry { margin: 24px; - padding-left: 48px; + padding: 36px 32px; + background: $color-primary-grad; + border-radius: $radius-lg; + // 品牌绿阴影(spec §5.1 允许的字面量) + box-shadow: 0 4px 12px rgba(44, 203, 152, 0.3); + display: flex; + align-items: center; + justify-content: space-between; +} + +.familyTexts { display: flex; flex-direction: column; - align-items: center; } -.familyIcon { - width: 108px; - height: 108px; - border-radius: $radius-circle; - background: $color-primary-grad; - display: flex; - align-items: center; - justify-content: center; +.familyTitle { + font-size: 32px; + font-weight: 700; + color: #ffffff; } -.familyEmoji { - font-size: 56px; - line-height: 1; +.familySub { + margin-top: 8px; + font-size: 24px; + color: rgba(255, 255, 255, 0.85); } -.familyText { - margin-top: 12px; - font-size: 28px; - color: $color-text; +.familyArrow { + font-size: 36px; + color: rgba(255, 255, 255, 0.85); } -// ===== 未处理告警卡片 ===== +// ===== 未处理告警卡:左红色块 + 文字块 + 右上圆角标签 ===== .unhandledCard { - position: relative; margin: 0 24px 24px; - padding: 32px; + padding: 28px; background: $color-bg-white; border-radius: $radius-lg; box-shadow: $shadow-card; } -.unhandledTag { - position: absolute; - top: -16px; - left: -8px; - padding: 6px 18px; - background: $color-danger-light-bg; - color: $color-danger-deep; - border: 2px solid $color-danger-deep; - border-radius: $radius-sm; - font-size: 22px; - transform: rotate(-4deg); - box-shadow: 0 2px 8px rgba(213, 59, 29, 0.15); -} - -.unhandledTitle { - font-size: 32px; - font-weight: 600; - color: $color-text; -} - -.unhandledRow { - margin-top: 16px; +.unhandledHead { display: flex; align-items: center; } -.rowLabel { - font-size: 28px; - color: $color-text-secondary; +.unhandledIcon { + flex-shrink: 0; + width: 72px; + height: 72px; + border-radius: $radius-md; + background: $color-danger-light-bg; + display: flex; + align-items: center; + justify-content: center; + margin-right: 20px; } -.rowValue { - font-size: 28px; +.unhandledIconText { + font-size: 36px; + font-weight: 700; + color: $color-danger-deep; +} + +.unhandledTitle { + flex: 1; + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + font-size: 30px; + font-weight: 600; color: $color-text; } -// ===== 告警消息列表 ===== +.unhandledTag { + flex-shrink: 0; + margin-left: 16px; + padding: 4px 16px; + background: $color-danger-light-bg; + border-radius: $radius-pill; +} + +.unhandledTagText { + font-size: 22px; + color: $color-danger-deep; +} + +// 元信息与标题文字左对齐:72 图标 + 20 间距 +.unhandledMeta { + margin-top: 12px; + padding-left: 92px; +} + +.unhandledMetaText { + font-size: 26px; + color: $color-text-secondary; +} + +// ===== 告警消息列表:左绿色块 + 标题/时间 + 设备名副行 ===== .messageList { padding: 0 24px; } .messageCard { margin-bottom: 24px; - padding: 32px; + padding: 28px; background: $color-bg-white; border-radius: $radius-lg; box-shadow: $shadow-card; + display: flex; + align-items: flex-start; +} + +.messageIcon { + flex-shrink: 0; + width: 72px; + height: 72px; + border-radius: $radius-md; + background: $color-primary-light-bg; + display: flex; + align-items: center; + justify-content: center; + margin-right: 20px; +} + +.messageIconText { + font-size: 22px; + color: $color-primary; +} + +.messageBody { + flex: 1; + min-width: 0; } .messageHead { display: flex; align-items: center; -} - -.messageDot { - width: 16px; - height: 16px; - border-radius: $radius-circle; - background: $color-danger-deep; - margin-right: 12px; + justify-content: space-between; } .messageTitle { @@ -120,7 +164,14 @@ } .messageTime { - margin-top: 12px; + margin-left: 16px; font-size: 24px; color: $color-text-secondary; } + +.messageDevice { + display: block; + margin-top: 10px; + font-size: 26px; + color: $color-text-secondary; +} diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx index c647f2b..e5dba67 100644 --- a/src/pages/index/index.tsx +++ b/src/pages/index/index.tsx @@ -78,10 +78,11 @@ export default function Index() { function FamilyEntry({ onClick }: { onClick: () => void }) { return ( - - 👨‍👩‍👧 + + 家庭圈 + 家人共享 · 守护彼此 - 家庭圈 + › ) } @@ -89,18 +90,23 @@ function FamilyEntry({ onClick }: { onClick: () => void }) { function UnhandledAlert({ alert, onClick }: { alert: EventItem; onClick: () => void }) { return ( - 未处理 - {alert.deviceName || '未知设备'} + + + ! + + {alert.deviceName || '未知设备'} + + 未处理 + + {alert.sceneName && ( - - 家庭圈: - {alert.sceneName} + + {alert.sceneName} )} {alert.time && ( - - 时间: - {alert.time} + + {alert.time} )} @@ -110,11 +116,18 @@ function UnhandledAlert({ alert, onClick }: { alert: EventItem; onClick: () => v function AlertMessageItem({ alert, onClick }: { alert: EventItem; onClick: () => void }) { return ( - - - 告警消息 + + ● + + + + 告警消息 + {alert.time && {alert.time}} + + {alert.deviceName && ( + {alert.deviceName} + )} - {alert.time && {alert.time}} ) }