增加获取场馆、字典
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user