Files
FamilyBook/templates/trips/_list_body.php
T
laoyang 7544fb9f6a v41 第 41 批:流水线提速 + 12 项界面/交互开发 + DAV 彻底修复
DAV(用户「务必彻底解决」):
- 真根因是 home-set 层级错:CalDav::HOME_PATH 原为 /dav/calendars/、
  CardDav 原为 /carddav/addressbooks/,而日历本/通讯录的 href 在
  /dav/N.ics/ 与 /carddav/N.vcf/ —— home-set 下面一本都没有。
  Thunderbird 按 home-set 前缀认成员,于是「找不到日历本 / 找不到联系人」。
  改为 /dav/ 与 /carddav/(所有既有 URL 一字不变,老配置不作废)。
- 又发现并修掉 Depth:0 违反 RFC 4918:原实现无论 depth 都列出全部子集合,
  且第一条 response 是日历本(不含 current-user-principal)。改为按 depth 分流,
  Depth:0 只回资源自身、Depth:1 才列出子集合。

界面与交互:
- 观影:新建影院弹窗层级修正 + 详细地址;照片左右按钮悬停不再位移;
  弹框底栏改「确定 / 取消」。
- 旅程:新建旅程改弹窗并按观影式排版;详情页四个动作按钮按用户指定顺序与配色;
  编辑与新增行程弹窗化(单容器 + AJAX);行程时间控件改 AntD(精确到分);
  参与人默认带上自己;车次号/车牌号紧跟交通方式词。
- 资源:新建/编辑改弹窗 + 观影式排版 + 新建时即定共享人。
- 纪念日:新建改弹框 + 观影式排版。

验证:
- e2e 1510/0;v41 十二项真机 48/0;DAV 反向验证 8/0;
  部署断言空跑 337/0;模板 div 深度三形态穷举 33 组全配平。
- 线上 DAV 终验(--resolve 真实入口 + 真 DAV 口令)12/0;
  线上确认 Depth:0 恰好 1 个 response。
2026-10-11 10:12:11 +08:00

62 lines
2.7 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* 旅程列表**主体**(搜索框 + 列表/空态)。
*
* 🔴 v41(用户 2026-10-10):单独抽出来,是为了"新建成功后**只换这一块**"
* (`#tripListHost` 的 innerHTML)—— 保留滚动位置、不整页闪白。
* 所以要保证:这块里的内容**只依赖** $rows / $total / $keyword / $canWrite。
*/
?>
<form class="search" method="get" action="index.php">
<input type="hidden" name="r" value="trips">
<input class="input" type="text" name="keyword" value="<?= e($keyword) ?>" placeholder="搜旅程名 / 去过的城市">
<button class="btn" type="submit">搜索</button>
<?php if ($keyword !== ''): ?>
<a class="search-clear" href="<?= e(url('trips')) ?>">清除</a>
<?php endif; ?>
</form>
<?php if (!$rows): ?>
<div class="card card-pad empty">
<b><?= $keyword !== '' ? '没有匹配的旅程' : '还没有旅程' ?></b>
<?= $keyword !== '' ? '换个关键词试试,或清除搜索看全部。'
: ($canWrite ? '点右上角「新建旅程」,把一次出行记下来;进去之后再加一段段行程。'
: '家人还没有记录旅程。') ?>
</div>
<?php else: ?>
<div class="trip-list">
<?php foreach ($rows as $t): ?>
<a class="trip-card" href="<?= e(url('trips/show', ['id' => (int)$t['id']])) ?>">
<div class="trip-cover">
<?php if (!empty($t['cover_key'])): ?>
<img src="<?= e(media_url((string)$t['cover_key'])) ?>" alt="">
<?php else: ?>
<span class="trip-cover-empty">🧳</span>
<?php endif; ?>
</div>
<div class="trip-main">
<h2 class="trip-title"><?= e((string)$t['title']) ?></h2>
<div class="trip-meta">
<?php /* 时间是从各段旅程算的;一段都没有时如实说"还没有旅程" */ ?>
<span><?= e(\App\Trip::activitySpan($t['starts_at'] ?? null, $t['ends_at'] ?? null)) ?></span>
<?php if (!empty($t['city'])): ?>
<span>📍 <?= e((string)$t['city']) ?></span>
<?php endif; ?>
<span><?= (int)($t['node_count'] ?? 0) ?> 段行程</span>
</div>
<?php if (!empty($t['summary'])): ?>
<p class="trip-sum"><?= e(mb_substr((string)$t['summary'], 0, 80, 'UTF-8')) ?></p>
<?php endif; ?>
<?php if (!empty($t['attendees'])): ?>
<div class="trip-people">
<?php foreach ($t['attendees'] as $a): ?>
<?= person_chip($a) ?>
<?php endforeach; ?>
</div>
<?php endif; ?>
</div>
</a>
<?php endforeach; ?>
</div>
<?php endif; ?>