修复短效IP的提取数量输入框移动端的设置
This commit is contained in:
@@ -270,20 +270,50 @@ const FormFields = memo(() => {
|
||||
</FormField>
|
||||
|
||||
{/* 提取数量 */}
|
||||
<FormField name="count" className="max-w[160px*2+1rem]" label="提取数量" classNames={{label: 'max-md:text-sm'}}>
|
||||
<FormField
|
||||
name="count"
|
||||
className="max-w[160px*2+1rem]"
|
||||
label="提取数量"
|
||||
classNames={{label: 'max-md:text-sm'}}
|
||||
>
|
||||
{({id, field}) => (
|
||||
<Input
|
||||
{...field}
|
||||
id={id}
|
||||
type="number"
|
||||
min={1}
|
||||
onChange={(e) => {
|
||||
const value = Math.max(1, Number(e.target.value))
|
||||
field.onChange(value)
|
||||
}}
|
||||
className="h-10"
|
||||
placeholder="输入提取数量"
|
||||
/>
|
||||
<div className="flex gap-2 items-center">
|
||||
{/* 减号按钮:移动端显示,步长1,最小1 */}
|
||||
<Button
|
||||
theme="outline"
|
||||
type="button"
|
||||
className="h-10 w-10 border border-gray-200 rounded-sm flex items-center justify-center text-lg"
|
||||
onClick={() => field.onChange(Math.max(1, Number(field.value) - 1))}
|
||||
disabled={Number(field.value) === 1}
|
||||
>
|
||||
-
|
||||
</Button>
|
||||
|
||||
{/* 数量输入框 */}
|
||||
<Input
|
||||
{...field}
|
||||
id={id}
|
||||
type="number"
|
||||
min={1}
|
||||
step={1}
|
||||
className="w-40 h-10 border border-gray-200 rounded-sm text-center"
|
||||
placeholder="输入提取数量"
|
||||
onChange={(e) => {
|
||||
const value = Math.max(1, Number(e.target.value) || 1)
|
||||
field.onChange(value)
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* 加号按钮:移动端显示,步长1 */}
|
||||
<Button
|
||||
theme="outline"
|
||||
type="button"
|
||||
className="h-10 w-10 border border-gray-200 rounded-sm flex items-center justify-center text-lg"
|
||||
onClick={() => field.onChange(Number(field.value) + 1)}
|
||||
>
|
||||
+
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
</FormField>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user