Commit 45559a4621758588c8658cbad29d7685637d7405

Authored by 权海
1 parent 6ae01251

feat(ui):修改login view间距

@@ -65,41 +65,33 @@ class LoginView extends GetView<LoginController> { @@ -65,41 +65,33 @@ class LoginView extends GetView<LoginController> {
65 )), 65 )),
66 ], 66 ],
67 ), 67 ),
68 - // Welcome texts  
69 - if (!isOhos() &&  
70 - !controller.environmentConfig.hideChooseRegion)  
71 - Positioned(  
72 - right: 20,  
73 - top: MediaQuery.paddingOf(context).top,  
74 - child: GestureDetector(  
75 - onTap: () => Get.bottomSheet(  
76 - const _ServiceRegionBottomSheet(),  
77 - backgroundColor: Colors.transparent,  
78 - barrierColor: Colors.black.withValues(alpha: 0.5),  
79 - enableDrag: true,  
80 - isScrollControlled: true,  
81 - ),  
82 - child: Text(  
83 - '🌏',  
84 - textAlign: TextAlign.right,  
85 - style: TextStyle(  
86 - color: Colors.black,  
87 - fontSize: 23,  
88 - fontWeight: FontWeight.w400,  
89 - ),  
90 - ),  
91 - )),  
92 - Positioned(  
93 - bottom: bottom(isOhos()  
94 - ? 233  
95 - : (region == AppRegion.china ? 277 : 273)),  
96 - left: 0,  
97 - right: 0,  
98 - child: Column(  
99 - mainAxisSize: MainAxisSize.min,  
100 - crossAxisAlignment: CrossAxisAlignment.center,  
101 - children: [  
102 - Image.asset( 68 + Column(
  69 + mainAxisAlignment: MainAxisAlignment.end,
  70 + crossAxisAlignment: CrossAxisAlignment.center,
  71 + children: [
  72 + // Debug button for environment switching
  73 + controller.environmentConfig.isDebug
  74 + ? Center(
  75 + child: TextButton(
  76 + onPressed: controller.onDebugPressed,
  77 + style: TextButton.styleFrom(
  78 + foregroundColor: Colors.red,
  79 + textStyle: const TextStyle(
  80 + fontSize: 18,
  81 + fontWeight: FontWeight.w600,
  82 + ),
  83 + ),
  84 + child: Obx(() {
  85 + final environmentConfig =
  86 + Get.find<AppEnvironmentConfig>();
  87 + return Text(environmentConfig
  88 + .environment.value.name
  89 + .toUpperCase());
  90 + }),
  91 + ),
  92 + )
  93 + : const SizedBox.shrink(),
  94 + Image.asset(
103 'assets/images/common/ic_double_feel_text.png', 95 'assets/images/common/ic_double_feel_text.png',
104 width: 160, 96 width: 160,
105 height: 42, 97 height: 42,
@@ -124,16 +116,9 @@ class LoginView extends GetView<LoginController> { @@ -124,16 +116,9 @@ class LoginView extends GetView<LoginController> {
124 ), 116 ),
125 ), 117 ),
126 ), 118 ),
127 - ],  
128 - ),  
129 - ),  
130 -  
131 - // Login buttons – add new methods here as Column children  
132 - Positioned(  
133 - bottom: bottom(85),  
134 - left: 0,  
135 - right: 0,  
136 - child: Center( 119 + SizedBox(height: 12),
  120 +// buttons
  121 + Center(
137 child: Column( 122 child: Column(
138 mainAxisSize: MainAxisSize.min, 123 mainAxisSize: MainAxisSize.min,
139 children: [ 124 children: [
@@ -146,8 +131,7 @@ class LoginView extends GetView<LoginController> { @@ -146,8 +131,7 @@ class LoginView extends GetView<LoginController> {
146 Get.find<LocalStorage>().lastLoginMethod == 131 Get.find<LocalStorage>().lastLoginMethod ==
147 'phone', 132 'phone',
148 lastUsedLabel: l10n.loginLastUsed, 133 lastUsedLabel: l10n.loginLastUsed,
149 - ),  
150 - const SizedBox(height: 12), 134 + ),
151 ], 135 ],
152 if (region == AppRegion.global && !isOhos()) ...[ 136 if (region == AppRegion.global && !isOhos()) ...[
153 _LoginMethodButton( 137 _LoginMethodButton(
@@ -158,8 +142,7 @@ class LoginView extends GetView<LoginController> { @@ -158,8 +142,7 @@ class LoginView extends GetView<LoginController> {
158 Get.find<LocalStorage>().lastLoginMethod == 142 Get.find<LocalStorage>().lastLoginMethod ==
159 'email', 143 'email',
160 lastUsedLabel: l10n.loginLastUsed, 144 lastUsedLabel: l10n.loginLastUsed,
161 - ),  
162 - const SizedBox(height: 12), 145 + ),
163 _LoginMethodButton( 146 _LoginMethodButton(
164 width: buttonWidth, 147 width: buttonWidth,
165 label: l10n.continueWithGoogle, 148 label: l10n.continueWithGoogle,
@@ -193,23 +176,22 @@ class LoginView extends GetView<LoginController> { @@ -193,23 +176,22 @@ class LoginView extends GetView<LoginController> {
193 fontWeight: FontWeight.w700, 176 fontWeight: FontWeight.w700,
194 ), 177 ),
195 ), 178 ),
196 - ),  
197 - const SizedBox(height: 12) 179 + ),
198 ], 180 ],
199 - if (isIOS()) ...[ 181 +
  182 + if (region == AppRegion.china) ...[
200 _LoginMethodButton( 183 _LoginMethodButton(
201 width: buttonWidth, 184 width: buttonWidth,
202 - label: l10n.loginWithApple,  
203 - onPressed: controller.onAppleLoginPressed, 185 + label: '通过微信登录',
  186 + onPressed: controller.onWechatLoginPressed,
204 isLastUsed: 187 isLastUsed:
205 Get.find<LocalStorage>().lastLoginMethod == 188 Get.find<LocalStorage>().lastLoginMethod ==
206 - 'apple', 189 + 'wechat',
207 lastUsedLabel: l10n.loginLastUsed, 190 lastUsedLabel: l10n.loginLastUsed,
208 icon: Image.asset( 191 icon: Image.asset(
209 - 'assets/images/common/ic_apple.png', 192 + 'assets/images/common/ic_wechat.png',
210 width: 24, 193 width: 24,
211 - height: 24,  
212 - color: context.colors.textPrimary, 194 + height: 24,
213 ), 195 ),
214 buttonStyle: ElevatedButton.styleFrom( 196 buttonStyle: ElevatedButton.styleFrom(
215 backgroundColor: Colors.white, 197 backgroundColor: Colors.white,
@@ -233,20 +215,20 @@ class LoginView extends GetView<LoginController> { @@ -233,20 +215,20 @@ class LoginView extends GetView<LoginController> {
233 ), 215 ),
234 ), 216 ),
235 ], 217 ],
236 - if (region == AppRegion.china) ...[  
237 - const SizedBox(height: 12), 218 + if (isIOS()) ...[
238 _LoginMethodButton( 219 _LoginMethodButton(
239 width: buttonWidth, 220 width: buttonWidth,
240 - label: '通过微信登录',  
241 - onPressed: controller.onWechatLoginPressed, 221 + label: l10n.loginWithApple,
  222 + onPressed: controller.onAppleLoginPressed,
242 isLastUsed: 223 isLastUsed:
243 Get.find<LocalStorage>().lastLoginMethod == 224 Get.find<LocalStorage>().lastLoginMethod ==
244 - 'wechat', 225 + 'apple',
245 lastUsedLabel: l10n.loginLastUsed, 226 lastUsedLabel: l10n.loginLastUsed,
246 icon: Image.asset( 227 icon: Image.asset(
247 - 'assets/images/common/ic_wechat.png', 228 + 'assets/images/common/ic_apple.png',
248 width: 24, 229 width: 24,
249 height: 24, 230 height: 24,
  231 + color: context.colors.textPrimary,
250 ), 232 ),
251 buttonStyle: ElevatedButton.styleFrom( 233 buttonStyle: ElevatedButton.styleFrom(
252 backgroundColor: Colors.white, 234 backgroundColor: Colors.white,
@@ -269,44 +251,39 @@ class LoginView extends GetView<LoginController> { @@ -269,44 +251,39 @@ class LoginView extends GetView<LoginController> {
269 ), 251 ),
270 ), 252 ),
271 ), 253 ),
272 - ] 254 + ],
273 ], 255 ],
274 ), 256 ),
275 - ),  
276 - ),  
277 - // Terms agreement text + checkbox  
278 - Positioned(  
279 - bottom: bottom(0),  
280 - left: 0,  
281 - right: 0,  
282 - child: const AgreementText(), 257 + ),
  258 +// Terms agreement text + checkbox
  259 + AgreementText(),
  260 + SizedBox(height: bottomInset),
  261 + ],
