Merge branch 'light_v4'

This commit is contained in:
张成
2025-11-09 22:03:14 +08:00
12 changed files with 253 additions and 134 deletions

View File

@@ -3,7 +3,8 @@
top: 0;
left: 0;
overflow: hidden;
z-index: 9991;
z-index: 99;
width: 100%;
// 背景颜色通过 style 动态设置,默认透明
box-shadow: none;
}

View File

@@ -1,13 +1,15 @@
.distanceQuickFilterWrap {
width: 100%;
font-family: "PingFang SC";
position: relative;
.nut-menu-bar {
--nutui-menu-bar-line-height: 30px;
background-color: unset;
background-color: #fafafa;
box-shadow: unset;
padding: 0 15px;
// padding: 0 15px;
gap: 5px;
justify-content: flex-start;
}
.nut-menu-title {
@@ -20,7 +22,7 @@
align-items: center;
gap: 2px;
border-radius: 999px;
border: 0.5px solid rgba(0, 0, 0, 0.06);
// border: 0.5px solid rgba(0, 0, 0, 0.06);
background: #ffffff;
font-size: 14px;
font-weight: 600;
@@ -32,9 +34,15 @@
}
.nut-menu-container-wrap {
width: 100vw;
position: fixed !important;
left: 0 !important;
right: 0 !important;
width: auto !important;
border-bottom-left-radius: 30px;
border-bottom-right-radius: 30px;
background-color: #fafafa !important;
z-index: 1000 !important;
box-sizing: border-box !important;
}
.positionWrap {

View File

@@ -5,6 +5,14 @@ import { DialogCalendarCard } from '@/components/index'
import './TimeSelector.scss'
import dayjs from 'dayjs'
// 安全地解析日期字符串,兼容 iOS
const parseDate = (dateStr: string): Date => {
if (!dateStr) return new Date();
// 将 "yyyy-MM-dd HH:mm:ss" 转换为 "yyyy-MM-ddTHH:mm:ss"
const isoStr = dateStr.replace(/^(\d{4}-\d{2}-\d{2})\s(\d{2}:\d{2}(?::\d{2})?)$/, '$1T$2');
return new Date(isoStr);
};
export interface TimeRange {
start_time: string
end_time: string
@@ -39,7 +47,7 @@ const TimeSelector: React.FC<TimeSelectorProps> = ({
if (onChange) onChange({start_time, end_time})
}
const openPicker = (type: 'start' | 'end') => {
setCurrentTimeValue(type === 'start' ? new Date(value.start_time) : new Date(value.end_time))
setCurrentTimeValue(type === 'start' ? parseDate(value.start_time) : parseDate(value.end_time))
setCurrentTimeType(type)
setVisible(true)
}