增加获取场馆、字典

This commit is contained in:
筱野
2025-08-24 16:04:31 +08:00
parent c6f4f11259
commit bb6ec8c183
29 changed files with 1217 additions and 414 deletions

View File

@@ -4,18 +4,18 @@ import './NumberInterval.scss'
import { InputNumber } from '@nutui/nutui-react-taro'
interface NumberIntervalProps {
minParticipants: number
maxParticipants: number
onMinParticipantsChange: (value: number) => void
onMaxParticipantsChange: (value: number) => void
value: [number, number]
onChange: (value: [number, number]) => void
}
const NumberInterval: React.FC<NumberIntervalProps> = ({
minParticipants,
maxParticipants,
onMinParticipantsChange,
onMaxParticipantsChange
value,
onChange
}) => {
const [minParticipants, maxParticipants] = value || [1, 4]
const handleChange = (value: [number | string, number | string]) => {
onChange([Number(value[0]), Number(value[1])])
}
return (
<View className='participants-control-section'>
<View className='participant-control'>
@@ -23,9 +23,10 @@ const NumberInterval: React.FC<NumberIntervalProps> = ({
<View className='control-buttons'>
<InputNumber
className="format-width"
defaultValue={4}
min={0}
max={4}
defaultValue={minParticipants}
min={minParticipants}
max={maxParticipants}
onChange={(value) => handleChange([value, maxParticipants])}
formatter={(value) => `${value}`}
/>
</View>
@@ -35,9 +36,10 @@ const NumberInterval: React.FC<NumberIntervalProps> = ({
<View className='control-buttons'>
<InputNumber
className="format-width"
defaultValue={4}
min={0}
max={4}
defaultValue={maxParticipants}
onChange={(value) => handleChange([value, maxParticipants])}
min={minParticipants}
max={maxParticipants}
formatter={(value) => `${value}`}
/>
</View>