import { CloseOutlined, ExperimentOutlined } from "@ant-design/icons"; import { useState } from "react"; import { betaApplicationClient } from "../api/betaApplicationClient"; interface BetaApplicationModalProps { open: boolean; onClose: () => void; } /* ── Form state ── */ interface BetaFormData { name: string; email: string; phone: string; wechat: string; industry: string; company: string; city: string; aiTools: string; aiDuration: string; aiTrack: string; aiDirection: string[]; weeklyUsage: string; feedbackWilling: string; wantFeature: string[]; selfStatement: string; signature: string; applicationDate: string; agreeRules: boolean; } const INITIAL_FORM: BetaFormData = { name: "", email: "", phone: "", wechat: "", industry: "", company: "", city: "", aiTools: "", aiDuration: "", aiTrack: "", aiDirection: [], weeklyUsage: "", feedbackWilling: "", wantFeature: [], selfStatement: "", signature: "", applicationDate: "", agreeRules: false, }; /* ── Option groups (from the docx) ── */ const AI_DURATION_OPTIONS = ["1年以内", "1-3年", "3-5年", "5年以上"]; const AI_TRACK_OPTIONS = ["是,长期承接相关业务", "业余创作", "新手学习"]; const AI_DIRECTION_OPTIONS = [ "AI短剧批量制作", "漫剧剧情生成", "自媒体短视频", "电商图文及视频素材", "MCN商业内容", "企业宣传视频", "个人兴趣创作", "其他", ]; const WEEKLY_USAGE_OPTIONS = ["7次及以上", "1-3次", "空闲时间使用"]; const FEEDBACK_OPTIONS = ["全力配合深度反馈", "简单体验留言", "仅使用不反馈"]; const WANT_FEATURE_OPTIONS = [ "一站式短剧漫剧完整AIGC工作流", "电商素材自动化创作流程", "多模态智能中枢全能创作", "批量自动化创作流程", "全新未公开AI创作玩法", ]; /* ── Helper: single-select radio group ── */ function RadioGroup({ name, options, value, onChange, }: { name: string; options: string[]; value: string; onChange: (v: string) => void; }) { return (
{options.map((opt) => ( ))}
); } /* ── Helper: multi-select checkbox group ── */ function CheckboxGroup({ options, value, onChange, }: { options: string[]; value: string[]; onChange: (v: string[]) => void; }) { return (
{options.map((opt) => ( ))}
); } /* ── Helper: text field ── */ function TextField({ label, value, onChange, placeholder, }: { label: string; value: string; onChange: (v: string) => void; placeholder?: string; }) { return (
{label} onChange(e.target.value)} placeholder={placeholder ?? "请填写"} />
); } const BetaApplicationModal = ({ open, onClose }: BetaApplicationModalProps) => { const [form, setForm] = useState(INITIAL_FORM); const [submitting, setSubmitting] = useState(false); const [message, setMessage] = useState<{ tone: "success" | "error"; text: string } | null>(null); const update = (key: K, value: BetaFormData[K]) => { setForm((prev) => ({ ...prev, [key]: value })); setMessage(null); }; const close = () => { if (submitting) return; onClose(); }; const validate = () => { if (!form.name.trim()) return "请填写姓名 / 常用昵称"; if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(form.email.trim())) return "请填写用于接收内测码的有效邮箱"; if (!form.phone.trim()) return "请填写联系手机号码"; if (!form.wechat.trim()) return "请填写微信账号"; if (!form.selfStatement.trim()) return "请填写申请自述"; if (!form.signature.trim()) return "请填写申请人确认签字"; if (!form.applicationDate.trim()) return "请填写申请日期"; if (!form.agreeRules) return "请先阅读并同意内测规则"; return null; }; const submit = async () => { if (submitting) return; const validationError = validate(); if (validationError) { setMessage({ tone: "error", text: validationError }); return; } setSubmitting(true); setMessage(null); try { await betaApplicationClient.submit({ ...form, name: form.name.trim(), email: form.email.trim(), phone: form.phone.trim(), wechat: form.wechat.trim(), industry: form.industry.trim(), company: form.company.trim(), city: form.city.trim(), aiTools: form.aiTools.trim(), aiDuration: form.aiDuration.trim(), aiTrack: form.aiTrack.trim(), weeklyUsage: form.weeklyUsage.trim(), feedbackWilling: form.feedbackWilling.trim(), selfStatement: form.selfStatement.trim(), signature: form.signature.trim(), applicationDate: form.applicationDate.trim(), }); setForm(INITIAL_FORM); setMessage({ tone: "success", text: "申请已提交,请留意预留邮箱中的审核结果。" }); } catch (error) { setMessage({ tone: "error", text: error instanceof Error ? error.message : "提交内测申请失败" }); } finally { setSubmitting(false); } }; if (!open) return null; return (
{/* ── Body (scrollable document) ── */}
{/* 一、个人基础信息 */}

一、个人基础信息

update("name", v)} /> update("email", v)} placeholder="审核通过后内测码将发送到此邮箱" /> update("phone", v)} /> update("wechat", v)} /> update("industry", v)} /> update("company", v)} /> update("city", v)} />
{/* 二、AI从业与使用经历 */}

二、AI 从业与使用经历

update("aiTools", v)} placeholder="例如:Midjourney / Stable Diffusion / ChatGPT 等" />
AI 内容创作从业时长 update("aiDuration", v)} />
是否深耕 AI 短剧、漫剧、数字视频、电商赛道 update("aiTrack", v)} />
日常主要创作方向(可多选) update("aiDirection", v)} />
{/* 三、内测使用意向调研 */}

三、内测使用意向调研

每周可稳定登录使用内测平台次数 update("weeklyUsage", v)} />
是否愿意积极反馈产品 BUG、优化建议、功能需求 update("feedbackWilling", v)} />
本次最想体验 OmniAI 核心功能(可多选) update("wantFeature", v)} />
{/* 四、申请自述 */}

四、申请自述 (必填)

请简述自身 AI 创作优势、业务需求,以及加入本次封闭内测的理由: