Files
tangzhuan-yu/frontend/components/CaptchaInput.tsx
T
jinghui b3377dccd6 feat: 躺赚鱼 v3.6.2 —— xianyu-auto-reply 深度定制版首发
新增: 实时热卖榜(11分类/想要人数排序/热门搜索词热度)、价格监控(目标价通知/卖家信用筛选/销量下限/AI精准监控)、
一键转卖(收藏自动加载/改价直发/详情直达)、AI回复免费token(ai.88531.cn)、API密钥掩码、
推理模型兼容修复、商品本地编辑、授权系统接入(在线人数/版本/公告)、品牌更名躺赚鱼。

README 重写为项目介绍(改动清单/优势/真实截图/两种安装方式/体验地址 tzy.88531.cn/使用引导),
原版 README 完整保留为 README.upstream.md。
2026-11-16 01:00:59 +08:00

63 lines
1.7 KiB
TypeScript

import React from 'react';
import { RefreshCw } from 'lucide-react';
interface CaptchaInputProps {
/** data:image/png;base64 图片,点击图片或按钮刷新 */
image: string;
code: string;
onCodeChange: (value: string) => void;
onRefresh: () => void;
label?: string;
}
/** 图形验证码输入行:输入框 + 验证码图片(点击可换一张)。 */
const CaptchaInput: React.FC<CaptchaInputProps> = ({
image,
code,
onCodeChange,
onRefresh,
label = '图形验证码',
}) => (
<label className="block">
<span className="mb-1.5 block text-xs font-bold text-gray-600">{label}</span>
<div className="flex gap-2">
<input
type="text"
placeholder="请输入图中字符"
value={code}
onChange={e => onCodeChange(e.target.value)}
maxLength={4}
autoComplete="off"
className="ios-input h-11 w-full rounded-md px-4 text-sm uppercase"
/>
{image ? (
<img
src={image}
alt="图形验证码,点击换一张"
title="看不清?点击换一张"
onClick={onRefresh}
className="h-11 w-28 shrink-0 cursor-pointer rounded-md border border-gray-200 bg-white"
/>
) : (
<button
type="button"
onClick={onRefresh}
className="h-11 w-28 shrink-0 rounded-md border border-gray-200 bg-gray-50 text-xs text-gray-500"
>
点击获取
</button>
)}
<button
type="button"
onClick={onRefresh}
aria-label="刷新图形验证码"
className="ios-btn-secondary h-11 shrink-0 rounded-md px-2"
>
<RefreshCw className="h-4 w-4" />
</button>
</div>
</label>
);
export default CaptchaInput;