2026-09-30 20:22:46 +08:00
|
|
|
<?php
|
|
|
|
|
/**
|
2026-10-01 00:12:04 +08:00
|
|
|
* 观影瀑布流(v9,MovieLog 同款海报墙)。
|
2026-09-30 20:22:46 +08:00
|
|
|
*
|
2026-10-01 00:12:04 +08:00
|
|
|
* 卡片 = 海报(2:3,无海报给渐变占位)+ 片名 + 日期/影院(主题色)/评分均分 + 同行人头像标签。
|
|
|
|
|
* 顶部搜索栏:关键词搜片名 / 影院 / 同行人(Movie::all 的 LIKE 查询)。
|
2026-09-30 20:22:46 +08:00
|
|
|
*/
|
|
|
|
|
$canWrite = \App\Auth::canWrite();
|
2026-10-01 00:12:04 +08:00
|
|
|
$fmtNum = static function ($v): string {
|
|
|
|
|
if ($v === null) {
|
|
|
|
|
return '';
|
|
|
|
|
}
|
|
|
|
|
return rtrim(rtrim(number_format((float)$v, 1, '.', ''), '0'), '.');
|
|
|
|
|
};
|
2026-09-30 20:22:46 +08:00
|
|
|
?>
|
|
|
|
|
<div class="page-head">
|
|
|
|
|
<h1>观影记录</h1>
|
2026-10-01 00:12:04 +08:00
|
|
|
<span class="sub">
|
|
|
|
|
<?php if ($keyword !== ''): ?>
|
|
|
|
|
找到 <?= (int)$total ?> 部匹配「<b><?= e($keyword) ?></b>」的电影
|
|
|
|
|
<?php else: ?>
|
|
|
|
|
共 <?= (int)$total ?> 部 · 按观影时间排序
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
</span>
|
2026-09-30 20:22:46 +08:00
|
|
|
<div class="actions">
|
2026-10-01 00:12:04 +08:00
|
|
|
<a class="btn btn-ghost btn-sm" href="<?= e(url('movies/cinemas')) ?>">影院管理</a>
|
2026-09-30 20:22:46 +08:00
|
|
|
<?php if ($canWrite): ?>
|
|
|
|
|
<a class="btn" href="<?= e(url('movies/new')) ?>">记一场电影</a>
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-10-01 00:12:04 +08:00
|
|
|
<form method="get" action="index.php" class="search-bar">
|
|
|
|
|
<input type="hidden" name="r" value="movies">
|
|
|
|
|
<input type="text" name="keyword" value="<?= e($keyword) ?>" placeholder="搜索片名、影院、观影人…" aria-label="搜索">
|
|
|
|
|
<button type="submit">搜索</button>
|
|
|
|
|
<?php if ($keyword !== ''): ?>
|
|
|
|
|
<a class="search-clear" href="<?= e(url('movies')) ?>">清除</a>
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
</form>
|
|
|
|
|
|
2026-09-30 20:22:46 +08:00
|
|
|
<?php if ($total === 0): ?>
|
|
|
|
|
<div class="card card-pad empty">
|
2026-10-01 00:12:04 +08:00
|
|
|
<b><?= $keyword !== '' ? '没有找到匹配的电影' : '还没有观影记录' ?></b>
|
|
|
|
|
<?= $keyword !== '' ? '换个关键词试试。' : '一家人一起看过的电影,都会以海报墙的方式排在这里。' ?>
|
2026-09-30 20:22:46 +08:00
|
|
|
</div>
|
|
|
|
|
<?php else: ?>
|
2026-10-01 00:12:04 +08:00
|
|
|
<div class="waterfall">
|
|
|
|
|
<?php foreach ($rows as $mv): ?>
|
|
|
|
|
<a class="movie-card" href="<?= e(url('movies/show', ['id' => (int)$mv['id']])) ?>">
|
|
|
|
|
<span class="card-image">
|
|
|
|
|
<?php if (!empty($mv['poster_key'])): ?>
|
|
|
|
|
<img src="<?= e(media_url($mv['poster_key'])) ?>" alt="<?= e($mv['title']) ?>" loading="lazy">
|
|
|
|
|
<?php else: ?>
|
|
|
|
|
<span class="placeholder-poster">
|
|
|
|
|
<span class="ph-icon" aria-hidden="true">影</span>
|
|
|
|
|
<span class="placeholder-title"><?= e($mv['title']) ?></span>
|
2026-09-30 20:22:46 +08:00
|
|
|
</span>
|
2026-10-01 00:12:04 +08:00
|
|
|
<?php endif; ?>
|
|
|
|
|
</span>
|
|
|
|
|
<span class="card-body">
|
|
|
|
|
<span class="card-title"><?= e($mv['title']) ?></span>
|
|
|
|
|
<span class="card-meta">
|
|
|
|
|
<span class="meta-date">📅 <?= e(\App\Movie::formatWatch($mv['starts_at'], $mv['ends_at'])) ?></span>
|
|
|
|
|
<?php if (!empty($mv['cinema_name'])): ?>
|
|
|
|
|
<span class="meta-cinema" style="color: <?= e((string)($mv['cinema_color'] ?: '#888888')) ?>;">🏛️ <?= e($mv['cinema_name']) ?></span>
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
<?php if (!empty($mv['review_count'])): ?>
|
|
|
|
|
<span class="meta-rating" title="共 <?= (int)$mv['review_count'] ?> 条评价">⭐ <?= e($fmtNum($mv['review_avg'])) ?><span class="meta-rating-max">/10</span></span>
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
</span>
|
|
|
|
|
<?php if (!empty($mv['attendee_names'])): ?>
|
|
|
|
|
<span class="card-viewers"><span class="viewer-tag">👥 <?= e($mv['attendee_names']) ?></span></span>
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
</span>
|
|
|
|
|
</a>
|
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
</div>
|
2026-09-30 20:22:46 +08:00
|
|
|
<?php endif; ?>
|