家谱卡片重做 / 首页控制台 / 名册改列表 / 重复日程与旅程公开
用户 2026-10-03 提的四条:
① 家谱卡片重做
· 去掉「⇄ 姻亲」按钮,改成**每个人**卡片右下角都有「以 TA 为中心」
(点了以他重画一张家谱,涵盖原来的姻亲场景)。
· 头像外框改**长方形**(96×72,宽度贴合头像),object-fit: contain 不裁切,
姓名/称呼在头像下方。
· 修「点右下角按钮误进成员页」:卡片不再整张是 <a>,
只有姓名是链接,右下角是独立的 <button>(物理上分开,不抢点击)。
② 家谱文案与按钮清理
· 去掉副标题与下方图例说明;整块去掉「看全部 / 回到我 / 回到我的家谱」
(顺带消掉"出现两个回到我的家谱")。镜头由库自动 fit,拖拽/滚轮即可。
③ 首页控制台
· 标题下显示个人 slogan;去掉右侧三个统计;「我的资料/我的家谱」换成图标按钮;
去掉与导航条重复的「名册」按钮。
· 去掉「接下来的日子」(生日归到"未来七天"里,不再重复)。
· 新增统计信息块:按时段随机问候 + 今日天气(Open-Meteo,免 key,可留空不显示)
+ 近七天日程/待办/逾期数。
· 新增各模块小结卡(任务/日程/纪念日/观影/旅程/财务/名册/家谱/资源)。
· 个人设置新增「首页上的模块」:可勾选与拖动排序(每人一份,存 user_settings)。
· 保留「往年的今天」。
④ 名册改列表
· 卡片网格 → **竖向列表**:左头像、中间姓名+与我的关系+手机号+生日。
· 修拖动「只能往后不能往前」:落点改为显式记录"插到谁前面/后面",
并排除被拖元素自身。
· 去掉那句拖动提示(能力保留)。
· 搜索新增**姓名首字母**检索(y / yy / yyq 都命中「杨永全」):
新 app/Pinyin.php,intl 优先 + 内置常用字表兜底(本地无 intl 也能测);
纯字母/数字查询词不走 SQL LIKE(拼音与加密手机号在库里都比不了)。
附带上两轮的收尾:
· 菜单点外部自动关闭(全局事件委托,覆盖所有 details.menu)。
· 旅程 is_public:列表与日历只显示公开的;详情页不拦(不丢数据)。
· 重复日程:新 app/Repeat.php(RRULE 解析/生成/展开,含"工作日"),
新表 calendar_event_skips(RFC 的 EXDATE);日历按规则展开;
编辑支持三档「全部 / 这一次及以后 / 仅此一次」。
· 结束时间可添加/去掉,并随开始时间联动。
验证:端到端 772 项通过 / 0 失败;几何 368、交互 97、移动端 516、家谱 26、
升级 123 全绿;SQL 列名静态校验 0 处可疑;部署 11 条线上探针全过。
This commit is contained in:
+102
-59
@@ -2,93 +2,136 @@
|
||||
/**
|
||||
* 首页 —— 一块 dashboard(用户 2026-10-01 第 13 条)。
|
||||
*
|
||||
* 现在首页只回答三个问题:**最近有什么事**、**手头在做什么**、**往年这时候我们在干嘛**。
|
||||
* · 接下来的日子(两个月内的生日)
|
||||
* 用户 2026-10-03 第 3 条把它重排成:
|
||||
* · hero:标题 + 个人 slogan + 两个图标按钮(我的资料 / 我的家谱)
|
||||
* · 统计信息:随机问候语 + 今日天气 + 近七天日程数 / 待办数
|
||||
* · 未来七天的日程(自定义 + 观影 + 旅行 + 有截止时间的任务,一次汇总)
|
||||
* · 进行中的任务(含已过期的待办)
|
||||
* · 往年今日(往年的这一天看过的电影 / 走过的旅程)
|
||||
* · 手头在做(进行中 + 已逾期的任务)
|
||||
* · 各模块的统计与模块内信息(**可按人在个人设置里开关与排序**)
|
||||
* · 往年今日
|
||||
* ⚠️ 「接下来的日子(两个月内的生日)」已去掉:生日/纪念日本来就是日程,
|
||||
* 已经在「未来七天」里,两块并排是重复。
|
||||
*
|
||||
* ⚠️ **家人卡片已经不在首页了**(用户明确要求):看人去「名册」、看关系去「家谱」,
|
||||
* 首页留给"今天该关心什么"。统计数字仍在,因为那是唯一的全局概览。
|
||||
*
|
||||
* ⚠️ 标题下的那句个人口号已按用户要求撤掉(v8):hero 区只留标题与三个统计。
|
||||
*/
|
||||
$kinCount = count($kin);
|
||||
// 生日事件上用简称,卡片才不会一行塞不下;长名字在详情页里出
|
||||
$shortKind = \App\Birthday::KINDS;
|
||||
$today = date('Y-m-d');
|
||||
// 首页要显示哪些模块、什么顺序 —— 用户在「个人设置 → 首页上的模块」里定(每人一份)
|
||||
$homeMods = array_values(array_filter(
|
||||
(array)($homeModules ?? []),
|
||||
static fn($k) => \App\Module::exists((string)$k)
|
||||
));
|
||||
?>
|
||||
<?php /* 用户 2026-10-03 第 3 条:
|
||||
① 标题下显示**个人 slogan**(原来撤掉了,现在要回来);
|
||||
② 右侧那三块统计(与我有关 / 名册总数 / 亲属连线)**去掉**;
|
||||
③ 「我的资料 / 我的家谱」保留,但从文字按钮换成**图标按钮**;
|
||||
④ 「名册」按钮去掉 —— 它与顶部导航条里的「名册」重复。
|
||||
⚠️ 图标用行内 SVG(不引外部字体/图片),与观影设置下拉同一套做法。 */ ?>
|
||||
<section class="hero">
|
||||
<img class="hero-logo" src="<?= e(asset('/assets/icons/icon-192.png')) ?>" alt="">
|
||||
<div class="hero-main">
|
||||
<h1><?= e(\App\Auth::homeTitle()) ?></h1>
|
||||
</div>
|
||||
<div class="hero-stats">
|
||||
<div class="stat"><b><?= (int)$kinCount ?></b><span>与我有关</span></div>
|
||||
<div class="stat"><b><?= (int)$allCount ?></b><span>名册总数</span></div>
|
||||
<div class="stat"><b><?= (int)$relCount ?></b><span>亲属连线</span></div>
|
||||
<?php $heroSlogan = trim((string)($mySlogan ?? '')) !== ''
|
||||
? (string)$mySlogan
|
||||
: trim((string)($family['motto'] ?? '')); ?>
|
||||
<?php if ($heroSlogan !== ''): ?>
|
||||
<p class="hero-slogan"><?= e($heroSlogan) ?></p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php /* ⚠️ 这两个链接必须带上真实的 person id:曾经 layout.php 里写
|
||||
`$me = Auth::check()` 把模板里的 $me 覆盖成布尔值,链接就变成 id=0
|
||||
("补充亲属关系"点进去是空白页)。所以这里显式用 $meId。 */ ?>
|
||||
<div class="hero-actions">
|
||||
<a class="btn btn-ghost btn-sm" href="<?= e(url('people/show', ['id' => (int)$meId])) ?>">我的资料</a>
|
||||
<a class="btn btn-ghost btn-sm" href="<?= e(url('kin')) ?>">我的家谱</a>
|
||||
<a class="btn btn-ghost btn-sm" href="<?= e(url('people')) ?>">名册</a>
|
||||
<a class="icon-btn" href="<?= e(url('people/show', ['id' => (int)$meId])) ?>"
|
||||
title="我的资料" aria-label="我的资料">
|
||||
<svg viewBox="0 0 20 20" width="20" height="20" aria-hidden="true" fill="none"
|
||||
stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round">
|
||||
<circle cx="10" cy="7" r="3.4"/><path d="M3.6 17c0-3.3 2.9-5.4 6.4-5.4s6.4 2.1 6.4 5.4"/>
|
||||
</svg>
|
||||
</a>
|
||||
<a class="icon-btn" href="<?= e(url('kin')) ?>"
|
||||
title="我的家谱" aria-label="我的家谱">
|
||||
<svg viewBox="0 0 20 20" width="20" height="20" aria-hidden="true" fill="none"
|
||||
stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round">
|
||||
<rect x="7.4" y="2.2" width="5.2" height="4.2" rx="1"/>
|
||||
<rect x="2.2" y="13.6" width="5.2" height="4.2" rx="1"/>
|
||||
<rect x="12.6" y="13.6" width="5.2" height="4.2" rx="1"/>
|
||||
<path d="M10 6.4v3.4M4.8 13.6v-1.9h10.4v1.9M4.8 11.7h10.4"/>
|
||||
</svg>
|
||||
</a>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<?php /* ==================== 接下来的日子 ==================== */
|
||||
/* ⚠️ 即使近两个月没人过生日,这一块也**照常渲染**(给空态),只是内容为空。
|
||||
理由:dashboard 的四块是"每天要看的东西",某一块忽然整块消失会让人以为
|
||||
功能坏了 / 数据丢了(旧版就是 `if ($birthdays)` 一省略了之)。
|
||||
空态还能顺带告诉用户"系统在盯着生日,只是最近没有"。 */ ?>
|
||||
<?php /* 用户 2026-10-03 第 3 条:「接下来的日子(两个月内)」整块**去掉** ——
|
||||
它列的是生日,而生日/纪念日本来就是日程,已经在下面的「未来七天」里出现过,
|
||||
两块并排是重复信息。生日的"提前提醒"由日历与纪念日模块负责。 */
|
||||
?>
|
||||
|
||||
<?php /* ==================== 统计信息(用户第 3 条) ====================
|
||||
一句话问候 + 今天的天气 + 几个数字。放在最上面,因为它回答的是
|
||||
"今天是个什么日子、我该关心什么"——比下面任何一个列表都更该先看到。 */ ?>
|
||||
<section class="section">
|
||||
<h2 class="section-title">接下来的日子 <span class="hint">两个月内</span></h2>
|
||||
<?php if (!$birthdays): ?>
|
||||
<div class="card card-pad empty"><b>近两个月没有人过生日</b>等到了月份,这里会自动冒出来。</div>
|
||||
<?php else: ?>
|
||||
<div class="bdays">
|
||||
<?php foreach ($birthdays as $b): ?>
|
||||
<?php
|
||||
// 同一个人可能出两条(农历与阳历不在同一天);落在同一天时后端已经并成一条,
|
||||
// kinds 里会有多项 —— 这里照着列出来,用户才知道"今天过的是哪个生日"。
|
||||
$bkinds = (array)($b['kinds'] ?? []);
|
||||
$bwords = [];
|
||||
foreach ($bkinds as $k) {
|
||||
$bwords[] = $shortKind[$k] ?? (string)$k;
|
||||
}
|
||||
$bshown = (string)($b['shown'] ?? $b['name'] ?? '');
|
||||
?>
|
||||
<a class="bday" href="<?= e(url('people/show', ['id' => (int)$b['id']])) ?>">
|
||||
<img src="<?= e(avatar_url($b['avatar'])) ?>" alt="">
|
||||
<div>
|
||||
<b><?= e($bshown) ?></b>
|
||||
<?php if (!empty($b['label']) && $b['label'] !== '我'): ?>
|
||||
<span class="badge"><?= e($b['label']) ?></span>
|
||||
<?php endif; ?>
|
||||
<div class="d">
|
||||
<?php if ((int)$b['days_left'] === 0): ?>
|
||||
就是今天,生日快乐
|
||||
<?php else: ?>
|
||||
还有 <?= (int)$b['days_left'] ?> 天过生日
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="bday-meta">
|
||||
<span class="bday-date"><?= e((string)$b['date']) ?></span>
|
||||
<?php foreach ($bwords as $w): ?>
|
||||
<span class="bd-kind"><?= e($w) ?></span>
|
||||
<?php endforeach; ?>
|
||||
<?php if (!empty($b['lunar_label'])): ?>
|
||||
<span class="muted small">农历<?= e((string)$b['lunar_label']) ?></span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="card card-pad home-brief">
|
||||
<div class="home-brief-hello">
|
||||
<b><?= e((string)($greeting ?? '')) ?></b>
|
||||
<span class="muted small"><?= e(date('n 月 j 日')) ?> <?= e((string)($weekday ?? '')) ?></span>
|
||||
</div>
|
||||
<?php if (!empty($weather)): ?>
|
||||
<div class="home-brief-weather">
|
||||
<span class="w-icon" aria-hidden="true"><?= e((string)($weather['icon'] ?? '')) ?></span>
|
||||
<span class="w-temp"><?= e((string)($weather['temp'] ?? '')) ?></span>
|
||||
<span class="w-desc"><?= e((string)($weather['text'] ?? '')) ?></span>
|
||||
<?php if (($weather['place'] ?? '') !== ''): ?>
|
||||
<span class="muted small"><?= e((string)$weather['place']) ?></span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="home-brief-stats">
|
||||
<span class="hbs"><b><?= (int)($stat7['events'] ?? 0) ?></b> 条日程(近七天)</span>
|
||||
<span class="hbs"><b><?= (int)($stat7['todos'] ?? 0) ?></b> 件待办</span>
|
||||
<span class="hbs"><b><?= (int)($stat7['overdue'] ?? 0) ?></b> 件逾期</span>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<?php /* ==================== 各模块统计(用户第 3 条) ====================
|
||||
每个模块给一个"一眼看得懂的小结"。用户在个人设置里能挑显示哪些、以及顺序。 */ ?>
|
||||
<?php if ($homeMods && !empty($moduleCards)): ?>
|
||||
<section class="section">
|
||||
<div class="page-head" style="margin-bottom:12px">
|
||||
<h1 style="font-size:15px">家里的近况</h1>
|
||||
<div class="actions">
|
||||
<a class="btn btn-ghost btn-sm" href="<?= e(url('settings/me')) ?>#home-mods">调整显示</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mod-cards">
|
||||
<?php foreach ($homeMods as $mk): ?>
|
||||
<?php $mc = $moduleCards[$mk] ?? null; if (!$mc) { continue; } ?>
|
||||
<a class="mod-card" href="<?= e((string)$mc['href']) ?>"
|
||||
style="--mc: <?= e((string)($mc['color'] ?? '#888')) ?>">
|
||||
<div class="mod-card-head">
|
||||
<span class="mod-card-icon"><?= $mc['icon'] /* 行内 SVG,自己人写的,不转义 */ ?></span>
|
||||
<span class="mod-card-name"><?= e((string)$mc['name']) ?></span>
|
||||
</div>
|
||||
<?php if (($mc['big'] ?? '') !== ''): ?>
|
||||
<div class="mod-card-big"><?= e((string)$mc['big']) ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($mc['lines'])): ?>
|
||||
<ul class="mod-card-lines">
|
||||
<?php foreach ($mc['lines'] as $ln): ?>
|
||||
<li><?= e((string)$ln) ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php /* ==================== 日程(未来七天) ==================== */ ?>
|
||||
<section class="section">
|
||||
|
||||
Reference in New Issue
Block a user