v62:纪念日列表修正 / 分类图标与设置菜单 / 首页卡片体系

- 纪念日列表:display:flex 从 td 移到内层 div(写在 td 上会破坏表格列算法,
  表现为关联人列与其它列高度不一致);行内列序按表头对齐;
  改完再点「新建」不再带出上次修改的数据;文案改为「与我相关」「来自名册」;
  别人记的、把我挂成关联人的条目一并显示(split() 返回 hiddenIds,
  路由层据此过滤「接下来的日子」,与两张表同一套可见性)
- 分类图标:新增 app/AnnivIcon.php(17 个行内 SVG 图标 + 同 key 的 emoji
  供日历纯文本处使用,内网无 CDN 不用 FontAwesome);去掉「看日历」按钮;
  设置按钮改为菜单,第一项进 days/settings 独立页;分类可自选图标,
  列表徽标与日历条目都按分类显示
- 首页卡片:新增 app/HomeCards.php 与 templates/home_cards.php;
  8 格宽 × 高 2/4/6/8;首页拆成 templates/home/_card_*.php 共 8 个片段;
  home/cards 可改尺寸、调顺序、开关
This commit is contained in:
2026-10-19 12:51:17 +08:00
parent ad7f43af68
commit 9a66068c33
21 changed files with 2172 additions and 685 deletions
+34
View File
@@ -0,0 +1,34 @@
<?php
/**
* 首页卡片 · 纪念日(v62 新增)。
*
* 数据来自 `Anniversary::upcoming($familyId, $me, 60)`(与「纪念日」页面顶上那块**同一份**),
* 所以"首页看到的"和"点进去看到的"永远一致 —— 不要在卡片里自己再算一遍农历。
*
* ⚠️ 图标按**分类**给(v62 第 2 条):走 `AnnivIcon::svg()`,颜色跟着文字色;
* 与日历里的 emoji 是同一套 key(见 AnnivIcon 的类注释)。
*
* @var array $cardData['days'] 每项含 date/title/kind/icon/age/nth/days
*/
$annRows = (array)($cardData['days'] ?? []);
?>
<div class="hc-body">
<?php if (!$annRows): ?>
<p class="empty-hint">未来 60 天里没有纪念日。</p>
<?php else: ?>
<ul class="ann-up hc-ann">
<?php foreach ($annRows as $a): ?>
<li class="ann-up-item">
<span class="ann-days"><?= (int)$a['days'] === 0 ? '今天' : ((int)$a['days'] . ' 天后') ?></span>
<span class="ann-ic"><?= \App\AnnivIcon::svg((string)($a['icon'] ?? ''), 15) ?></span>
<span class="ann-title"><?= e((string)$a['title']) ?></span>
<?php if (($a['age'] ?? null) !== null): ?>
<span class="small muted"><?= (int)$a['age'] ?> 岁</span>
<?php elseif (($a['nth'] ?? null) !== null): ?>
<span class="small muted">第 <?= (int)$a['nth'] ?> 个</span>
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</div>