72 lines
3.1 KiB
PHP
72 lines
3.1 KiB
PHP
<?php
|
||||
|
|
/**
|
|||
|
|
* 旅程「显示方式」设置(v54 用户 2026-10-16 第 5 条)。
|
|||
|
|
*
|
|||
|
|
* 用户原话:「3. 里面的设置让用户自己配置:**到底默认显示旅程列表,还是用地图显示**。」
|
|||
|
|
*
|
|||
|
|
* ⇒ 就两项:**列表** / **地图**。选哪个,以后进「旅程」模块就默认先显示哪个。
|
|||
|
|
* ⚠️ 这是**我自己的**偏好,存在 `user_settings.trip_default_view`(每人一份)——
|
|||
|
|
* 与"看板颜色""天气地点"同一层,改它绝不影响家人。
|
|||
|
|
* ⚠️ 名单页上的「列表 / 地图」标签页**任何时候都能手动切换**,
|
|||
|
|
* 这个设置只决定"**刚进来时**看哪个"(用户说的"默认"就是这个意思)。
|
|||
|
|
*
|
|||
|
|
* 变量:$current('list'|'map')
|
|||
|
|
*/
|
|||
|
|
$current = (string)($current ?? 'list');
|
|||
|
|
if (!in_array($current, ['list', 'map'], true)) {
|
|||
|
|
$current = 'list';
|
|||
|
|
}
|
|||
|
|
?>
|
|||
|
|
<div class="page-head">
|
|||
|
|
<h1>显示方式</h1>
|
|||
|
|
<span class="sub">打开「旅程」时默认先看哪个</span>
|
|||
|
|
<div class="actions">
|
|||
|
|
<a class="btn btn-ghost" href="<?= e(url('trips')) ?>">返回旅程</a>
|
|||
|
|
<?php $trSetCurrent = 'display'; require __DIR__ . '/_settings_menu.php'; ?>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="card card-pad">
|
|||
|
|
<h2 class="cinema-h2">
|
|||
|
|
默认视图
|
|||
|
|
<span class="hint">只影响你自己</span>
|
|||
|
|
</h2>
|
|||
|
|
<p class="small muted" style="margin:0 0 16px">
|
|||
|
|
进「旅程」时先显示<b>列表</b>还是<b>地图</b>。这只是"默认看哪个"——
|
|||
|
|
进去之后随时能用页面上的「列表 / 地图」切换,不受这里限制。
|
|||
|
|
</p>
|
|||
|
|
|
|||
|
|
<form method="post" action="<?= e(url('trips/display_save')) ?>">
|
|||
|
|
<?= csrf_field() ?>
|
|||
|
|
<div class="view-choice">
|
|||
|
|
<?php
|
|||
|
|
/* 两个单选项做成"卡片样":图标 + 名称 + 一句说明。
|
|||
|
|
⚠️ 用原生 radio(不是 JS 假按钮)—— 无 JS 也能提交,与全站口径一致。 */
|
|||
|
|
$opts = [
|
|||
|
|
'list' => ['列表', '一行一趟旅程,带封面与参与人。找某一趟、看详情走这里。'],
|
|||
|
|
'map' => ['地图', '把去过的旅程钉在地图上看空间分布。看"都去过哪儿"走这里。'],
|
|||
|
|
];
|
|||
|
|
foreach ($opts as $k => $o): ?>
|
|||
|
|
<label class="view-choice-item<?= $current === $k ? ' is-on' : '' ?>">
|
|||
|
|
<input type="radio" name="view" value="<?= e($k) ?>" <?= $current === $k ? 'checked' : '' ?>>
|
|||
|
|
<span class="vci-body">
|
|||
|
|
<b><?= e($o[0]) ?></b>
|
|||
|
|
<span class="small muted"><?= e($o[1]) ?></span>
|
|||
|
|
</span>
|
|||
|
|
</label>
|
|||
|
|
<?php endforeach; ?>
|
|||
|
|
</div>
|
|||
|
|
<div class="btn-row">
|
|||
|
|
<button class="btn" type="submit">保存</button>
|
|||
|
|
</div>
|
|||
|
|
</form>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="card card-pad" style="margin-top:16px">
|
|||
|
|
<h2 class="cinema-h2">地图上的点是哪来的</h2>
|
|||
|
|
<p class="small muted" style="margin-top:0">
|
|||
|
|
地图上每趟旅程一枚标记,位置按该旅程**各段行程的出发/到达地点**取一个代表点;
|
|||
|
|
没有坐标时退到**城市中心**(用内置的城市表,不联网)。
|
|||
|
|
所以想让某趟旅程出现在地图上,得在它里面把行程的<b>出发地 / 到达地</b>填上。
|
|||
|
|
</p>
|
|||
|
|
</div>
|