v24 第 2 轮:19 条清单收尾(附件预览/CalDAV/任务分类看板/全局选人/家谱/纪念日/财务)
用户 2026-10-02 提的 19 条需求,本轮完成剩下的 8 条 + CalDAV 服务端:
- ③ 附件:图片/视频给缩略图,PDF/Word/Excel 给**同尺寸**图标;可预览的在本页
弹层里看(不再新开标签页),渲染不了的点了直接下载;预览层右上角恒有下载按钮。
- ⑦b CalDAV:把「我的日历本」按 RFC 4791 只读子集分享出去(OPTIONS/PROPFIND/
REPORT/GET,写方法一律 403)。用**专用口令**(库里只存 sha256),不是登录口令。
- ⑨⑩ 任务:分类与看板都由用户自建;已完成的任务从看板消失,改在「已完成」页
按分类查看/搜索;设置入口在「新建任务」旁的 ☰。
- ⑪ 全局人员选择器:一个片段铺到观影/旅程/资源/日历共享/任务共享/财务共享;
修掉了老组件「名字和拼音都搜不动」的 bug —— .att-item 自己声明了 display:flex,
压过了浏览器 [hidden]{display:none},过滤根本没生效。
- ⑫ 家谱:头像改方形不再裁切;姻亲不在图上的卡片给「⇄ 姻亲」入口,
以 TA 为中心重画 + 「返回我的家谱」。
- ⑬ 纪念日:阴历/阳历都能设且按对应历法重复;名册里每个人的生日默认可见
(实时派生,不复制一份);全部作为全天日程进日历。
- ⑮ 财务:账本可共享,双方都能记账、都能看全部账目,资产−负债=净资产;
金额一律以「分」存,不用浮点。
验证:端到端 724 项通过 / 0 失败;几何 368、交互 97、移动端 516、家谱 24、
升级 123 全绿;SQL 列名静态校验 0 处可疑;部署 11 条线上探针全过。
This commit is contained in:
@@ -0,0 +1,96 @@
|
||||
<?php
|
||||
/**
|
||||
* 新建 / 编辑纪念日(v24 用户第 13 条)
|
||||
*
|
||||
* 用户原话:「可以根据阴历和阳历来设置纪念日 …… 纪念日,需要按照阴历和阳历进行重复。」
|
||||
* 所以重复方式这一栏是核心:阳历 / 农历 / 只此一次。
|
||||
* 选农历时,下面的月/日填的是**农历**的月日(不是什么公历日期换算)。
|
||||
*
|
||||
* @param array|null $editing 编辑时的既有记录
|
||||
* @param array $people 名册
|
||||
*/
|
||||
$e0 = $editing ?: [];
|
||||
$v = static fn(string $k, $def = '') => $e0[$k] ?? $def;
|
||||
$repeat = (string)($e0['repeat_type'] ?? 'solar');
|
||||
?>
|
||||
<div class="page-head">
|
||||
<h1><?= $editing ? '编辑纪念日' : '新建纪念日' ?></h1>
|
||||
<div class="actions">
|
||||
<a class="btn btn-ghost" href="<?= e(url('days')) ?>">返回</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form class="card card-pad" method="post" action="<?= e(url('days/save')) ?>">
|
||||
<?= csrf_field() ?>
|
||||
<?php if ($editing): ?><input type="hidden" name="id" value="<?= (int)$e0['id'] ?>"><?php endif; ?>
|
||||
|
||||
<div class="form-grid">
|
||||
<div class="field full">
|
||||
<label for="an-title">叫什么 *</label>
|
||||
<input class="input" id="an-title" name="title" required
|
||||
value="<?= e((string)$v('title')) ?>" placeholder="如:结婚纪念日">
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="an-repeat">按什么重复 *</label>
|
||||
<select class="select" id="an-repeat" name="repeat_type">
|
||||
<?php foreach (\App\Anniversary::REPEAT as $rk => $rv): ?>
|
||||
<option value="<?= e($rk) ?>" <?= $repeat === $rk ? 'selected' : '' ?>><?= e($rv) ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<span class="tip">选「农历」时,下面填的是**农历**的月日(不是公历)。</span>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="an-kind">分类</label>
|
||||
<input class="input" id="an-kind" name="kind" list="anKinds"
|
||||
value="<?= e((string)$v('kind')) ?>" placeholder="如:结婚纪念日">
|
||||
<datalist id="anKinds">
|
||||
<?php foreach (\App\Anniversary::PRESET_KINDS as $k): ?>
|
||||
<option value="<?= e($k) ?>"></option>
|
||||
<?php endforeach; ?>
|
||||
</datalist>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="an-month">月 *</label>
|
||||
<input class="input" id="an-month" name="month" type="number" min="1" max="12" required
|
||||
value="<?= (int)$v('month', 1) ?>">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="an-day">日 *</label>
|
||||
<input class="input" id="an-day" name="day" type="number" min="1" max="31" required
|
||||
value="<?= (int)$v('day', 1) ?>">
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="an-person">与谁相关</label>
|
||||
<select class="select" id="an-person" name="person_id">
|
||||
<option value="0">不指定</option>
|
||||
<?php foreach ($people as $p): ?>
|
||||
<option value="<?= (int)$p['id'] ?>" <?= (int)$v('person_id', 0) === (int)$p['id'] ? 'selected' : '' ?>>
|
||||
<?= e(person_name($p)) ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="an-leap">农历闰月</label>
|
||||
<label class="chk-inline">
|
||||
<input type="checkbox" id="an-leap" name="is_leap" value="1" <?= !empty($e0['is_leap']) ? 'checked' : '' ?>>
|
||||
<span>这个农历月是闰月</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="field full">
|
||||
<label for="an-note">备注</label>
|
||||
<textarea class="input" id="an-note" name="note" rows="2"><?= e((string)$v('note')) ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="btn-row">
|
||||
<button class="btn" type="submit"><?= $editing ? '保存' : '添加' ?></button>
|
||||
<a class="btn btn-ghost" href="<?= e(url('days')) ?>">取消</a>
|
||||
</div>
|
||||
</form>
|
||||
Reference in New Issue
Block a user