Files
wxserver/pages/add-anniversary/add-anniversary.wxml
T
2025-10-26 19:29:30 +08:00

102 lines
3.9 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>
<picker mode="selector" range="{{personList}}" range-key="name" value="{{personIndex}}" bindchange="onPersonChange">
<view class="picker">
<text wx:if="{{selectedPerson}}" class="picker-text">{{selectedPerson}}</text>
<text wx:else class="picker-placeholder">请选择关联人员</text>
<text class="picker-arrow"></text>
</view>
</picker>
</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>
<!-- 重要程度 -->
<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>