283 ), 262 ),
284 -  
285 - if (controller.environmentConfig.isDebug) 263 + // Welcome texts
  264 + if (!isOhos() &&
  265 + !controller.environmentConfig.hideChooseRegion)
286 Positioned( 266 Positioned(
287 - left: 0,  
288 - right: 0,  
289 - bottom: bottom(0),  
290 - child: Center(  
291 - child: TextButton(  
292 - onPressed: controller.onDebugPressed,  
293 - style: TextButton.styleFrom(  
294 - foregroundColor: context.colors.textSecondary  
295 - .withValues(alpha: 0.55),  
296 - textStyle: const TextStyle(  
297 - fontSize: 12,  
298 - fontWeight: FontWeight.w600, 267 + right: 20,
  268 + top: MediaQuery.paddingOf(context).top,
  269 + child: GestureDetector(
  270 + onTap: () => Get.bottomSheet(
  271 + const _ServiceRegionBottomSheet(),
  272 + backgroundColor: Colors.transparent,
  273 + barrierColor: Colors.black.withValues(alpha: 0.5),
  274 + enableDrag: true,
  275 + isScrollControlled: true,
  276 + ),
  277 + child: Text(
  278 + '🌏',
  279 + textAlign: TextAlign.right,
  280 + style: TextStyle(
  281 + color: Colors.black,
  282 + fontSize: 23,
  283 + fontWeight: FontWeight.w400,
299 ), 284 ),
300 ), 285 ),
301 - child: Obx(() {  
302 - final environmentConfig =  
303 - Get.find<AppEnvironmentConfig>();  
304 - return Text(  
305 - environmentConfig.environment.value.name);  
306 - }),  
307 - ),  
308 - ),  
309 - ), 286 + )),
310 ], 287 ],
311 ); 288 );
312 }); 289 });
@@ -593,11 +570,11 @@ class _LoginMethodButton extends StatelessWidget { @@ -593,11 +570,11 @@ class _LoginMethodButton extends StatelessWidget {
593 onPressed: onPressed, 570 onPressed: onPressed,
594 icon: icon, 571 icon: icon,
595 buttonStyle: buttonStyle, 572 buttonStyle: buttonStyle,
596 - ), 573 + ).marginOnly(top: 12),
597 if (isLastUsed) 574 if (isLastUsed)
598 Positioned( 575 Positioned(
599 right: -4, 576 right: -4,
600 - top: -8, 577 + top: 8,
601 child: Container( 578 child: Container(
602 padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 2), 579 padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 2),
603 decoration: ShapeDecoration( 580 decoration: ShapeDecoration(