feat: 重新设计登录页,深色科技风格

This commit is contained in:
12451 2026-07-02 17:56:18 +08:00
parent b7546ec7d8
commit d16a0fc545

View File

@ -1,6 +1,6 @@
/**
* H5
* +
*
*
*/
import { useState } from 'react';
import { useNavigate, useSearchParams } from 'react-router-dom';
@ -31,50 +31,71 @@ export default function H5Login() {
};
return (
<div className="flex min-h-screen flex-col bg-white px-6">
{/* 顶部品牌区 */}
<div className="mt-20 mb-12 text-center">
<div className="mx-auto mb-3 flex h-16 w-16 items-center justify-center rounded-2xl bg-blue-600 text-2xl text-white font-bold">
P
<div className="flex min-h-screen flex-col bg-[#09090b] px-6">
{/* 背景网格 */}
<div
className="fixed inset-0 opacity-[0.03]"
style={{
backgroundImage: 'linear-gradient(rgba(34,211,238,0.5) 1px, transparent 1px), linear-gradient(90deg, rgba(34,211,238,0.5) 1px, transparent 1px)',
backgroundSize: '60px 60px'
}}
/>
{/* 内容 */}
<div className="relative z-10 flex flex-1 flex-col items-center justify-center">
{/* Logo */}
<div className="mb-8 text-center">
<div className="mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-2xl bg-[#22d3ee]">
<svg className="h-8 w-8 text-[#09090b]" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
<path d="M13 2L3 14h9l-1 8 10-12h-9l1-8z"/>
</svg>
</div>
<h1 className="text-2xl font-bold text-[#fafafa]"></h1>
<p className="mt-2 text-sm text-[#71717a]"></p>
</div>
{/* 登录表单 */}
<form onSubmit={handleSubmit} className="w-full max-w-sm space-y-4">
<div>
<input
className="w-full rounded-lg border border-[#3f3f46] bg-[#18181b] px-4 py-3 text-base text-[#fafafa] outline-none transition-colors focus:border-[#22d3ee]"
type="tel"
placeholder="手机号"
maxLength={11}
value={phone}
onChange={(e) => setPhone(e.target.value)}
autoComplete="tel"
/>
</div>
<div>
<input
className="w-full rounded-lg border border-[#3f3f46] bg-[#18181b] px-4 py-3 text-base text-[#fafafa] outline-none transition-colors focus:border-[#22d3ee]"
type="password"
placeholder="密码"
value={password}
onChange={(e) => setPassword(e.target.value)}
autoComplete="current-password"
/>
</div>
{error && (
<p className="text-center text-sm text-red-400">{error}</p>
)}
<button
type="submit"
disabled={loading}
className="mt-4 w-full rounded-lg bg-[#22d3ee] py-3 text-base font-medium text-[#09090b] transition-all hover:bg-[#06b6d4] active:translate-y-[1px] disabled:opacity-50"
>
{loading ? '登录中...' : '登录'}
</button>
</form>
{/* 底部信息 */}
<div className="mt-8 text-center text-xs text-[#52525b]">
<p></p>
</div>
<h1 className="text-xl font-bold text-gray-900"></h1>
<p className="mt-1 text-sm text-gray-500"></p>
</div>
{/* 登录表单 */}
<form onSubmit={handleSubmit} className="flex flex-col gap-4">
<div>
<input
className="w-full rounded-lg border border-gray-300 px-4 py-3 text-base outline-none focus:border-blue-500"
type="tel"
placeholder="手机号"
maxLength={11}
value={phone}
onChange={(e) => setPhone(e.target.value)}
autoComplete="tel"
/>
</div>
<div>
<input
className="w-full rounded-lg border border-gray-300 px-4 py-3 text-base outline-none focus:border-blue-500"
type="password"
placeholder="密码"
value={password}
onChange={(e) => setPassword(e.target.value)}
autoComplete="current-password"
/>
</div>
{error && <p className="text-center text-sm text-red-500">{error}</p>}
<button
type="submit"
disabled={loading}
className="mt-2 w-full rounded-lg bg-blue-600 py-3 text-base font-medium text-white disabled:opacity-50"
>
{loading ? '登录中...' : '登录'}
</button>
</form>
</div>
);
}