diff --git a/src/components/CommonPopup/CommonPopup.tsx b/src/components/CommonPopup/CommonPopup.tsx index 654a464..e88368c 100644 --- a/src/components/CommonPopup/CommonPopup.tsx +++ b/src/components/CommonPopup/CommonPopup.tsx @@ -133,7 +133,7 @@ const CommonPopup: React.FC = ({ {!hideFooter && ( - + diff --git a/src/components/Picker/DayDialog/index.tsx b/src/components/Picker/DayDialog/index.tsx index a986fd5..c36237c 100644 --- a/src/components/Picker/DayDialog/index.tsx +++ b/src/components/Picker/DayDialog/index.tsx @@ -24,9 +24,6 @@ const DayDialog: React.FC = ({ onChange, }) => { const [selected, setSelected] = useState(value || new Date()); - const [selectedBackup, setSelectedBackup] = useState( - Array.isArray(value) ? [...(value as Date[])] : [value as Date] - ); const calendarRef = useRef(null); const [type, setType] = useState<"year" | "month" | "time">("year"); const [pendingJump, setPendingJump] = useState<{ @@ -47,26 +44,6 @@ const DayDialog: React.FC = ({ } const handleChange = (d: Date | Date[]) => { - if (searchType === "range") { - if (Array.isArray(d)) { - if (d.length === 2) { - return; - } else if (d.length === 1) { - if (selectedBackup.length === 0 || selectedBackup.length === 2) { - setSelected([...d]); - setSelectedBackup([...d]); - } else { - setSelected( - [...selectedBackup, d[0]].sort( - (a, b) => a.getTime() - b.getTime() - ) - ); - setSelectedBackup([]); - } - } - return; - } - } if (Array.isArray(d)) { setSelected(d[0]); } else { diff --git a/src/components/Picker/HourDialog/index.tsx b/src/components/Picker/HourDialog/index.tsx index 615b2c2..43bcbb9 100644 --- a/src/components/Picker/HourDialog/index.tsx +++ b/src/components/Picker/HourDialog/index.tsx @@ -25,7 +25,10 @@ const HourDialog: React.FC = ({ const handleConfirm = () => { const value = hourMinutePickerRef.current?.getValue(); if (onChange) { - onChange(value); + const [hour, minute] = value || []; + const hours = hour.toString().padStart(2, "0"); + const minutes = minute.toString().padStart(2, "0"); + onChange([hours, minutes]); } dialogClose(); }; diff --git a/src/components/Picker/Picker.tsx b/src/components/Picker/Picker.tsx index e221a3f..4cfcfa7 100644 --- a/src/components/Picker/Picker.tsx +++ b/src/components/Picker/Picker.tsx @@ -51,8 +51,6 @@ const CustomPicker = ({ Array.isArray(currentValue) && valuesList.length === currentValue.length && valuesList.every((v: any, idx: number) => v === currentValue[idx]) - - console.log(isSame,valuesList, 'isSameisSameisSameisSame'); if (!isSame) { setCurrentValue(valuesList) } diff --git a/src/components/TimeSelector/TimeSelector.tsx b/src/components/TimeSelector/TimeSelector.tsx index 3a5d03f..ea39047 100644 --- a/src/components/TimeSelector/TimeSelector.tsx +++ b/src/components/TimeSelector/TimeSelector.tsx @@ -10,7 +10,10 @@ import dayjs from 'dayjs' const parseDate = (dateStr: string): Date => { if (!dateStr) return new Date(); // 将 "yyyy-MM-dd HH:mm:ss" 转换为 "yyyy-MM-ddTHH:mm:ss" + console.log(dateStr, 'dateStrdateStrdateStr'); const isoStr = dateStr.replace(/^(\d{4}-\d{2}-\d{2})\s(\d{2}:\d{2}(?::\d{2})?)$/, '$1T$2'); + console.log(isoStr, 'isoStr'); + console.log(new Date(isoStr), 'new Date'); return new Date(isoStr); }; @@ -43,11 +46,11 @@ const TimeSelector: React.FC = ({ console.log('选择的日期:', date) const start_time = currentTimeType === 'start' ? getDateStr(date) : value.start_time; const end_time = currentTimeType === 'end' ? getDateStr(date) : value.end_time; - const isLater = dayjs(start_time).isAfter(dayjs(end_time)); - if (isLater) { - if (onChange) onChange({start_time, end_time: getEndTime(start_time)}) - return - } + // const isLater = dayjs(start_time).isAfter(dayjs(end_time)); + // if (isLater) { + // if (onChange) onChange({start_time, end_time: getEndTime(start_time)}) + // return + // } if (onChange) onChange({start_time, end_time}) } const onChangeDay = (years:any) => { @@ -62,7 +65,7 @@ const TimeSelector: React.FC = ({ } } const onChangeHour = (dates) => { - const [hour, minute] = dates; + const [hour, minute = '00'] = dates; if (onChange){ if (currentTimeType === 'start') { const year = dayjs(value.start_time).format('YYYY-MM-DD') diff --git a/src/publish_pages/publishBall/components/SelectStadium/SelectStadium.scss b/src/publish_pages/publishBall/components/SelectStadium/SelectStadium.scss index f0d3ee9..65253d3 100644 --- a/src/publish_pages/publishBall/components/SelectStadium/SelectStadium.scss +++ b/src/publish_pages/publishBall/components/SelectStadium/SelectStadium.scss @@ -9,7 +9,7 @@ flex-direction: column; overflow: hidden; padding-bottom: env(safe-area-inset-bottom); - + // 搜索区域 .search-section { background: #f5f5f5; diff --git a/src/publish_pages/publishBall/components/SelectStadium/StadiumDetail.scss b/src/publish_pages/publishBall/components/SelectStadium/StadiumDetail.scss index f8a0803..22eaede 100644 --- a/src/publish_pages/publishBall/components/SelectStadium/StadiumDetail.scss +++ b/src/publish_pages/publishBall/components/SelectStadium/StadiumDetail.scss @@ -3,9 +3,8 @@ background: white; display: flex; flex-direction: column; - padding-bottom: env(safe-area-inset-bottom); .stadium-detail-scroll{ - height:72vh; + height:60vh; } // 已选球场 // 场馆列表 @@ -57,7 +56,9 @@ // 场地类型 .venue-type-section { flex-shrink: 0; - + &.image-wrap{ + padding-bottom: 30px; + } .section-title { padding: 18px 20px 10px 20px; font-size: 14px; diff --git a/src/publish_pages/publishBall/components/SelectStadium/StadiumDetail.tsx b/src/publish_pages/publishBall/components/SelectStadium/StadiumDetail.tsx index 2143337..88935fb 100644 --- a/src/publish_pages/publishBall/components/SelectStadium/StadiumDetail.tsx +++ b/src/publish_pages/publishBall/components/SelectStadium/StadiumDetail.tsx @@ -56,8 +56,8 @@ const SectionTitle: React.FC<{ title: string,prop: string }> = ({ title, prop }) } // 公共的容器组件 -const SectionContainer: React.FC<{ title: string; children: React.ReactNode, prop: string }> = ({ title, children, prop }) => ( - +const SectionContainer: React.FC<{ title: string; children: React.ReactNode, prop: string, type?: string }> = ({ title, children, prop, type }) => ( + {children} @@ -218,8 +218,8 @@ const StadiumDetail = forwardRef(({ updateFormData(item.prop, value)} - // onBlur={() => onAnyInput(false)} - // onFocus={() => onAnyInput(true)} + onBlur={() => changePicker(false)} + onFocus={() => changePicker(true)} placeholder='有其他场地信息可备注' options={(item.options || []).map((o) => ({ label: o, value: o }))} /> @@ -230,7 +230,7 @@ const StadiumDetail = forwardRef(({ if (item.type === 'image') { return ( - +