feat: 重新设计登录页,深色科技风格
This commit is contained in:
parent
b7546ec7d8
commit
d16a0fc545
@ -1,6 +1,6 @@
|
||||
/**
|
||||
* H5 登录页
|
||||
* 手机号 + 密码登录,支持重定向到目标页面
|
||||
* 登录页
|
||||
* 深色科技风格,与产品介绍页统一
|
||||
*/
|
||||
import { useState } from 'react';
|
||||
import { useNavigate, useSearchParams } from 'react-router-dom';
|
||||
@ -31,21 +31,34 @@ 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-xl font-bold text-gray-900">安知充</h1>
|
||||
<p className="mt-1 text-sm text-gray-500">充电柜管理系统</p>
|
||||
<h1 className="text-2xl font-bold text-[#fafafa]">安知充</h1>
|
||||
<p className="mt-2 text-sm text-[#71717a]">充电柜管理系统</p>
|
||||
</div>
|
||||
|
||||
{/* 登录表单 */}
|
||||
<form onSubmit={handleSubmit} className="flex flex-col gap-4">
|
||||
<form onSubmit={handleSubmit} className="w-full max-w-sm space-y-4">
|
||||
<div>
|
||||
<input
|
||||
className="w-full rounded-lg border border-gray-300 px-4 py-3 text-base outline-none focus:border-blue-500"
|
||||
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}
|
||||
@ -56,7 +69,7 @@ export default function H5Login() {
|
||||
</div>
|
||||
<div>
|
||||
<input
|
||||
className="w-full rounded-lg border border-gray-300 px-4 py-3 text-base outline-none focus:border-blue-500"
|
||||
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}
|
||||
@ -65,16 +78,24 @@ export default function H5Login() {
|
||||
/>
|
||||
</div>
|
||||
|
||||
{error && <p className="text-center text-sm text-red-500">{error}</p>}
|
||||
{error && (
|
||||
<p className="text-center text-sm text-red-400">{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"
|
||||
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>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user