v11: 家谱按户排布(夫妻并排/长幼排序/父母括号/姻亲);观影设置下拉收拢影院·搜索·统计·年度报告;观影人头像
家谱(用户第 2 点,重写模板与 Kinship::tree): - 同代聚成「夫妻单元」(户):血亲当主位、配偶并排在其右,兄弟_姐妹按长幼(长子左) - 血亲可达性判「姻亲」:只走 parent/child 边从「我」可达者为本家血亲,妻子的父母 走不到 → 标「姻亲」并排到本代末尾(旧判据「上无父母且下无子女」对岳父母恒为假,是真 bug) - 父母括号连线:横杆盖住父母列到其子女各列,竖线落父母列中心、每子女列一道下线 - 称呼按长幼定死:姐夫/妹夫、嫂子/弟媳、大/小舅子、大/小姨子、大伯子/小叔子、 大姑子/小姑子、侄子/侄女、外甥/外甥女、堂/表 - 列宽地板 minmax(min-content,1fr):原 minmax(0,1fr) 在窄屏+户数多时把列压到卡片 (96px)以下 → 同代卡片互相重叠;.tnode 加 flex:0 0 auto 防被 flex 压扁 观影(用户第 3~5 点): - 顶栏删「影院」入口(影院是观影模块的子功能);观影列表右侧加「⚙ 设置」下拉, 内含 影院管理 / 高级搜索 / 统计 / 年度报告(后三者从 MovieLog 迁入, app/MovieStats.php + 三个只读路由,MySQL 方言;图表全用纯 CSS,不引 CDN) - 评价区删除「我」的长条徽标(被 flex column stretch 拉成整行宽的丑色带) - 观影人弹窗列表与已选 chips 带头像;syncChips 点名取 .att-name/.att-av (旧写法取「第一个 span」,v11 起那是隐藏占位,chip 上会没名字) 验证:e2e 432/0、桌面几何 268/0、移动几何 464/0、交互几何 97/0、 静态空跑 199/0、反向验证 v11 十条 10抓/0漏。本轮无 DB 变更(Schema 仍 v10)。 移动几何抓出两个真溢出并已修:高级搜索页 select 长选项撑破 .field、 原生 date 输入撑破 .date-range(360/375px)。
This commit is contained in:
@@ -21,6 +21,7 @@ use App\Family;
|
||||
use App\Kinship;
|
||||
use App\Movie;
|
||||
use App\MovieReview;
|
||||
use App\MovieStats;
|
||||
use App\Nickname;
|
||||
use App\Person;
|
||||
use App\PersonGroup;
|
||||
@@ -1714,7 +1715,7 @@ switch ($r) {
|
||||
'title' => '影院管理',
|
||||
'cinemas' => Cinema::all($familyId),
|
||||
'editing' => $editing,
|
||||
], 'cinemas');
|
||||
], 'movies');
|
||||
break;
|
||||
|
||||
case 'movies/cinemas_save':
|
||||
@@ -1757,6 +1758,69 @@ switch ($r) {
|
||||
redirect('movies/cinemas');
|
||||
break;
|
||||
|
||||
// ---------------- 统计 / 高级搜索 / 年度报告(v11,从 MovieLog 迁入) ----------------
|
||||
// 三个页面都挂在观影模块「设置」按钮下(顶栏不再单独放影院/统计入口)。
|
||||
// 只读,不需要 requireWrite —— 访客也能看统计,与观影列表同一口径。
|
||||
|
||||
/** 统计仪表板 */
|
||||
case 'movies/stats':
|
||||
$familyId = (int)Auth::familyId();
|
||||
View::render('movies/stats', [
|
||||
'title' => '观影统计',
|
||||
'ov' => MovieStats::overview($familyId),
|
||||
'byCinema' => MovieStats::byCinema($familyId),
|
||||
'byPerson' => MovieStats::byPerson($familyId),
|
||||
'byMonth' => MovieStats::byMonth($familyId, 12),
|
||||
'byYear' => MovieStats::byYear($familyId),
|
||||
], 'movies');
|
||||
break;
|
||||
|
||||
/** 高级搜索(组合条件;条件全空时不查,页面提示先设置条件) */
|
||||
case 'movies/search':
|
||||
$familyId = (int)Auth::familyId();
|
||||
$p = [
|
||||
'title' => trim((string)($_GET['title'] ?? '')),
|
||||
'cinema_id' => trim((string)($_GET['cinema_id'] ?? '')),
|
||||
'person_id' => trim((string)($_GET['person_id'] ?? '')),
|
||||
'date_from' => trim((string)($_GET['date_from'] ?? '')),
|
||||
'date_to' => trim((string)($_GET['date_to'] ?? '')),
|
||||
];
|
||||
$hasCond = false;
|
||||
foreach ($p as $v) {
|
||||
if ($v !== '' && $v !== '0') {
|
||||
$hasCond = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
View::render('movies/search', [
|
||||
'title' => '高级搜索',
|
||||
'cinemas' => Cinema::all($familyId),
|
||||
'persons' => Person::all($familyId, '', 'member', (int)Auth::personId()),
|
||||
'p' => $p,
|
||||
'hasCond' => $hasCond,
|
||||
'rows' => $hasCond ? MovieStats::search($familyId, $p) : [],
|
||||
], 'movies');
|
||||
break;
|
||||
|
||||
/** 年度报告(以登录者为中心) */
|
||||
case 'movies/report':
|
||||
$familyId = (int)Auth::familyId();
|
||||
$meId = (int)Auth::personId();
|
||||
$years = MovieStats::years($familyId);
|
||||
$year = (int)($_GET['year'] ?? 0);
|
||||
if ($year <= 0 || !in_array($year, $years, true)) {
|
||||
$year = $years ? (int)$years[0] : (int)date('Y');
|
||||
}
|
||||
$people = Person::map($familyId);
|
||||
View::render('movies/report', [
|
||||
'title' => $year . ' 年度观影报告',
|
||||
'year' => $year,
|
||||
'years' => $years ?: [$year],
|
||||
'stats' => MovieStats::annual($familyId, $meId, $year),
|
||||
'meName' => (string)($people[$meId]['name'] ?? '我'),
|
||||
], 'movies');
|
||||
break;
|
||||
|
||||
// ---------------- 评价与讨论(v9,MovieLog 同款) ----------------
|
||||
// 评价人是「登录账号背后的人」,与同行观影人无关;访客只读(requireWrite)。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user