2026-09-30 11:06:22 +08:00
|
|
|
|
<?php
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 个人设置 —— 「我自己的」设置。
|
|
|
|
|
|
*
|
|
|
|
|
|
* 与「系统设置」(?r=settings,仅管理员)的分工:
|
2026-09-30 13:24:26 +08:00
|
|
|
|
* · 系统设置改一次**全家都变**:slogan 兜底、附件存储、运行环境、**公共分组**;
|
2026-10-06 03:14:18 +08:00
|
|
|
|
* · 个人设置只影响**我自己看到的样子**:我自己的分组、天气地点、首页与导航的模块。
|
2026-09-30 11:06:22 +08:00
|
|
|
|
*
|
2026-09-30 13:24:26 +08:00
|
|
|
|
* ⚠️ 「我的资料」表单**不在这页**(用户明确要求合并):
|
|
|
|
|
|
* 「编辑成员」和「改自己的资料」本来就是一件事,所以只剩
|
2026-10-06 03:14:18 +08:00
|
|
|
|
* `templates/people/form.php` 那一张表单,两个入口都指过去。
|
|
|
|
|
|
*
|
|
|
|
|
|
* ────────────────────────────────────────────────────────────────
|
|
|
|
|
|
* v24 第 20 批 第 2 条(用户明确"不要了"的三处,都已删除):
|
|
|
|
|
|
* ① 页头那句副标题「只影响你自己看到的样子」—— **删掉**(用户点名);
|
|
|
|
|
|
* ② 「我怎么称呼家人」整张卡片(templates/settings/_nicknames.php)
|
|
|
|
|
|
* —— **不再加载**。⚠️ 「我叫他什么」这个能力本身还在(名册/详情页里照常出现、
|
|
|
|
|
|
* `person_name()` 照常按昵称显示);只是不再在这页单独占一张卡。
|
|
|
|
|
|
* 所以是"撤掉入口"而不是"删功能",数据一个字没动。
|
|
|
|
|
|
* ③ 「我的资料」卡片(姓名/头像/生日那句 + 两个按钮)—— **删掉**。
|
|
|
|
|
|
* ⚠️ 改资料的入口在别处都还有:右上角头像下拉 →「个人设置」进来后有页头那个
|
|
|
|
|
|
* 「编辑我的资料」按钮,名册与详情页也各有「编辑资料」;所以不会"进不去"。
|
|
|
|
|
|
* 页头那个按钮**保留**(它就是"我的资料"现在唯一的入口,删了就真没地方点了)。
|
2026-09-30 11:06:22 +08:00
|
|
|
|
*/
|
|
|
|
|
|
$groupCounts = $groupCounts ?? [];
|
|
|
|
|
|
$groupTotal = count($groups);
|
2026-09-30 13:24:26 +08:00
|
|
|
|
$rosterCount = $rosterCount ?? 0;
|
2026-09-30 11:06:22 +08:00
|
|
|
|
?>
|
|
|
|
|
|
<div class="page-head">
|
|
|
|
|
|
<h1>个人设置</h1>
|
2026-10-06 03:14:18 +08:00
|
|
|
|
<?php /* v24 第 20 批 第 2 条:副标题「只影响你自己看到的样子」按用户要求删除 */ ?>
|
2026-09-30 11:06:22 +08:00
|
|
|
|
<div class="actions">
|
2026-09-30 13:24:26 +08:00
|
|
|
|
<a class="btn btn-sm" href="<?= e(url('people/edit', ['id' => (int)$person['id']])) ?>">编辑我的资料</a>
|
2026-09-30 11:06:22 +08:00
|
|
|
|
<a class="btn btn-ghost btn-sm" href="<?= e(url('people/show', ['id' => (int)$person['id']])) ?>">看我的详情页</a>
|
|
|
|
|
|
<?php if (\App\Auth::isAdmin()): ?>
|
|
|
|
|
|
<a class="btn btn-ghost btn-sm" href="<?= e(url('settings')) ?>">系统设置</a>
|
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
2026-10-06 03:14:18 +08:00
|
|
|
|
<?php /* v24 第 20 批 第 2 条:原来这里有两块,用户要求都删掉 ——
|
|
|
|
|
|
① 「我的资料」卡片(姓名 + slogan + 「编辑我的资料 / 改登录密码」两个按钮)
|
|
|
|
|
|
② 「我怎么称呼家人」卡片(require _nicknames.php)
|
|
|
|
|
|
下面直接接天气地点。改登录密码在右上角头像下拉里也有入口。 */ ?>
|
2026-09-30 11:06:22 +08:00
|
|
|
|
|
2026-10-03 15:01:38 +08:00
|
|
|
|
<!-- ==================== 天气地点(用户 2026-10-03 第 1 条)==================== -->
|
|
|
|
|
|
<?php /* 原话:「天气这个这样吧,让用户在个人设置中填写自己的城市。」
|
|
|
|
|
|
所以地点从系统设置搬到了这里 —— 而且改成**城市名**,不是经纬度:
|
|
|
|
|
|
填坐标是我们要解决的实现细节(App\Geo 内置 197 个地级市离线查),
|
|
|
|
|
|
不该甩给用户。内置表里没有的(镇 / 村 / 海外)才需要填坐标。 */ ?>
|
|
|
|
|
|
<div class="card card-pad" id="weather" style="margin-top:20px">
|
2026-10-06 12:08:40 +08:00
|
|
|
|
<?php /* v24 第 21 批 第 3 条(用户原话):
|
|
|
|
|
|
「天气设置那里,把:只影响你自己首页上的那一格 / 填个城市名就行(如「青岛」)。
|
|
|
|
|
|
首页那句问候旁边会显示这儿的天气 —— 每人一份,孩子在外地读书,
|
|
|
|
|
|
他填他的、你看你的。/ 留空就是不显示天气(不影响别的东西)。 这些提示,都删除。
|
|
|
|
|
|
把城市单独放一行,精度维度放在一行。」
|
|
|
|
|
|
|
|
|
|
|
|
→ ① 标题旁那句 hint、标题下那整段说明,**全删**(三处提示);
|
|
|
|
|
|
② 版式改成两行:第一行「城市」独占一行(它是要填的那个,得宽敞),
|
|
|
|
|
|
第二行「纬度 / 经度」并排一行。
|
|
|
|
|
|
⚠️ 删的只是**说明文字**:城市/纬度/经度三个输入框、保存按钮、
|
|
|
|
|
|
以及下面那句"现在按 XX 取天气"的状态回显**都保留** ——
|
|
|
|
|
|
那些是"填了之后发生了什么的反馈",不是啰嗦的提示。 */ ?>
|
|
|
|
|
|
<h2 class="section-title">天气 · 我所在的城市</h2>
|
2026-10-03 15:01:38 +08:00
|
|
|
|
|
|
|
|
|
|
<form method="post" action="<?= e(url('settings/weather')) ?>">
|
|
|
|
|
|
<?= csrf_field() ?>
|
2026-10-06 12:08:40 +08:00
|
|
|
|
<?php /* 第一行:城市单独一行(占满宽度) */ ?>
|
|
|
|
|
|
<div class="field">
|
|
|
|
|
|
<label for="w-city">城市</label>
|
|
|
|
|
|
<input class="input" id="w-city" name="city" maxlength="30"
|
|
|
|
|
|
value="<?= e((string)($weatherCity ?? '')) ?>"
|
|
|
|
|
|
placeholder="如:青岛 / 山东青岛 / 内蒙古包头" autocomplete="off">
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<?php /* 第二行:精度维度(纬度 / 经度)同一行 */ ?>
|
|
|
|
|
|
<div class="loc-row">
|
2026-10-03 15:01:38 +08:00
|
|
|
|
<div class="field">
|
|
|
|
|
|
<label for="w-lat">纬度(可选)</label>
|
|
|
|
|
|
<input class="input" id="w-lat" name="lat" value="<?= e((string)($weatherLat ?? '')) ?>"
|
|
|
|
|
|
placeholder="内置表里没有的地方才需要">
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="field">
|
|
|
|
|
|
<label for="w-lon">经度(可选)</label>
|
|
|
|
|
|
<input class="input" id="w-lon" name="lon" value="<?= e((string)($weatherLon ?? '')) ?>"
|
|
|
|
|
|
placeholder="如 120.38">
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="btn-row">
|
|
|
|
|
|
<button class="btn" type="submit">保存天气地点</button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</form>
|
|
|
|
|
|
|
|
|
|
|
|
<?php if (!empty($weatherAt)): ?>
|
|
|
|
|
|
<p class="small muted" style="margin:12px 0 0">
|
|
|
|
|
|
现在按 <b><?= e((string)$weatherAt['place']) ?></b>
|
|
|
|
|
|
(<?= e((string)$weatherAt['lat']) ?> , <?= e((string)$weatherAt['lon']) ?>)取天气。
|
|
|
|
|
|
<?php if (($weatherCity ?? '') !== ''): ?>
|
|
|
|
|
|
不是这里?换个写法试试,比如加上省份:「山东青岛」。
|
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
</p>
|
|
|
|
|
|
<?php elseif (($weatherCity ?? '') !== ''): ?>
|
|
|
|
|
|
<p class="small muted" style="margin:12px 0 0">
|
|
|
|
|
|
<b class="warn-label">这个城市名没认出坐标</b>(首页就看不到天气了)。
|
|
|
|
|
|
换个写法试试(如「山东青岛」),或者直接填经纬度。
|
|
|
|
|
|
</p>
|
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<?php
|
|
|
|
|
|
// 内置表里有几个城市,直接说清楚 —— 用户不用猜"到底支持哪些"
|
|
|
|
|
|
$fbCityN = count(\App\Geo::CITIES);
|
|
|
|
|
|
?>
|
|
|
|
|
|
<p class="small muted" style="margin:10px 2px 0">
|
|
|
|
|
|
内置了 <b><?= (int)$fbCityN ?></b> 个城市(全国地级市 + 直辖市),一般常用的都在里面。
|
|
|
|
|
|
</p>
|
|
|
|
|
|
|
2026-09-30 13:24:26 +08:00
|
|
|
|
<!-- ==================== 我的分组 ==================== -->
|
2026-09-30 11:06:22 +08:00
|
|
|
|
<div class="card card-pad" style="margin-top:20px">
|
|
|
|
|
|
<h2 class="section-title">
|
2026-09-30 13:24:26 +08:00
|
|
|
|
我的分组
|
|
|
|
|
|
<span class="hint">公共的 + 我自己加的</span>
|
2026-09-30 11:06:22 +08:00
|
|
|
|
</h2>
|
|
|
|
|
|
<p class="small muted" style="margin:0 0 16px">
|
2026-09-30 13:24:26 +08:00
|
|
|
|
名册是按「关系分组」分栏显示的。这里有两层:
|
|
|
|
|
|
<b>公共分组</b>由管理员在「系统设置」里维护(全家都能用);
|
|
|
|
|
|
你要是觉得不够,就在下面<b>加只给自己看的分组</b>,别人看不到、也不受影响。
|
|
|
|
|
|
<br>
|
|
|
|
|
|
列表里 <b>{{ 公共 }}</b> 标的是大家共用的那几个。
|
|
|
|
|
|
哪一组排前面也是你自己的习惯,用 ▲ ▼ 调 —— 别人看到的顺序不变。
|
|
|
|
|
|
<br>
|
|
|
|
|
|
你的名册现在有 <b><?= (int)$rosterCount ?></b> 人。
|
2026-09-30 11:06:22 +08:00
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
|
|
<?php if (!$groups): ?>
|
2026-09-30 13:24:26 +08:00
|
|
|
|
<p class="small muted" style="margin:0 0 14px">还没有分组。加一个吧。</p>
|
2026-09-30 11:06:22 +08:00
|
|
|
|
<?php else: ?>
|
|
|
|
|
|
<ol class="order-list">
|
2026-09-30 13:24:26 +08:00
|
|
|
|
<?php foreach ($groups as $i => $g): $gid = (int)$g['id']; $own = (int)$g['owner_id']; ?>
|
2026-09-30 11:06:22 +08:00
|
|
|
|
<li class="order-row">
|
|
|
|
|
|
<span class="order-no"><?= $i + 1 ?></span>
|
2026-09-30 13:24:26 +08:00
|
|
|
|
<span class="order-name">
|
|
|
|
|
|
<?= e((string)$g['name']) ?>
|
|
|
|
|
|
<?php if ($own === 0): ?><span class="badge">公共</span><?php else: ?><span class="badge badge-open">我的</span><?php endif; ?>
|
|
|
|
|
|
</span>
|
2026-09-30 11:06:22 +08:00
|
|
|
|
<span class="order-count"><?= (int)($groupCounts[$gid] ?? 0) ?> 人</span>
|
|
|
|
|
|
<form method="post" action="<?= e(url('settings/groups/move')) ?>" class="order-move">
|
|
|
|
|
|
<?= csrf_field() ?>
|
|
|
|
|
|
<input type="hidden" name="id" value="<?= $gid ?>">
|
2026-09-30 13:24:26 +08:00
|
|
|
|
<input type="hidden" name="scope" value="me">
|
2026-09-30 11:06:22 +08:00
|
|
|
|
<button class="btn btn-ghost btn-sm" type="submit" name="dir" value="up"
|
|
|
|
|
|
title="上移一组" <?= $i === 0 ? 'disabled' : '' ?>>▲</button>
|
|
|
|
|
|
<button class="btn btn-ghost btn-sm" type="submit" name="dir" value="down"
|
|
|
|
|
|
title="下移一组" <?= $i === $groupTotal - 1 ? 'disabled' : '' ?>>▼</button>
|
|
|
|
|
|
</form>
|
|
|
|
|
|
</li>
|
|
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
|
</ol>
|
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
|
|
2026-09-30 13:24:26 +08:00
|
|
|
|
<form method="post" action="<?= e(url('settings/groups/add')) ?>" class="inline-form" style="margin-top:16px">
|
2026-09-30 11:06:22 +08:00
|
|
|
|
<?= csrf_field() ?>
|
2026-09-30 13:24:26 +08:00
|
|
|
|
<input type="hidden" name="scope" value="me">
|
|
|
|
|
|
<label class="sr-only" for="newMyGroup">新分组名</label>
|
|
|
|
|
|
<input class="input" id="newMyGroup" name="name" maxlength="20" placeholder="例如:球友、老同学">
|
|
|
|
|
|
<button class="btn btn-sm" type="submit">加一个我自己的分组</button>
|
2026-09-30 11:06:22 +08:00
|
|
|
|
</form>
|
|
|
|
|
|
|
2026-09-30 13:24:26 +08:00
|
|
|
|
<?php
|
|
|
|
|
|
// 只有我自己建的分组才给改名 / 删除 —— 公共分组要在系统设置里改(那是管理员的事),
|
|
|
|
|
|
// 免得有人在自己设置里把"家人"改成别的、影响全家。
|
|
|
|
|
|
$mineGroups = array_values(array_filter($groups, fn($g) => (int)$g['owner_id'] > 0));
|
|
|
|
|
|
?>
|
|
|
|
|
|
<?php if ($mineGroups): ?>
|
|
|
|
|
|
<ul class="group-manage" style="margin-top:14px">
|
|
|
|
|
|
<?php foreach ($mineGroups as $g): $gid = (int)$g['id']; ?>
|
2026-09-30 11:06:22 +08:00
|
|
|
|
<li class="group-manage-row">
|
|
|
|
|
|
<form method="post" action="<?= e(url('settings/groups/rename')) ?>" class="group-rename">
|
|
|
|
|
|
<?= csrf_field() ?>
|
|
|
|
|
|
<input type="hidden" name="id" value="<?= $gid ?>">
|
2026-09-30 13:24:26 +08:00
|
|
|
|
<input type="hidden" name="scope" value="me">
|
|
|
|
|
|
<label class="sr-only" for="gname<?= $gid ?>">分组名</label>
|
2026-09-30 11:06:22 +08:00
|
|
|
|
<input class="input" id="gname<?= $gid ?>" name="name" maxlength="20"
|
|
|
|
|
|
value="<?= e((string)$g['name']) ?>">
|
|
|
|
|
|
<button class="btn btn-ghost btn-sm" type="submit">改名</button>
|
|
|
|
|
|
</form>
|
|
|
|
|
|
<span class="group-count muted small"><?= (int)($groupCounts[$gid] ?? 0) ?> 人</span>
|
|
|
|
|
|
<?php /* 删除做成两步(<details>),不用 JS 也能防手滑 —— 一点就没了太容易出事 */ ?>
|
|
|
|
|
|
<details class="del-wrap">
|
|
|
|
|
|
<summary class="btn btn-ghost btn-sm">删除</summary>
|
|
|
|
|
|
<form method="post" action="<?= e(url('settings/groups/delete')) ?>" class="del-confirm">
|
|
|
|
|
|
<?= csrf_field() ?>
|
|
|
|
|
|
<input type="hidden" name="id" value="<?= $gid ?>">
|
2026-09-30 13:24:26 +08:00
|
|
|
|
<input type="hidden" name="scope" value="me">
|
2026-09-30 11:06:22 +08:00
|
|
|
|
<span class="small muted">这组的人会变成「未分类」,确定?</span>
|
|
|
|
|
|
<button class="btn btn-ghost btn-sm danger" type="submit">确认删除</button>
|
|
|
|
|
|
</form>
|
|
|
|
|
|
</details>
|
|
|
|
|
|
</li>
|
|
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
<?php endif; ?>
|
2026-09-30 13:24:26 +08:00
|
|
|
|
|
|
|
|
|
|
<?php if (\App\Auth::isAdmin()): ?>
|
|
|
|
|
|
<p class="small muted" style="margin:16px 0 0">
|
|
|
|
|
|
公共分组在「<a href="<?= e(url('settings')) ?>#public-groups">系统设置</a>」里维护。
|
|
|
|
|
|
</p>
|
|
|
|
|
|
<?php endif; ?>
|
2026-09-30 11:06:22 +08:00
|
|
|
|
</div>
|
2026-10-02 09:28:07 +08:00
|
|
|
|
|
2026-10-03 11:30:48 +08:00
|
|
|
|
<!-- ==================== 首页上的模块(用户 2026-10-03 第 3 条)==================== -->
|
|
|
|
|
|
<?php /* 与下面「导航条上的模块」是同一套交互(勾选 + 拖动/▲▼ 排序),
|
|
|
|
|
|
只是作用对象换成首页 dashboard 上那几张模块卡。
|
|
|
|
|
|
两块都要有:导航条管"能不能进",这里管"首页上先看到什么"。 */ ?>
|
|
|
|
|
|
<div class="card card-pad" id="home-mods" style="margin-top:20px">
|
|
|
|
|
|
<h2 class="section-title">
|
|
|
|
|
|
首页上的模块
|
|
|
|
|
|
<span class="hint">勾上才会出现在首页,拖动可改顺序</span>
|
|
|
|
|
|
</h2>
|
|
|
|
|
|
<p class="small muted" style="margin:0 0 16px">
|
|
|
|
|
|
首页是"一眼看家里近况"的地方,模块太多会变成一面墙 —— 这里只挑你想每天看到的几个。
|
|
|
|
|
|
关掉的模块<b>照样能从顶部导航条进去</b>,只是不在首页上占位置。
|
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
|
|
<form method="post" action="<?= e(url('settings/home_save')) ?>" id="homeForm">
|
|
|
|
|
|
<?= csrf_field() ?>
|
|
|
|
|
|
<ol class="order-list mod-order" id="homeOrderList">
|
|
|
|
|
|
<?php
|
|
|
|
|
|
$hOn = array_map('strval', (array)($homeOn ?? []));
|
|
|
|
|
|
$hOrder = (array)($homeOrder ?? []);
|
|
|
|
|
|
?>
|
|
|
|
|
|
<?php foreach ($hOrder as $i => $k): ?>
|
|
|
|
|
|
<li class="order-row mod-row" draggable="true" data-key="<?= e($k) ?>">
|
|
|
|
|
|
<span class="drag-handle" title="拖我排序" aria-hidden="true">⋮⋮</span>
|
|
|
|
|
|
<input type="hidden" name="order[]" value="<?= e($k) ?>">
|
|
|
|
|
|
<label class="mod-pick">
|
|
|
|
|
|
<input type="checkbox" name="on[]" value="<?= e($k) ?>"
|
|
|
|
|
|
<?= in_array($k, $hOn, true) ? 'checked' : '' ?>>
|
|
|
|
|
|
<span class="color-preview"
|
|
|
|
|
|
style="background: <?= e(\App\Module::color($k, (int)\App\Auth::familyId())) ?>;"></span>
|
|
|
|
|
|
<span class="order-name"><?= e(\App\Module::name($k)) ?></span>
|
|
|
|
|
|
</label>
|
|
|
|
|
|
<span class="order-move">
|
|
|
|
|
|
<button class="btn btn-ghost btn-sm" type="submit" name="move" value="up:<?= e($k) ?>"
|
|
|
|
|
|
title="上移" <?= $i === 0 ? 'disabled' : '' ?>>▲</button>
|
|
|
|
|
|
<button class="btn btn-ghost btn-sm" type="submit" name="move" value="down:<?= e($k) ?>"
|
|
|
|
|
|
title="下移" <?= $i === count($hOrder) - 1 ? 'disabled' : '' ?>>▼</button>
|
|
|
|
|
|
</span>
|
|
|
|
|
|
</li>
|
|
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
|
</ol>
|
|
|
|
|
|
<div class="btn-row">
|
|
|
|
|
|
<button class="btn" type="submit" name="save" value="1">保存首页显示</button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</form>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
2026-10-02 09:28:07 +08:00
|
|
|
|
<!-- ==================== 模块:导航条上显示哪些、各自什么主题色 ==================== -->
|
|
|
|
|
|
<?php
|
|
|
|
|
|
$navKeys = \App\Module::navFor((int)\App\Auth::personId());
|
|
|
|
|
|
$colors = \App\Module::colors((int)\App\Auth::familyId());
|
|
|
|
|
|
require __DIR__ . '/_modules.php';
|
|
|
|
|
|
?>
|