Files
wxserver/pages/add-anniversary/add-anniversary.wxml
T
yuming ddcfe3334e
部署到群晖 / deploy (push) Successful in 44s
v2.1.0 流程改造 + 农历准确性修复 + 双向同步 + 闰月支持
- Phase 1: 添加纪念日合并人物创建流程(方案 B)
- Phase 2: 农历提醒按 lunarMonth/Day 计算每年公历
- Phase 3: 人员数据同步到后端(新增 /api/person)
- Phase 4: 新设备启动从云端恢复数据
- Phase 5: 工具函数收敛 utils/format.js
- Phase 6: 同步失败入队 + 启动重试
- Phase 7: 闰月生日完整支持(含 isLeapMonth + UI 警示)
- 修复 lunarInfo 数据表错位(替换为权威源 jjonline/calendar.js)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-02 05:51:17 +08:00

114 lines
4.6 KiB
Plaintext
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.
<!--add-anniversary.wxml-->
<view class="container">
<view class="form">
<!-- 关联人员(姓名输入 + 已有人员快捷选择) -->
<view class="form-item">
<text class="label required">为谁记录</text>
<input class="input" placeholder="输入姓名,例如:妈妈" value="{{inputName}}" bindinput="onNameInput" disabled="{{!!anniversaryId}}" />
<view wx:if="{{personList.length > 0 && !anniversaryId}}" class="chips">
<view
wx:for="{{personList}}"
wx:key="id"
class="chip {{item.id === personId ? 'chip-active' : ''}}"
data-id="{{item.id}}"
data-name="{{item.name}}"
bindtap="onPickPerson"
>{{item.name}}</view>
</view>
</view>
<!-- 纪念日类型 -->
<view class="form-item">
<text class="label required">纪念日类型</text>
<picker mode="selector" range="{{typeList}}" value="{{typeIndex}}" bindchange="onTypeChange">
<view class="picker">
<text class="picker-text">{{typeList[typeIndex]}}</text>
<text class="picker-arrow"></text>
</view>
</picker>
<input wx:if="{{showCustomType}}" class="input" placeholder="请输入自定义类型" value="{{formData.customTypeName}}" bindinput="onCustomTypeInput" />
</view>
<!-- 日期类型 -->
<view class="form-item">
<text class="label required">日期类型</text>
<radio-group class="radio-group" bindchange="onDateTypeChange">
<label class="radio-item">
<radio value="solar" checked="{{formData.isLunar === false}}" />
<text>公历</text>
</label>
<label class="radio-item">
<radio value="lunar" checked="{{formData.isLunar === true}}" />
<text>农历</text>
</label>
</radio-group>
</view>
<!-- 日期选择 -->
<view class="form-item">
<text class="label required">日期</text>
<picker mode="date" value="{{dateValue}}" bindchange="onDateChange">
<view class="picker">
<text class="picker-text">{{dateValue || '请选择日期'}}</text>
<text class="picker-arrow"></text>
</view>
</picker>
<!-- 选了农历后展示对应农历日期,闰月给醒目提示 -->
<view wx:if="{{formData.isLunar && lunarText}}" class="lunar-hint {{isLeapMonth ? 'lunar-hint-warn' : ''}}">
<text>对应农历:{{lunarText}}</text>
<text wx:if="{{isLeapMonth}}" class="leap-tag">⚠ 闰月</text>
</view>
<view wx:if="{{formData.isLunar && isLeapMonth}}" class="lunar-warn-detail">
该日期属于闰月。无闰月的年份将按对应普通月份提醒(例如闰二月初一 → 二月初一)。
</view>
</view>
<!-- 重要程度 -->
<view class="form-item">
<text class="label">重要程度</text>
<radio-group class="radio-group" bindchange="onImportanceChange">
<label class="radio-item">
<radio value="high" checked="{{formData.importance === 'high'}}" />
<text class="importance-high">非常重要</text>
</label>
<label class="radio-item">
<radio value="medium" checked="{{formData.importance === 'medium'}}" />
<text class="importance-medium">重要</text>
</label>
<label class="radio-item">
<radio value="low" checked="{{formData.importance === 'low' || !formData.importance}}" />
<text class="importance-low">一般</text>
</label>
</radio-group>
</view>
<!-- 提醒设置 -->
<view class="form-item">
<view class="switch-item">
<text class="label">开启提醒</text>
<switch checked="{{formData.remindEnabled}}" bindchange="onRemindEnabledChange" color="#07c160" />
</view>
<picker wx:if="{{formData.remindEnabled}}" mode="selector" range="{{remindDaysList}}" value="{{remindDaysIndex}}" bindchange="onRemindDaysChange">
<view class="picker">
<text class="picker-text">提前{{formData.remindDays}}天提醒</text>
<text class="picker-arrow"></text>
</view>
</picker>
</view>
<!-- 备注 -->
<view class="form-item">
<text class="label">备注</text>
<textarea class="textarea" placeholder="添加备注信息(可选)" value="{{formData.remark}}" bindinput="onRemarkChange" />
</view>
<!-- 操作按钮 -->
<view class="buttons">
<button class="btn btn-cancel" bindtap="onCancel">取消</button>
<button class="btn btn-submit" bindtap="onSubmit">保存</button>
</view>
</view>
</view>