import { useState } from "react"; import { useNavigate, Link } from "react-router"; import { Hexagon, User, Lock, Smartphone, ShieldCheck, Eye, EyeOff } from "lucide-react"; import { toast } from "sonner"; import { Button } from "../components/ui/button"; import { cn } from "../components/ui/utils"; import { XiaobinAssistant } from "../components/XiaobinAssistant"; type Mode = "employee" | "vendor"; type Tab = "account" | "mobile"; type LoginRole = "purchaser" | "supplier" | "expert" | "other"; const ROLE_BUTTONS: { id: LoginRole; label: string; en: string }[] = [ { id: "purchaser", label: "采购人", en: "Purchaser" }, { id: "supplier", label: "供应商", en: "Supplier" }, { id: "expert", label: "专家", en: "Expert" }, { id: "other", label: "其他", en: "Other" }, ]; export function LoginPage() { const navigate = useNavigate(); const [mode, setMode] = useState("vendor"); const [tab, setTab] = useState("account"); const [loginRole, setLoginRole] = useState("supplier"); const [account, setAccount] = useState("zhangwei"); const [pwd, setPwd] = useState("123456"); const [showPwd, setShowPwd] = useState(false); const [phone, setPhone] = useState(""); const [code, setCode] = useState(""); const [remember, setRemember] = useState(true); const [countdown, setCountdown] = useState(0); function sendCode() { if (!/^1[3-9]\d{9}$/.test(phone)) { toast.error("请输入正确的手机号"); return; } toast.success("验证码已发送,请注意查收"); setCountdown(60); const timer = setInterval(() => { setCountdown((c) => { if (c <= 1) { clearInterval(timer); return 0; } return c - 1; }); }, 1000); } function submit(e: React.FormEvent) { e.preventDefault(); if (mode === "employee") { toast.info("正在跳转至集团 IAM 统一身份认证…"); setTimeout(() => navigate("/app"), 800); return; } navigate("/app"); } function selectRole(role: LoginRole) { setLoginRole(role); // 与现有登录逻辑联动:供应商走外部账号,其他角色默认走内部员工 if (role === "supplier") { setMode("vendor"); setTab("account"); } else { setMode("employee"); setTab("account"); } } return (
滨化电子招标投标交易网
欢迎登录 STP 系统

用户登录

还没有账号? 去注册

{/* 角色登录按钮:对齐万华站点风格 */}
{ROLE_BUTTONS.map((r) => ( ))}
{( [ { id: "employee" as Mode, label: "内部员工" }, { id: "vendor" as Mode, label: "外部账号" }, ] ).map((m) => ( ))}

当前角色:{ROLE_BUTTONS.find((x) => x.id === loginRole)?.label}

{( [ { id: "account" as Tab, label: "账号登录" }, { id: "mobile" as Tab, label: "手机验证码" }, ] ).map((t) => ( ))}
{tab === "account" ? ( <>
setAccount(e.target.value)} className="h-11 w-full rounded-lg border bg-input-background pl-10 pr-3 text-sm outline-none transition-colors focus:border-primary" placeholder="请输入您的账号" />
setPwd(e.target.value)} className="h-11 w-full rounded-lg border bg-input-background pl-10 pr-10 text-sm outline-none transition-colors focus:border-primary" placeholder="请输入您的密码" />
) : ( <>
setPhone(e.target.value)} className="h-11 w-full rounded-lg border bg-input-background pl-10 pr-3 text-sm outline-none transition-colors focus:border-primary" placeholder="请输入11位手机号" />
setCode(e.target.value)} className="h-11 w-full rounded-lg border bg-input-background pl-10 pr-3 text-sm outline-none transition-colors focus:border-primary" placeholder="6 位验证码" />
)}
还没有账号? {mode === "employee" ? ( 员工账号由 HR 系统统一同步 ) : ( 立即注册 )}
原 SRM 注册用户,可直接使用 SRM 账号登录,无需重复注册。
返回门户首页
交易信息
    {[ ["[公开招标] 扣电测试柜框架", "2026-07-13"], ["[公开招标] 2026年橡胶密封件框架招标O型圈", "2026-07-13"], ["[公开招标] 万华莱州100MW分散式风电项目EPC工程总承包[变更公告]", "2026-07-13"], ["[公开招标] 万华旋塞阀框架包一 金属旋塞阀、包二 衬氟旋塞阀", "2026-07-10"], ["[公开招标] 改性TPU熟化料仓", "2026-07-09"], ].map(([title, date]) => (
  • {title} {date}
  • ))}
通知公告

万华蓬莱园区高温管道耐火衬里类物资供应商招募

万华化学桨叶冷却机类供应商招募

万华化学洗车平台服务类供应商招募

操作指南

供应商注册操作指南

投标文件制作软件操作手册

系统使用常见问题处理

); }