fix: 调整注册账户时国外用户默认使用邮箱,并给出提示

This commit is contained in:
liyi 2025-09-28 09:31:13 +08:00
parent 2e85975c41
commit b5dfd10baa
3 changed files with 260 additions and 300 deletions

View File

@ -55,8 +55,7 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
if (state.isChina == true) if (state.isChina == true)
IconButton( IconButton(
onPressed: () { onPressed: () {
WechatManageTool.getAppInfo( WechatManageTool.getAppInfo(CustomerTool.openCustomerService);
CustomerTool.openCustomerService);
}, },
icon: const Icon( icon: const Icon(
Icons.support_agent, Icons.support_agent,
@ -89,9 +88,7 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
children: <Widget>[ children: <Widget>[
Container( Container(
padding: EdgeInsets.all(10.w), padding: EdgeInsets.all(10.w),
child: Center( child: Center(child: Image.asset('images/icon_main_sky_1024.png', width: 110.w, height: 110.w))),
child: Image.asset('images/icon_main_sky_1024.png',
width: 110.w, height: 110.w))),
SizedBox(height: 50.w), SizedBox(height: 50.w),
Obx(() => CommonItem( Obx(() => CommonItem(
leftTitel: '你所在的国家/地区'.tr, leftTitel: '你所在的国家/地区'.tr,
@ -103,12 +100,10 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
rightWidget: Text( rightWidget: Text(
'${state.countryName} +${state.countryCode.value}', '${state.countryName} +${state.countryCode.value}',
textAlign: TextAlign.end, textAlign: TextAlign.end,
style: TextStyle( style: TextStyle(fontSize: 22.sp, color: AppColors.darkGrayTextColor),
fontSize: 22.sp, color: AppColors.darkGrayTextColor),
), ),
action: () async { action: () async {
final result = final result = await Get.toNamed(Routers.selectCountryRegionPage);
await Get.toNamed(Routers.selectCountryRegionPage);
if (result != null) { if (result != null) {
result as Map<String, dynamic>; result as Map<String, dynamic>;
state.countryCode.value = result['code']; state.countryCode.value = result['code'];
@ -124,8 +119,7 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
logic.checkNext(state.emailOrPhoneController); logic.checkNext(state.emailOrPhoneController);
}, },
leftWidget: Padding( leftWidget: Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(top: 30.w, bottom: 20.w, right: 5.w, left: 5.w),
top: 30.w, bottom: 20.w, right: 5.w, left: 5.w),
child: Image.asset( child: Image.asset(
'images/icon_login_account.png', 'images/icon_login_account.png',
width: 36.w, width: 36.w,
@ -149,8 +143,7 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
isPwd: true, isPwd: true,
// isSuffixIcon: 2, // isSuffixIcon: 2,
leftWidget: Padding( leftWidget: Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(top: 30.w, bottom: 20.w, right: 5.w, left: 5.w),
top: 30.w, bottom: 20.w, right: 5.w, left: 5.w),
child: Image.asset( child: Image.asset(
'images/icon_login_password.png', 'images/icon_login_password.png',
width: 36.w, width: 36.w,
@ -172,12 +165,9 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
}, },
child: Container( child: Container(
// color: Colors.red, // color: Colors.red,
padding: EdgeInsets.only( padding: EdgeInsets.only(left: 5.w, top: 20.w, right: 10.w, bottom: 20.h),
left: 5.w, top: 20.w, right: 10.w, bottom: 20.h),
child: Image.asset( child: Image.asset(
state.agree.value state.agree.value ? 'images/icon_round_select.png' : 'images/icon_round_unSelect.png',
? 'images/icon_round_select.png'
: 'images/icon_round_unSelect.png',
width: 35.w, width: 35.w,
height: 35.w, height: 35.w,
), ),
@ -189,19 +179,15 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: '我已阅读并同意'.tr, text: '我已阅读并同意'.tr,
style: TextStyle( style: TextStyle(color: const Color(0xff333333), fontSize: 20.sp),
color: const Color(0xff333333), fontSize: 20.sp),
children: <InlineSpan>[ children: <InlineSpan>[
WidgetSpan( WidgetSpan(
alignment: PlaceholderAlignment.middle, alignment: PlaceholderAlignment.middle,
child: GestureDetector( child: GestureDetector(
child: Text('${'用户协议'.tr}', child:
style: TextStyle( Text('${'用户协议'.tr}', style: TextStyle(color: AppColors.mainColor, fontSize: 20.sp)),
color: AppColors.mainColor,
fontSize: 20.sp)),
onTap: () { onTap: () {
Get.toNamed(Routers.webviewShowPage, Get.toNamed(Routers.webviewShowPage, arguments: <String, String>{
arguments: <String, String>{
'url': XSConstantMacro.userAgreementURL, 'url': XSConstantMacro.userAgreementURL,
'title': '用户协议'.tr 'title': '用户协议'.tr
}); });
@ -210,13 +196,10 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
WidgetSpan( WidgetSpan(
alignment: PlaceholderAlignment.middle, alignment: PlaceholderAlignment.middle,
child: GestureDetector( child: GestureDetector(
child: Text('${'隐私政策'.tr}', child:
style: TextStyle( Text('${'隐私政策'.tr}', style: TextStyle(color: AppColors.mainColor, fontSize: 20.sp)),
color: AppColors.mainColor,
fontSize: 20.sp)),
onTap: () { onTap: () {
Get.toNamed(Routers.webviewShowPage, Get.toNamed(Routers.webviewShowPage, arguments: <String, String>{
arguments: <String, String>{
'url': XSConstantMacro.privacyPolicyURL, 'url': XSConstantMacro.privacyPolicyURL,
'title': '隐私政策'.tr 'title': '隐私政策'.tr
}); });
@ -272,45 +255,19 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
height: 50.h, height: 50.h,
// color: Colors.red, // color: Colors.red,
child: Center( child: Center(
child: Text('${'忘记密码'.tr}', child: Text('${'忘记密码'.tr}', style: TextStyle(fontSize: 22.sp, color: AppColors.mainColor)),
style: TextStyle(
fontSize: 22.sp, color: AppColors.mainColor)),
), ),
), ),
onTap: () { onTap: () {
Navigator.pushNamed( Navigator.pushNamed(context, Routers.starLockForgetPasswordPage);
context, Routers.starLockForgetPasswordPage);
}, },
), ),
Expanded(
child: SizedBox(
width: 10.sp,
)),
Obx(() => Visibility(
visible: state.isCheckVerifyEnable.value &&
state.currentLanguage == 'zh_CN',
child: GestureDetector(
child: SizedBox(
// width: 150.w,
height: 50.h,
// color: Colors.red,
child: Center(
child: Text('一键登录'.tr,
style: TextStyle(
fontSize: 22.sp,
color: AppColors.mainColor)),
),
),
onTap: () {
logic.oneClickLoginAction(context);
},
),
))
], ],
), ),
], ],
), ),
)); ),
);
} }
Widget loginInput( Widget loginInput(
@ -351,8 +308,7 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
inputFormatters: inputFormatters, inputFormatters: inputFormatters,
decoration: InputDecoration( decoration: InputDecoration(
// //
contentPadding: const EdgeInsets.only( contentPadding: const EdgeInsets.only(top: 8.0, left: -19.0, right: -15.0, bottom: 8.0),
top: 8.0, left: -19.0, right: -15.0, bottom: 8.0),
labelText: label, labelText: label,
labelStyle: TextStyle(fontSize: 22.sp), labelStyle: TextStyle(fontSize: 22.sp),
hintStyle: TextStyle(fontSize: 22.sp), hintStyle: TextStyle(fontSize: 22.sp),

View File

@ -101,6 +101,7 @@ class StarLockRegisterLogic extends BaseGetXController {
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
if (entity.data!.abbreviation != 'CN') { if (entity.data!.abbreviation != 'CN') {
showToast('当前国家不支持手机验证码注册,请使用邮箱进行注册'.tr); showToast('当前国家不支持手机验证码注册,请使用邮箱进行注册'.tr);
state.isIphoneType.value = false;
return; return;
} }
if (state.countryName.value != entity.data!.name) { if (state.countryName.value != entity.data!.name) {
@ -149,7 +150,7 @@ class StarLockRegisterLogic extends BaseGetXController {
} }
@override @override
void onReady() { void onReady() async {
super.onReady(); super.onReady();
XSConstantMacro().getDeviceInfoData().then((Map<String, dynamic> data) { XSConstantMacro().getDeviceInfoData().then((Map<String, dynamic> data) {
@ -158,5 +159,7 @@ class StarLockRegisterLogic extends BaseGetXController {
// //
AppLog.log('获取设备信息时出错: $error'); AppLog.log('获取设备信息时出错: $error');
}); });
await checkIpAction();
} }
} }

View File

@ -68,7 +68,8 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
_buildBottomAgreement() _buildBottomAgreement()
], ],
), ),
)); ),
);
} }
Widget topSelectCountryAndRegionWidget() { Widget topSelectCountryAndRegionWidget() {