修复选择重复日程的频率
This commit is contained in:
parent
5c5f0f836c
commit
e5f7129d61
|
|
@ -49,7 +49,7 @@
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 重复选项 -->
|
<!-- 重复选项 -->
|
||||||
<view class="form-item clickable-item" @click="showRepeatPicker = true">
|
<view class="form-item clickable-item" @click="openRepeatPicker">
|
||||||
<text class="label">{{ repeatText }}</text>
|
<text class="label">{{ repeatText }}</text>
|
||||||
<text class="arrow">›</text>
|
<text class="arrow">›</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -190,7 +190,7 @@
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 重复选择弹窗 -->
|
<!-- 重复选择弹窗 -->
|
||||||
<view v-if="showRepeatPicker" class="modal-mask" @click="showRepeatPicker = false">
|
<view v-if="showRepeatPicker" class="modal-mask" @click="handleCancelRepeat">
|
||||||
<view class="modal-content" @click.stop>
|
<view class="modal-content" @click.stop>
|
||||||
<view class="modal-title">重复设置</view>
|
<view class="modal-title">重复设置</view>
|
||||||
<view class="repeat-options">
|
<view class="repeat-options">
|
||||||
|
|
@ -198,16 +198,16 @@
|
||||||
v-for="item in repeatOptions"
|
v-for="item in repeatOptions"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
class="repeat-option"
|
class="repeat-option"
|
||||||
:class="{ active: formData.repeat === item.value }"
|
:class="{ active: tempRepeat === item.value }"
|
||||||
@click="selectRepeat(item.value)"
|
@click="tempRepeat = item.value"
|
||||||
>
|
>
|
||||||
<text>{{ item.label }}</text>
|
<text>{{ item.label }}</text>
|
||||||
<text v-if="formData.repeat === item.value" class="check">✓</text>
|
<text v-if="tempRepeat === item.value" class="check">✓</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="modal-buttons">
|
<view class="modal-buttons">
|
||||||
<button class="modal-btn" @click="showRepeatPicker = false">取消</button>
|
<button class="modal-btn" @click="handleCancelRepeat">取消</button>
|
||||||
<button class="modal-btn primary" @click="showRepeatPicker = false">确定</button>
|
<button class="modal-btn primary" @click="handleConfirmRepeat">确定</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -267,6 +267,9 @@ const showColorPicker = ref(false);
|
||||||
const showRepeatPicker = ref(false);
|
const showRepeatPicker = ref(false);
|
||||||
const showReminderPicker = ref(false);
|
const showReminderPicker = ref(false);
|
||||||
|
|
||||||
|
// 临时数据(用于弹窗暂存)
|
||||||
|
const tempRepeat = ref('none');
|
||||||
|
|
||||||
// 时间选择器相关
|
// 时间选择器相关
|
||||||
const hourOptions = Array.from({ length: 24 }, (_, i) => String(i).padStart(2, '0') + '时');
|
const hourOptions = Array.from({ length: 24 }, (_, i) => String(i).padStart(2, '0') + '时');
|
||||||
const minOptions = Array.from({ length: 60 }, (_, i) => String(i).padStart(2, '0') + '分');
|
const minOptions = Array.from({ length: 60 }, (_, i) => String(i).padStart(2, '0') + '分');
|
||||||
|
|
@ -515,9 +518,25 @@ const selectColor = (color) => {
|
||||||
formData.value.color = color;
|
formData.value.color = color;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 选择重复
|
// 打开重复选择弹窗
|
||||||
const selectRepeat = (value) => {
|
const openRepeatPicker = () => {
|
||||||
formData.value.repeat = value;
|
// 打开弹窗时,将当前值复制到临时变量
|
||||||
|
tempRepeat.value = formData.value.repeat;
|
||||||
|
showRepeatPicker.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 取消重复选择
|
||||||
|
const handleCancelRepeat = () => {
|
||||||
|
// 恢复原始值
|
||||||
|
tempRepeat.value = formData.value.repeat;
|
||||||
|
showRepeatPicker.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 确认重复选择
|
||||||
|
const handleConfirmRepeat = () => {
|
||||||
|
// 将临时变量的值更新到表单数据
|
||||||
|
formData.value.repeat = tempRepeat.value;
|
||||||
|
showRepeatPicker.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 选择提醒
|
// 选择提醒
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user