fix: 调整注册账户时国外用户默认使用邮箱,并给出提示
This commit is contained in:
parent
2e85975c41
commit
b5dfd10baa
@ -45,272 +45,229 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
resizeToAvoidBottomInset: false,
|
resizeToAvoidBottomInset: false,
|
||||||
backgroundColor: const Color(0xFFFFFFFF),
|
backgroundColor: const Color(0xFFFFFFFF),
|
||||||
appBar: TitleAppBar(
|
appBar: TitleAppBar(
|
||||||
barTitle: '登录'.tr,
|
barTitle: '登录'.tr,
|
||||||
haveBack: false,
|
haveBack: false,
|
||||||
backgroundColor: AppColors.mainColor,
|
backgroundColor: AppColors.mainColor,
|
||||||
actionsList: <Widget>[
|
actionsList: <Widget>[
|
||||||
if (state.isChina == true)
|
if (state.isChina == true)
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
WechatManageTool.getAppInfo(
|
WechatManageTool.getAppInfo(CustomerTool.openCustomerService);
|
||||||
CustomerTool.openCustomerService);
|
},
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.support_agent,
|
||||||
|
color: Colors.white,
|
||||||
|
)),
|
||||||
|
TextButton(
|
||||||
|
child: Text(
|
||||||
|
'注册'.tr,
|
||||||
|
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
||||||
|
),
|
||||||
|
onPressed: () async {
|
||||||
|
final data = await Get.toNamed(Routers.starLockRegisterPage);
|
||||||
|
if (data != null) {
|
||||||
|
state.emailOrPhoneController.text = data['phoneOrEmailStr'];
|
||||||
|
logic.checkNext(state.emailOrPhoneController);
|
||||||
|
state.pwdController.text = data['pwd'];
|
||||||
|
logic.checkNext(state.pwdController);
|
||||||
|
setState(() {});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
body: GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
FocusScope.of(context).unfocus();
|
||||||
|
},
|
||||||
|
child: ListView(
|
||||||
|
padding: EdgeInsets.only(top: 120.h, left: 40.w, right: 40.w),
|
||||||
|
children: <Widget>[
|
||||||
|
Container(
|
||||||
|
padding: EdgeInsets.all(10.w),
|
||||||
|
child: Center(child: Image.asset('images/icon_main_sky_1024.png', width: 110.w, height: 110.w))),
|
||||||
|
SizedBox(height: 50.w),
|
||||||
|
Obx(() => CommonItem(
|
||||||
|
leftTitel: '你所在的国家/地区'.tr,
|
||||||
|
rightTitle: '',
|
||||||
|
isHaveLine: true,
|
||||||
|
isPadding: false,
|
||||||
|
isHaveRightWidget: true,
|
||||||
|
isHaveDirection: true,
|
||||||
|
rightWidget: Text(
|
||||||
|
'${state.countryName} +${state.countryCode.value}',
|
||||||
|
textAlign: TextAlign.end,
|
||||||
|
style: TextStyle(fontSize: 22.sp, color: AppColors.darkGrayTextColor),
|
||||||
|
),
|
||||||
|
action: () async {
|
||||||
|
final result = await Get.toNamed(Routers.selectCountryRegionPage);
|
||||||
|
if (result != null) {
|
||||||
|
result as Map<String, dynamic>;
|
||||||
|
state.countryCode.value = result['code'];
|
||||||
|
state.countryKey.value = result['countryName'];
|
||||||
|
logic.checkIpAction();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
icon: const Icon(
|
)),
|
||||||
Icons.support_agent,
|
LoginInput(
|
||||||
color: Colors.white,
|
focusNode: logic.state.emailOrPhoneFocusNode,
|
||||||
)),
|
controller: state.emailOrPhoneController,
|
||||||
TextButton(
|
onchangeAction: (v) {
|
||||||
child: Text(
|
|
||||||
'注册'.tr,
|
|
||||||
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
|
||||||
),
|
|
||||||
onPressed: () async {
|
|
||||||
final data = await Get.toNamed(Routers.starLockRegisterPage);
|
|
||||||
if (data != null) {
|
|
||||||
state.emailOrPhoneController.text = data['phoneOrEmailStr'];
|
|
||||||
logic.checkNext(state.emailOrPhoneController);
|
logic.checkNext(state.emailOrPhoneController);
|
||||||
state.pwdController.text = data['pwd'];
|
},
|
||||||
|
leftWidget: Padding(
|
||||||
|
padding: EdgeInsets.only(top: 30.w, bottom: 20.w, right: 5.w, left: 5.w),
|
||||||
|
child: Image.asset(
|
||||||
|
'images/icon_login_account.png',
|
||||||
|
width: 36.w,
|
||||||
|
height: 36.w,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
hintText: '请输入手机号或者邮箱'.tr,
|
||||||
|
// keyboardType: TextInputType.number,
|
||||||
|
inputFormatters: <TextInputFormatter>[
|
||||||
|
// FilteringTextInputFormatter.allow(RegExp('[0-9]')),
|
||||||
|
LengthLimitingTextInputFormatter(30),
|
||||||
|
FilteringTextInputFormatter.singleLineFormatter
|
||||||
|
]),
|
||||||
|
SizedBox(height: 10.h),
|
||||||
|
LoginInput(
|
||||||
|
focusNode: logic.state.pwdFocusNode,
|
||||||
|
controller: state.pwdController,
|
||||||
|
onchangeAction: (v) {
|
||||||
logic.checkNext(state.pwdController);
|
logic.checkNext(state.pwdController);
|
||||||
setState(() {});
|
},
|
||||||
}
|
isPwd: true,
|
||||||
},
|
// isSuffixIcon: 2,
|
||||||
|
leftWidget: Padding(
|
||||||
|
padding: EdgeInsets.only(top: 30.w, bottom: 20.w, right: 5.w, left: 5.w),
|
||||||
|
child: Image.asset(
|
||||||
|
'images/icon_login_password.png',
|
||||||
|
width: 36.w,
|
||||||
|
height: 36.w,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
hintText: '请输入密码'.tr,
|
||||||
|
inputFormatters: <TextInputFormatter>[
|
||||||
|
LengthLimitingTextInputFormatter(20),
|
||||||
|
]),
|
||||||
|
// SizedBox(height: 15.h),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
Obx(() => GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
state.agree.value = !state.agree.value;
|
||||||
|
logic.changeAgreeState();
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
// color: Colors.red,
|
||||||
|
padding: EdgeInsets.only(left: 5.w, top: 20.w, right: 10.w, bottom: 20.h),
|
||||||
|
child: Image.asset(
|
||||||
|
state.agree.value ? 'images/icon_round_select.png' : 'images/icon_round_unSelect.png',
|
||||||
|
width: 35.w,
|
||||||
|
height: 35.w,
|
||||||
|
),
|
||||||
|
))),
|
||||||
|
// SizedBox(
|
||||||
|
// width: 5.w,
|
||||||
|
// ),
|
||||||
|
Flexible(
|
||||||
|
child: RichText(
|
||||||
|
text: TextSpan(
|
||||||
|
text: '我已阅读并同意'.tr,
|
||||||
|
style: TextStyle(color: const Color(0xff333333), fontSize: 20.sp),
|
||||||
|
children: <InlineSpan>[
|
||||||
|
WidgetSpan(
|
||||||
|
alignment: PlaceholderAlignment.middle,
|
||||||
|
child: GestureDetector(
|
||||||
|
child:
|
||||||
|
Text('《${'用户协议'.tr}》', style: TextStyle(color: AppColors.mainColor, fontSize: 20.sp)),
|
||||||
|
onTap: () {
|
||||||
|
Get.toNamed(Routers.webviewShowPage, arguments: <String, String>{
|
||||||
|
'url': XSConstantMacro.userAgreementURL,
|
||||||
|
'title': '用户协议'.tr
|
||||||
|
});
|
||||||
|
},
|
||||||
|
)),
|
||||||
|
WidgetSpan(
|
||||||
|
alignment: PlaceholderAlignment.middle,
|
||||||
|
child: GestureDetector(
|
||||||
|
child:
|
||||||
|
Text('《${'隐私政策'.tr}》', style: TextStyle(color: AppColors.mainColor, fontSize: 20.sp)),
|
||||||
|
onTap: () {
|
||||||
|
Get.toNamed(Routers.webviewShowPage, arguments: <String, String>{
|
||||||
|
'url': XSConstantMacro.privacyPolicyURL,
|
||||||
|
'title': '隐私政策'.tr
|
||||||
|
});
|
||||||
|
},
|
||||||
|
)),
|
||||||
|
],
|
||||||
|
)),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(height: 50.w),
|
||||||
|
Obx(() => SubmitBtn(
|
||||||
|
btnName: '登录'.tr,
|
||||||
|
fontSize: 28.sp,
|
||||||
|
borderRadius: 20.w,
|
||||||
|
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
||||||
|
isDisabled: state.canNext.value,
|
||||||
|
onClick: state.canNext.value
|
||||||
|
? () {
|
||||||
|
if (state.agree.value == false) {
|
||||||
|
logic.showToast('请先同意用户协议及隐私政策'.tr);
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
logic.login();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
: null)),
|
||||||
|
// SizedBox(height: 20.w),
|
||||||
|
// Obx(() => Visibility(
|
||||||
|
// visible: state.isCheckVerifyEnable.value,
|
||||||
|
// child: SubmitBtn(
|
||||||
|
// btnName: '一键登录',
|
||||||
|
// fontSize: 28.sp,
|
||||||
|
// borderRadius: 20.w,
|
||||||
|
// padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
||||||
|
// // isDisabled: state.canNext.value,
|
||||||
|
// onClick: () {
|
||||||
|
// if (state.agree.value == false) {
|
||||||
|
// logic.showToast('请先同意用户协议及隐私政策'.tr);
|
||||||
|
// return;
|
||||||
|
// } else {
|
||||||
|
// logic.oneClickLoginAction();
|
||||||
|
// }
|
||||||
|
// }),
|
||||||
|
// )),
|
||||||
|
SizedBox(height: 50.w),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: <Widget>[
|
||||||
|
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: () {
|
||||||
|
Navigator.pushNamed(context, Routers.starLockForgetPasswordPage);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
body: GestureDetector(
|
),
|
||||||
onTap: (){
|
);
|
||||||
FocusScope.of(context).unfocus();
|
|
||||||
},
|
|
||||||
child: ListView(
|
|
||||||
padding: EdgeInsets.only(top: 120.h, left: 40.w, right: 40.w),
|
|
||||||
children: <Widget>[
|
|
||||||
Container(
|
|
||||||
padding: EdgeInsets.all(10.w),
|
|
||||||
child: Center(
|
|
||||||
child: Image.asset('images/icon_main_sky_1024.png',
|
|
||||||
width: 110.w, height: 110.w))),
|
|
||||||
SizedBox(height: 50.w),
|
|
||||||
Obx(() => CommonItem(
|
|
||||||
leftTitel: '你所在的国家/地区'.tr,
|
|
||||||
rightTitle: '',
|
|
||||||
isHaveLine: true,
|
|
||||||
isPadding: false,
|
|
||||||
isHaveRightWidget: true,
|
|
||||||
isHaveDirection: true,
|
|
||||||
rightWidget: Text(
|
|
||||||
'${state.countryName} +${state.countryCode.value}',
|
|
||||||
textAlign: TextAlign.end,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 22.sp, color: AppColors.darkGrayTextColor),
|
|
||||||
),
|
|
||||||
action: () async {
|
|
||||||
final result =
|
|
||||||
await Get.toNamed(Routers.selectCountryRegionPage);
|
|
||||||
if (result != null) {
|
|
||||||
result as Map<String, dynamic>;
|
|
||||||
state.countryCode.value = result['code'];
|
|
||||||
state.countryKey.value = result['countryName'];
|
|
||||||
logic.checkIpAction();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
)),
|
|
||||||
LoginInput(
|
|
||||||
focusNode: logic.state.emailOrPhoneFocusNode,
|
|
||||||
controller: state.emailOrPhoneController,
|
|
||||||
onchangeAction: (v) {
|
|
||||||
logic.checkNext(state.emailOrPhoneController);
|
|
||||||
},
|
|
||||||
leftWidget: Padding(
|
|
||||||
padding: EdgeInsets.only(
|
|
||||||
top: 30.w, bottom: 20.w, right: 5.w, left: 5.w),
|
|
||||||
child: Image.asset(
|
|
||||||
'images/icon_login_account.png',
|
|
||||||
width: 36.w,
|
|
||||||
height: 36.w,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
hintText: '请输入手机号或者邮箱'.tr,
|
|
||||||
// keyboardType: TextInputType.number,
|
|
||||||
inputFormatters: <TextInputFormatter>[
|
|
||||||
// FilteringTextInputFormatter.allow(RegExp('[0-9]')),
|
|
||||||
LengthLimitingTextInputFormatter(30),
|
|
||||||
FilteringTextInputFormatter.singleLineFormatter
|
|
||||||
]),
|
|
||||||
SizedBox(height: 10.h),
|
|
||||||
LoginInput(
|
|
||||||
focusNode: logic.state.pwdFocusNode,
|
|
||||||
controller: state.pwdController,
|
|
||||||
onchangeAction: (v) {
|
|
||||||
logic.checkNext(state.pwdController);
|
|
||||||
},
|
|
||||||
isPwd: true,
|
|
||||||
// isSuffixIcon: 2,
|
|
||||||
leftWidget: Padding(
|
|
||||||
padding: EdgeInsets.only(
|
|
||||||
top: 30.w, bottom: 20.w, right: 5.w, left: 5.w),
|
|
||||||
child: Image.asset(
|
|
||||||
'images/icon_login_password.png',
|
|
||||||
width: 36.w,
|
|
||||||
height: 36.w,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
hintText: '请输入密码'.tr,
|
|
||||||
inputFormatters: <TextInputFormatter>[
|
|
||||||
LengthLimitingTextInputFormatter(20),
|
|
||||||
]),
|
|
||||||
// SizedBox(height: 15.h),
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
children: <Widget>[
|
|
||||||
Obx(() => GestureDetector(
|
|
||||||
onTap: () {
|
|
||||||
state.agree.value = !state.agree.value;
|
|
||||||
logic.changeAgreeState();
|
|
||||||
},
|
|
||||||
child: Container(
|
|
||||||
// color: Colors.red,
|
|
||||||
padding: EdgeInsets.only(
|
|
||||||
left: 5.w, top: 20.w, right: 10.w, bottom: 20.h),
|
|
||||||
child: Image.asset(
|
|
||||||
state.agree.value
|
|
||||||
? 'images/icon_round_select.png'
|
|
||||||
: 'images/icon_round_unSelect.png',
|
|
||||||
width: 35.w,
|
|
||||||
height: 35.w,
|
|
||||||
),
|
|
||||||
))),
|
|
||||||
// SizedBox(
|
|
||||||
// width: 5.w,
|
|
||||||
// ),
|
|
||||||
Flexible(
|
|
||||||
child: RichText(
|
|
||||||
text: TextSpan(
|
|
||||||
text: '我已阅读并同意'.tr,
|
|
||||||
style: TextStyle(
|
|
||||||
color: const Color(0xff333333), fontSize: 20.sp),
|
|
||||||
children: <InlineSpan>[
|
|
||||||
WidgetSpan(
|
|
||||||
alignment: PlaceholderAlignment.middle,
|
|
||||||
child: GestureDetector(
|
|
||||||
child: Text('《${'用户协议'.tr}》',
|
|
||||||
style: TextStyle(
|
|
||||||
color: AppColors.mainColor,
|
|
||||||
fontSize: 20.sp)),
|
|
||||||
onTap: () {
|
|
||||||
Get.toNamed(Routers.webviewShowPage,
|
|
||||||
arguments: <String, String>{
|
|
||||||
'url': XSConstantMacro.userAgreementURL,
|
|
||||||
'title': '用户协议'.tr
|
|
||||||
});
|
|
||||||
},
|
|
||||||
)),
|
|
||||||
WidgetSpan(
|
|
||||||
alignment: PlaceholderAlignment.middle,
|
|
||||||
child: GestureDetector(
|
|
||||||
child: Text('《${'隐私政策'.tr}》',
|
|
||||||
style: TextStyle(
|
|
||||||
color: AppColors.mainColor,
|
|
||||||
fontSize: 20.sp)),
|
|
||||||
onTap: () {
|
|
||||||
Get.toNamed(Routers.webviewShowPage,
|
|
||||||
arguments: <String, String>{
|
|
||||||
'url': XSConstantMacro.privacyPolicyURL,
|
|
||||||
'title': '隐私政策'.tr
|
|
||||||
});
|
|
||||||
},
|
|
||||||
)),
|
|
||||||
],
|
|
||||||
)),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
SizedBox(height: 50.w),
|
|
||||||
Obx(() => SubmitBtn(
|
|
||||||
btnName: '登录'.tr,
|
|
||||||
fontSize: 28.sp,
|
|
||||||
borderRadius: 20.w,
|
|
||||||
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
|
||||||
isDisabled: state.canNext.value,
|
|
||||||
onClick: state.canNext.value
|
|
||||||
? () {
|
|
||||||
if (state.agree.value == false) {
|
|
||||||
logic.showToast('请先同意用户协议及隐私政策'.tr);
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
logic.login();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
: null)),
|
|
||||||
// SizedBox(height: 20.w),
|
|
||||||
// Obx(() => Visibility(
|
|
||||||
// visible: state.isCheckVerifyEnable.value,
|
|
||||||
// child: SubmitBtn(
|
|
||||||
// btnName: '一键登录',
|
|
||||||
// fontSize: 28.sp,
|
|
||||||
// borderRadius: 20.w,
|
|
||||||
// padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
|
||||||
// // isDisabled: state.canNext.value,
|
|
||||||
// onClick: () {
|
|
||||||
// if (state.agree.value == false) {
|
|
||||||
// logic.showToast('请先同意用户协议及隐私政策'.tr);
|
|
||||||
// return;
|
|
||||||
// } else {
|
|
||||||
// logic.oneClickLoginAction();
|
|
||||||
// }
|
|
||||||
// }),
|
|
||||||
// )),
|
|
||||||
SizedBox(height: 50.w),
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: <Widget>[
|
|
||||||
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: () {
|
|
||||||
Navigator.pushNamed(
|
|
||||||
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),
|
||||||
|
|||||||
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,44 +31,45 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
resizeToAvoidBottomInset: false,
|
resizeToAvoidBottomInset: false,
|
||||||
backgroundColor: const Color(0xFFFFFFFF),
|
backgroundColor: const Color(0xFFFFFFFF),
|
||||||
appBar: TitleAppBar(barTitle: '注册'.tr, haveBack: true, backgroundColor: AppColors.mainColor),
|
appBar: TitleAppBar(barTitle: '注册'.tr, haveBack: true, backgroundColor: AppColors.mainColor),
|
||||||
body: GestureDetector(
|
body: GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
FocusScope.of(context).unfocus();
|
FocusScope.of(context).unfocus();
|
||||||
},
|
},
|
||||||
child: ListView(
|
child: ListView(
|
||||||
padding: EdgeInsets.only(top: 40.h, left: 40.w, right: 40.w),
|
padding: EdgeInsets.only(top: 40.h, left: 40.w, right: 40.w),
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
topSelectCountryAndRegionWidget(),
|
topSelectCountryAndRegionWidget(),
|
||||||
middleTFWidget(),
|
middleTFWidget(),
|
||||||
Obx(() {
|
Obx(() {
|
||||||
return SubmitBtn(
|
return SubmitBtn(
|
||||||
btnName: '注册'.tr,
|
btnName: '注册'.tr,
|
||||||
// backgroundColorList: state.canSub.value ? [AppColors.mainColor] :[Colors.grey],
|
// backgroundColorList: state.canSub.value ? [AppColors.mainColor] :[Colors.grey],
|
||||||
fontSize: 30.sp,
|
fontSize: 30.sp,
|
||||||
borderRadius: 20.w,
|
borderRadius: 20.w,
|
||||||
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
||||||
isDisabled: state.canSub.value,
|
isDisabled: state.canSub.value,
|
||||||
onClick: state.canSub.value
|
onClick: state.canSub.value
|
||||||
? () {
|
? () {
|
||||||
if (state.agree.value == false) {
|
if (state.agree.value == false) {
|
||||||
logic.showToast('请先同意用户协议及隐私政策'.tr);
|
logic.showToast('请先同意用户协议及隐私政策'.tr);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
logic.register();
|
logic.register();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
: null);
|
}
|
||||||
}),
|
: null);
|
||||||
SizedBox(
|
}),
|
||||||
height: 20.h,
|
SizedBox(
|
||||||
),
|
height: 20.h,
|
||||||
_buildBottomAgreement()
|
),
|
||||||
],
|
_buildBottomAgreement()
|
||||||
),
|
],
|
||||||
));
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget topSelectCountryAndRegionWidget() {
|
Widget topSelectCountryAndRegionWidget() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user