支付准备推一下

This commit is contained in:
海龙 2025-08-28 19:15:44 +08:00
parent 506438dc7f
commit 89b8413fd1
4 changed files with 63 additions and 57 deletions

View File

@ -107,7 +107,6 @@ export default function CallbackModal({ onClose }: { onClose: () => void }) {
<div className="mb-6"> <div className="mb-6">
<CheckCircleOutlined className="text-white text-6xl mb-4" /> <CheckCircleOutlined className="text-white text-6xl mb-4" />
<h1 className="text-white text-2xl font-bold mb-2">Payment Successful!</h1> <h1 className="text-white text-2xl font-bold mb-2">Payment Successful!</h1>
<p className="text-white/70 text-base">{`Order ID: ${paymentInfo?.orderId || 'N/A'}`}</p>
</div> </div>
<div className="text-center text-white/70 mb-8 space-y-2"> <div className="text-center text-white/70 mb-8 space-y-2">
@ -139,7 +138,6 @@ export default function CallbackModal({ onClose }: { onClose: () => void }) {
</div> </div>
<div className="text-center text-white/70 mb-8 space-y-2"> <div className="text-center text-white/70 mb-8 space-y-2">
<p>Order ID: {paymentInfo?.orderId || 'N/A'}</p>
<p>If the problem persists, please contact customer service</p> <p>If the problem persists, please contact customer service</p>
</div> </div>
</div> </div>

View File

@ -2,7 +2,6 @@
import { useState, useCallback, useEffect } from 'react'; import { useState, useCallback, useEffect } from 'react';
import './style/login.css'; import './style/login.css';
import VantaHaloBackground from '@/components/vanta-halo-background';
import { useRouter, useSearchParams } from 'next/navigation'; import { useRouter, useSearchParams } from 'next/navigation';
import React from 'react'; import React from 'react';
import Link from 'next/link'; import Link from 'next/link';
@ -11,7 +10,6 @@ import { GradientText } from '@/components/ui/gradient-text';
import { Eye, EyeOff } from 'lucide-react'; import { Eye, EyeOff } from 'lucide-react';
export default function Login() { export default function Login() {
const [isLoaded, setIsLoaded] = useState(false);
const [email, setEmail] = useState(''); const [email, setEmail] = useState('');
const [password, setPassword] = useState(''); const [password, setPassword] = useState('');
const [showPassword, setShowPassword] = useState(false); const [showPassword, setShowPassword] = useState(false);
@ -25,23 +23,19 @@ export default function Login() {
useEffect(() => { useEffect(() => {
const registered = searchParams?.get('registered'); const registered = searchParams?.get('registered');
if (registered === 'true') { if (registered === 'true') {
setSuccessMessage('注册成功!请使用您的新帐号登录。'); setSuccessMessage('Registration successful! Please login with your new account.');
} }
const error = searchParams?.get('error'); const error = searchParams?.get('error');
if (error) { if (error) {
if (error === 'google_oauth') { if (error === 'google_oauth') {
setFormError('Google登录失败,请重试。'); setFormError('Google login failed, please try again.');
} else if (error === 'auth_failed') { } else if (error === 'auth_failed') {
setFormError('身份验证失败,请重试。'); setFormError('Authentication failed, please try again.');
} }
} }
}, [searchParams]); }, [searchParams]);
const handleBackgroundLoaded = useCallback(() => {
setIsLoaded(true);
}, []);
const handleGoogleSignIn = () => { const handleGoogleSignIn = () => {
signInWithGoogle(); signInWithGoogle();
}; };
@ -65,7 +59,7 @@ export default function Login() {
} else if (error.msg) { } else if (error.msg) {
setFormError(error.msg); setFormError(error.msg);
} else { } else {
setFormError('登录失败,请检查您的凭据后重试。'); setFormError('Login failed, please check your credentials and try again.');
} }
} finally { } finally {
setIsSubmitting(false); setIsSubmitting(false);
@ -73,9 +67,25 @@ export default function Login() {
}; };
return ( return (
<div className="main-container login-page relative"> <div className="min-h-screen relative overflow-hidden">
{/* logo Movie Flow */} {/* 背景视频 */}
<div className='login-logo'> <video
autoPlay
loop
muted
playsInline
className="absolute inset-0 w-full h-full object-cover"
data-alt="background-video"
>
<source src="/assets/login.mp4" type="video/mp4" />
{/* 如果没有视频文件,显示渐变背景 */}
</video>
{/* 视频遮罩层 */}
<div className="absolute inset-0 bg-black/20 " data-alt="video-overlay"></div>
{/* Logo */}
<div className="absolute top-8 left-8 z-10" data-alt="logo-container">
<span className="logo-heart"> <span className="logo-heart">
<GradientText <GradientText
text="MovieFlow" text="MovieFlow"
@ -89,27 +99,25 @@ export default function Login() {
</span> </span>
</div> </div>
<div className="left-panel"> {/* 登录框 - 居中显示 */}
<VantaHaloBackground onLoaded={handleBackgroundLoaded} /> <div className="relative bottom-4 z-10 flex items-center justify-center min-h-screen p-4">
</div> <div className="auth-container max-w-md w-full bg-black/40 backdrop-blur-lg border border-white/20 rounded-2xl p-8 shadow-2xl">
<div className={`right-panel ${isLoaded ? 'fade-in' : 'invisible'}`}> <div className="auth-header text-center mb-6">
<div className="auth-container"> <h2 className="text-2xl font-bold text-white mb-4">Login</h2>
<div className="auth-header"> <p className="text-gray-300">Enter your credentials to access your account</p>
<h2></h2>
<p>访</p>
</div> </div>
<form onSubmit={handleSubmit} className=""> <form onSubmit={handleSubmit}>
{successMessage && ( {successMessage && (
<div className="bg-green-500/20 text-green-300 p-3 mb-4 rounded-lg border border-green-500/20"> <div className="bg-green-500/20 text-green-300 p-3 mb-4 rounded-lg border border-green-500/20">
{successMessage} {successMessage}
</div> </div>
)} )}
<div className="mb-3"> <div className="mb-4">
<label className="form-label"></label> <label className="form-label">Username</label>
<input <input
placeholder="请输入用户名" placeholder="Enter your username"
required required
className="form-control" className="form-control"
type="text" type="text"
@ -117,11 +125,11 @@ export default function Login() {
onChange={(e) => setEmail(e.target.value)} onChange={(e) => setEmail(e.target.value)}
/> />
</div> </div>
<div className="mb-3"> <div className="mb-4">
<label className="form-label"></label> <label className="form-label">Password</label>
<div className="relative"> <div className="relative">
<input <input
placeholder="请输入密码" placeholder="Enter your password"
required required
className="form-control pr-10" className="form-control pr-10"
type={showPassword ? "text" : "password"} type={showPassword ? "text" : "password"}
@ -137,8 +145,8 @@ export default function Login() {
{!showPassword ? <EyeOff size={20} /> : <Eye size={20} />} {!showPassword ? <EyeOff size={20} /> : <Eye size={20} />}
</button> </button>
</div> </div>
<div className="d-flex justify-content-end mt-1"> <div className="flex justify-end mt-2">
<a className="auth-link small" href="/forgot-password" data-discover="true"></a> <a className="auth-link small" href="/forgot-password" data-discover="true">Forgot password?</a>
</div> </div>
</div> </div>
@ -153,12 +161,12 @@ export default function Login() {
className="w-full mt-4 btn btn-primary" className="w-full mt-4 btn btn-primary"
disabled={isSubmitting} disabled={isSubmitting}
> >
{isSubmitting ? '登录中...' : '登录'} {isSubmitting ? 'Logging in...' : 'Login'}
</button> </button>
<div className="my-4 relative flex items-center"> <div className="my-4 relative flex items-center">
<div className="flex-grow border-t border-gray-500/30"></div> <div className="flex-grow border-t border-gray-500/30"></div>
<span className="flex-shrink mx-4 text-gray-400"></span> <span className="flex-shrink mx-4 text-gray-400">or</span>
<div className="flex-grow border-t border-gray-500/30"></div> <div className="flex-grow border-t border-gray-500/30"></div>
</div> </div>
@ -171,9 +179,9 @@ export default function Login() {
<span>Continue with Google</span> <span>Continue with Google</span>
</button> </button>
<div className="text-center mt-3"> <div className="text-center mt-4">
<p style={{ color: "rgba(255, 255, 255, 0.6)" }}> <p style={{ color: "rgba(255, 255, 255, 0.6)" }}>
<Link href="/signup" className="auth-link"></Link> Don't have an account? <Link href="/signup" className="auth-link">Sign up</Link>
</p> </p>
</div> </div>
</form> </form>

Binary file not shown.

BIN
public/assets/login.mp4 Normal file

Binary file not shown.