新建日程-修复选择开始时间打不开的问题
This commit is contained in:
parent
a7d2a807a5
commit
40f09f5df7
|
|
@ -87,11 +87,21 @@
|
||||||
<!-- 日期选择 -->
|
<!-- 日期选择 -->
|
||||||
<view class="date-section">
|
<view class="date-section">
|
||||||
<text class="section-label">日期</text>
|
<text class="section-label">日期</text>
|
||||||
<uv-calendar
|
<view class="date-picker-wrapper">
|
||||||
ref="startDateCalendar"
|
<view class="date-display" @click="openStartDateCalendar">
|
||||||
mode="single"
|
<text>{{ startDateText || '选择日期' }}</text>
|
||||||
@confirm="handleStartDateConfirm"
|
<text class="date-icon">📅</text>
|
||||||
/>
|
</view>
|
||||||
|
<view class="calendar-wrapper">
|
||||||
|
<uv-calendar
|
||||||
|
ref="startDateCalendar"
|
||||||
|
mode="single"
|
||||||
|
v-model="formData.startDate"
|
||||||
|
:default-date="formData.startDate || ''"
|
||||||
|
@confirm="handleStartDateConfirm"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 时间选择 -->
|
<!-- 时间选择 -->
|
||||||
<view class="time-section-picker">
|
<view class="time-section-picker">
|
||||||
|
|
@ -123,11 +133,21 @@
|
||||||
<!-- 日期选择 -->
|
<!-- 日期选择 -->
|
||||||
<view class="date-section">
|
<view class="date-section">
|
||||||
<text class="section-label">日期</text>
|
<text class="section-label">日期</text>
|
||||||
<uv-calendar
|
<view class="date-picker-wrapper">
|
||||||
ref="endDateCalendar"
|
<view class="date-display" @click="openEndDateCalendar">
|
||||||
mode="single"
|
<text>{{ endDateText || '选择日期' }}</text>
|
||||||
@confirm="handleEndDateConfirm"
|
<text class="date-icon">📅</text>
|
||||||
/>
|
</view>
|
||||||
|
<view class="calendar-wrapper">
|
||||||
|
<uv-calendar
|
||||||
|
ref="endDateCalendar"
|
||||||
|
mode="single"
|
||||||
|
v-model="formData.endDate"
|
||||||
|
:default-date="formData.endDate || formData.startDate || ''"
|
||||||
|
@confirm="handleEndDateConfirm"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 时间选择 -->
|
<!-- 时间选择 -->
|
||||||
<view class="time-section-picker">
|
<view class="time-section-picker">
|
||||||
|
|
@ -426,6 +446,20 @@ const initDates = (dateStr = '') => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 打开开始日期日历
|
||||||
|
const openStartDateCalendar = () => {
|
||||||
|
if (startDateCalendar.value) {
|
||||||
|
startDateCalendar.value.open();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 打开结束日期日历
|
||||||
|
const openEndDateCalendar = () => {
|
||||||
|
if (endDateCalendar.value) {
|
||||||
|
endDateCalendar.value.open();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// 处理开始日期确认
|
// 处理开始日期确认
|
||||||
const handleStartDateConfirm = (e) => {
|
const handleStartDateConfirm = (e) => {
|
||||||
const formattedDate = formatDateToYYYYMMDD(e);
|
const formattedDate = formatDateToYYYYMMDD(e);
|
||||||
|
|
@ -882,6 +916,39 @@ onLoad((options) => {
|
||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.date-picker-wrapper {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.date-display {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 12px;
|
||||||
|
border: 1px solid #e5e5e5;
|
||||||
|
border-radius: 8px;
|
||||||
|
background: #fff;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.date-display:active {
|
||||||
|
background: #f5f5f5;
|
||||||
|
border-color: #2885ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.date-display text {
|
||||||
|
font-size: 16px;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.date-icon {
|
||||||
|
font-size: 18px;
|
||||||
|
margin-left: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.time-section-picker {
|
.time-section-picker {
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user