111
This commit is contained in:
@@ -49,13 +49,13 @@ class _LoginPageState extends State<LoginPage> {
|
||||
key: formKey,
|
||||
child: Column(
|
||||
children: [
|
||||
// 顶部品牌区域
|
||||
// 頂部品牌區域
|
||||
_buildBrandSection(),
|
||||
const SizedBox(height: AppSpacing.xxl),
|
||||
// 表单区域
|
||||
// 表單區域
|
||||
_buildFormSection(),
|
||||
const SizedBox(height: AppSpacing.xl),
|
||||
// 底部注册链接
|
||||
// 底部註冊鏈接
|
||||
_buildRegisterRow(),
|
||||
],
|
||||
),
|
||||
@@ -66,13 +66,13 @@ class _LoginPageState extends State<LoginPage> {
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// 品牌区域 - Logo + 品牌名 + 标语
|
||||
// 品牌區域 - Logo + 品牌名 + 標語
|
||||
// ============================================
|
||||
|
||||
Widget _buildBrandSection() {
|
||||
return Column(
|
||||
children: [
|
||||
// Logo 圆形:渐变 #1F2937 → #374151,内含 "M"
|
||||
// Logo 圓形:漸變 #1F2937 → #374151,內含 "M"
|
||||
Container(
|
||||
width: _logoCircleSize,
|
||||
height: _logoCircleSize,
|
||||
@@ -105,9 +105,9 @@ class _LoginPageState extends State<LoginPage> {
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const SizedBox(height: AppSpacing.md),
|
||||
// 标语
|
||||
// 標語
|
||||
Text(
|
||||
'虚拟货币模拟交易平台',
|
||||
'虛擬貨幣模擬交易平臺',
|
||||
style: AppTextStyles.bodyLarge(context).copyWith(
|
||||
color: context.colors.onSurfaceVariant,
|
||||
),
|
||||
@@ -118,7 +118,7 @@ class _LoginPageState extends State<LoginPage> {
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// 表单区域 - 用户名 + 密码 + 登录按钮
|
||||
// 表單區域 - 用戶名 + 密碼 + 登錄按鈕
|
||||
// ============================================
|
||||
|
||||
Widget _buildFormSection() {
|
||||
@@ -139,7 +139,7 @@ class _LoginPageState extends State<LoginPage> {
|
||||
height: _inputHeight,
|
||||
child: ShadInputFormField(
|
||||
id: 'username',
|
||||
placeholder: const Text('请输入用户名'),
|
||||
placeholder: const Text('請輸入用戶名'),
|
||||
leading: Padding(
|
||||
padding: const EdgeInsets.only(right: AppSpacing.sm),
|
||||
child: Icon(LucideIcons.user, size: 18, color: context.appColors.onSurfaceMuted),
|
||||
@@ -166,7 +166,7 @@ class _LoginPageState extends State<LoginPage> {
|
||||
height: _inputHeight,
|
||||
child: ShadInputFormField(
|
||||
id: 'password',
|
||||
placeholder: const Text('请输入密码'),
|
||||
placeholder: const Text('請輸入密碼'),
|
||||
obscureText: _obscurePassword,
|
||||
leading: Padding(
|
||||
padding: const EdgeInsets.only(right: AppSpacing.sm),
|
||||
@@ -196,7 +196,7 @@ class _LoginPageState extends State<LoginPage> {
|
||||
}
|
||||
|
||||
Widget _buildLoginButton() {
|
||||
// 设计稿: accent-primary = light:#1F2937 / dark:#D4AF37
|
||||
// 設計稿: accent-primary = light:#1F2937 / dark:#D4AF37
|
||||
final buttonColor = context.appColors.accentPrimary;
|
||||
final textColor = context.colors.onPrimary;
|
||||
|
||||
@@ -222,7 +222,7 @@ class _LoginPageState extends State<LoginPage> {
|
||||
),
|
||||
)
|
||||
: Text(
|
||||
'登录',
|
||||
'登錄',
|
||||
style: AppTextStyles.headlineLarge(context).copyWith(
|
||||
fontWeight: FontWeight.w700,
|
||||
color: textColor,
|
||||
@@ -235,7 +235,7 @@ class _LoginPageState extends State<LoginPage> {
|
||||
}
|
||||
|
||||
// ============================================
|
||||
// 底部注册链接
|
||||
// 底部註冊鏈接
|
||||
// ============================================
|
||||
|
||||
Widget _buildRegisterRow() {
|
||||
@@ -249,7 +249,7 @@ class _LoginPageState extends State<LoginPage> {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'还没有账户?',
|
||||
'還沒有賬戶?',
|
||||
style: AppTextStyles.bodyLarge(context).copyWith(
|
||||
color: secondaryTextColor,
|
||||
),
|
||||
@@ -258,7 +258,7 @@ class _LoginPageState extends State<LoginPage> {
|
||||
GestureDetector(
|
||||
onTap: _navigateToRegister,
|
||||
child: Text(
|
||||
'立即注册',
|
||||
'立即註冊',
|
||||
style: AppTextStyles.bodyLarge(context).copyWith(
|
||||
fontWeight: FontWeight.w600,
|
||||
color: goldColor,
|
||||
@@ -276,20 +276,20 @@ class _LoginPageState extends State<LoginPage> {
|
||||
|
||||
String? _validateUsername(String? value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return '请输入用户名';
|
||||
return '請輸入用戶名';
|
||||
}
|
||||
if (value.length < 3) {
|
||||
return '用户名至少 3 个字符';
|
||||
return '用戶名至少 3 個字符';
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
String? _validatePassword(String? value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return '请输入密码';
|
||||
return '請輸入密碼';
|
||||
}
|
||||
if (value.length < 6) {
|
||||
return '密码至少 6 个字符';
|
||||
return '密碼至少 6 個字符';
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -312,7 +312,7 @@ class _LoginPageState extends State<LoginPage> {
|
||||
if (response.success) {
|
||||
_navigateToMainPage();
|
||||
} else {
|
||||
_showErrorDialog(response.message ?? '用户名或密码错误');
|
||||
_showErrorDialog(response.message ?? '用戶名或密碼錯誤');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -334,11 +334,11 @@ class _LoginPageState extends State<LoginPage> {
|
||||
showShadDialog(
|
||||
context: context,
|
||||
builder: (context) => ShadDialog.alert(
|
||||
title: const Text('登录失败'),
|
||||
title: const Text('登錄失敗'),
|
||||
description: Text(message),
|
||||
actions: [
|
||||
ShadButton(
|
||||
child: const Text('确定'),
|
||||
child: const Text('確定'),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user