merge:解决冲突
This commit is contained in:
commit
0f2eaf8d38
BIN
star_lock/images/icon_main_xhj_1024.png
Normal file
BIN
star_lock/images/icon_main_xhj_1024.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 61 KiB |
@ -787,5 +787,6 @@
|
||||
"下载列表":"Download list",
|
||||
"已下载":"Downloaded",
|
||||
"全部视频":"All videos",
|
||||
"已为本设备免费提供3大滚动视频储存服务":"Three scrolling video storage services have been provided for this device free of charge"
|
||||
"已为本设备免费提供3大滚动视频储存服务":"Three scrolling video storage services have been provided for this device free of charge",
|
||||
"欢迎使用":"Welcome to use"
|
||||
}
|
||||
|
||||
@ -786,5 +786,6 @@
|
||||
"下载列表":"下载列表",
|
||||
"已下载":"已下载",
|
||||
"全部视频":"全部视频",
|
||||
"已为本设备免费提供3大滚动视频储存服务":"已为本设备免费提供3大滚动视频储存服务"
|
||||
"已为本设备免费提供3大滚动视频储存服务":"已为本设备免费提供3大滚动视频储存服务",
|
||||
"欢迎使用":"欢迎使用"
|
||||
}
|
||||
|
||||
@ -789,5 +789,6 @@
|
||||
"下载列表":"下载列表",
|
||||
"已下载":"已下载",
|
||||
"全部视频":"全部视频",
|
||||
"已为本设备免费提供3大滚动视频储存服务":"已为本设备免费提供3大滚动视频储存服务"
|
||||
"已为本设备免费提供3大滚动视频储存服务":"已为本设备免费提供3大滚动视频储存服务",
|
||||
"欢迎使用":"欢迎使用"
|
||||
}
|
||||
|
||||
@ -1,7 +1,10 @@
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/common/safetyVerification/safetyVerification_binding.dart';
|
||||
import 'package:star_lock/flavors.dart';
|
||||
import 'package:star_lock/login/forgetPassword/starLock_forgetPassword_xhj_page.dart';
|
||||
import 'package:star_lock/login/login/starLock_login_xhj_page.dart';
|
||||
import 'package:star_lock/login/register/starLock_register_binding.dart';
|
||||
import 'package:star_lock/login/register/starLock_register_xhj_page.dart';
|
||||
import 'package:star_lock/main/lockDetail/accessoriesList/accessoriesList_page.dart';
|
||||
import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_page.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_page.dart';
|
||||
@ -564,15 +567,21 @@ abstract class AppRouters {
|
||||
),
|
||||
GetPage(
|
||||
name: Routers.starLockLoginPage,
|
||||
page: () => const StarLockLoginPage(),
|
||||
page: () => F.sw(
|
||||
defaultCall: () => const StarLockLoginPage(),
|
||||
xhjCall: () => const StarLockLoginXHJPage()),
|
||||
),
|
||||
GetPage(
|
||||
name: Routers.starLockRegisterPage,
|
||||
page: () => const StarLockRegisterPage(),
|
||||
page: () => F.sw(
|
||||
defaultCall: () => const StarLockRegisterPage(),
|
||||
xhjCall: () => const StarLockRegisterXHJPage()),
|
||||
binding: StarLockRegisterBinding()),
|
||||
GetPage(
|
||||
name: Routers.starLockForgetPasswordPage,
|
||||
page: () => const StarLockForgetPasswordPage(),
|
||||
page: () => F.sw(
|
||||
defaultCall: () => const StarLockForgetPasswordPage(),
|
||||
xhjCall: () => const StarLockForgetPasswordXHJPage()),
|
||||
),
|
||||
GetPage(
|
||||
name: Routers.selectCountryRegionPage,
|
||||
@ -1011,9 +1020,7 @@ abstract class AppRouters {
|
||||
// GetPage(
|
||||
// name: Routers.addCardTypeManagePage,
|
||||
// page: () => const AddCardTypeManagePage()),
|
||||
GetPage(
|
||||
name: Routers.addCardPage,
|
||||
page: () => const AddCardPage()),
|
||||
GetPage(name: Routers.addCardPage, page: () => const AddCardPage()),
|
||||
GetPage(name: Routers.cardDetailPage, page: () => const CardDetailPage()),
|
||||
GetPage(
|
||||
name: Routers.fingerprintListPage,
|
||||
@ -1025,9 +1032,7 @@ abstract class AppRouters {
|
||||
name: Routers.fingerprintDetailPage,
|
||||
page: () => const FingerprintDetailPage()),
|
||||
GetPage(name: Routers.faceListPage, page: () => const FaceListPage()),
|
||||
GetPage(
|
||||
name: Routers.addFaceTypePage,
|
||||
page: () => const AddFaceTypePage()),
|
||||
GetPage(name: Routers.addFaceTypePage, page: () => const AddFaceTypePage()),
|
||||
GetPage(
|
||||
name: Routers.passwordKeyDetailChangeDatePage,
|
||||
page: () => const PasswordKeyDetailChangeDatePage()),
|
||||
|
||||
@ -0,0 +1,200 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/app_settings/app_colors.dart';
|
||||
import 'package:star_lock/login/forgetPassword/starLock_forgetPassword_logic.dart';
|
||||
import 'package:star_lock/tools/submitBtn.dart';
|
||||
import 'package:star_lock/tools/tf_loginInput.dart';
|
||||
import 'package:star_lock/tools/titleAppBar.dart';
|
||||
import 'package:star_lock/translations/trans_lib.dart';
|
||||
|
||||
class StarLockForgetPasswordXHJPage extends StatefulWidget {
|
||||
const StarLockForgetPasswordXHJPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<StarLockForgetPasswordXHJPage> createState() =>
|
||||
_StarLockForgetPasswordPageState();
|
||||
}
|
||||
|
||||
class _StarLockForgetPasswordPageState
|
||||
extends State<StarLockForgetPasswordXHJPage> {
|
||||
final logic = Get.put(StarLockForgetPasswordLogic());
|
||||
final state = Get.find<StarLockForgetPasswordLogic>().state;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
backgroundColor: const Color(0xFFFFFFFF),
|
||||
appBar: TitleAppBar(
|
||||
barTitle: "忘记密码".tr,
|
||||
haveBack: true,
|
||||
iconColor: AppColors.blackColor,
|
||||
titleColor: AppColors.blackColor,
|
||||
backgroundColor: Colors.white),
|
||||
body: ListView(
|
||||
padding: EdgeInsets.only(left: 40.w, right: 40.w),
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
var result = await Navigator.pushNamed(
|
||||
context, Routers.selectCountryRegionPage);
|
||||
if (result != null) {
|
||||
result as Map<String, dynamic>;
|
||||
state.countryCode.value = result['code'];
|
||||
state.countryName.value = result['countryName'];
|
||||
}
|
||||
},
|
||||
child: SizedBox(
|
||||
height: 70.h,
|
||||
child: Row(
|
||||
children: [
|
||||
SizedBox(width: 5.w),
|
||||
Text(TranslationLoader.lanKeys!.countryAndRegion!.tr,
|
||||
style: TextStyle(
|
||||
fontSize: 26.sp, color: AppColors.blackColor)),
|
||||
SizedBox(width: 60.w),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Obx(() => Text(
|
||||
'${state.countryName} +${state.countryCode}',
|
||||
textAlign: TextAlign.end,
|
||||
style: TextStyle(
|
||||
fontSize: 26.sp, color: AppColors.mainColor),
|
||||
))
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: 0.5.h,
|
||||
color: Colors.grey,
|
||||
),
|
||||
LoginInput(
|
||||
controller: state.phoneController,
|
||||
onchangeAction: (v) {
|
||||
logic.checkNext(state.phoneController);
|
||||
},
|
||||
leftWidget: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: 30.w, bottom: 20.w, right: 20.w, left: 5.w),
|
||||
),
|
||||
label:
|
||||
TranslationLoader.lanKeys!.pleaseEnterNumberOrEmail!.tr,
|
||||
keyboardType: TextInputType.number,
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(30),
|
||||
]),
|
||||
LoginInput(
|
||||
controller: state.pwdController,
|
||||
onchangeAction: (v) {
|
||||
logic.checkNext(state.pwdController);
|
||||
},
|
||||
isPwd: true,
|
||||
leftWidget: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: 30.w, bottom: 20.w, right: 20.w, left: 5.w),
|
||||
),
|
||||
label:
|
||||
"${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.password!.tr}",
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(20),
|
||||
]),
|
||||
Text(
|
||||
TranslationLoader.lanKeys!.registerPasswordTip!.tr,
|
||||
style: TextStyle(
|
||||
color: AppColors.placeholderTextColor, fontSize: 20.sp),
|
||||
),
|
||||
LoginInput(
|
||||
controller: state.sureController,
|
||||
onchangeAction: (v) {
|
||||
logic.checkNext(state.sureController);
|
||||
},
|
||||
isPwd: true,
|
||||
leftWidget: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: 30.w, bottom: 20.w, right: 20.w, left: 5.w),
|
||||
),
|
||||
label:
|
||||
"${TranslationLoader.lanKeys!.sure!.tr}${TranslationLoader.lanKeys!.password!.tr}",
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(20),
|
||||
]),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: LoginInput(
|
||||
controller: state.codeController,
|
||||
onchangeAction: (v) {
|
||||
logic.checkNext(state.codeController);
|
||||
},
|
||||
leftWidget: Padding(
|
||||
padding: EdgeInsets.only(right: 10.w, left: 5.w),
|
||||
),
|
||||
hintText:
|
||||
"${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.verificationCode!.tr}",
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(20),
|
||||
]),
|
||||
),
|
||||
Obx(() => GestureDetector(
|
||||
onTap: (state.phoneStrIsOK.value && state.canResend.value)
|
||||
? () async {
|
||||
var result = await Navigator.pushNamed(
|
||||
context, Routers.safetyVerificationPage,
|
||||
arguments: {
|
||||
"countryCode": state.countryCode.value,
|
||||
"account": state.phoneStr.value
|
||||
});
|
||||
logic.state.xWidth.value =
|
||||
(result as Map<String, dynamic>)['xWidth'];
|
||||
logic.sendValidationCode();
|
||||
}
|
||||
: null,
|
||||
child: Container(
|
||||
width: 180.w,
|
||||
padding: EdgeInsets.all(10.h),
|
||||
child: Center(
|
||||
child: Text(state.btnText.value,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: AppColors.mainColor,
|
||||
fontSize: 24.sp,
|
||||
)),
|
||||
),
|
||||
),
|
||||
)),
|
||||
SizedBox(
|
||||
width: 10.w,
|
||||
),
|
||||
],
|
||||
),
|
||||
// ],
|
||||
// ),
|
||||
SizedBox(height: 50.w),
|
||||
Obx(() {
|
||||
return SubmitBtn(
|
||||
btnName:
|
||||
"${TranslationLoader.lanKeys!.reset!.tr}${TranslationLoader.lanKeys!.password!.tr}",
|
||||
// backgroundColorList: state.canSub.value ? [AppColors.mainColor] :[Colors.grey],
|
||||
fontSize: 30.sp,
|
||||
borderRadius: 20.w,
|
||||
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
||||
isDisabled: state.canSub.value,
|
||||
onClick: state.canSub.value
|
||||
? () {
|
||||
logic.resetPassword();
|
||||
}
|
||||
: null);
|
||||
}),
|
||||
],
|
||||
));
|
||||
}
|
||||
}
|
||||
337
star_lock/lib/login/login/starLock_login_xhj_page.dart
Normal file
337
star_lock/lib/login/login/starLock_login_xhj_page.dart
Normal file
@ -0,0 +1,337 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/flavors.dart';
|
||||
|
||||
import '../../appRouters.dart';
|
||||
import '../../app_settings/app_colors.dart';
|
||||
import '../../common/XSConstantMacro/XSConstantMacro.dart';
|
||||
import '../../tools/commonItem.dart';
|
||||
import '../../tools/tf_loginInput.dart';
|
||||
import '../../tools/submitBtn.dart';
|
||||
import '../../tools/titleAppBar.dart';
|
||||
import '../../translations/trans_lib.dart';
|
||||
import 'starLock_login_logic.dart';
|
||||
|
||||
class StarLockLoginXHJPage extends StatefulWidget {
|
||||
const StarLockLoginXHJPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<StarLockLoginXHJPage> createState() => _StarLockLoginPageState();
|
||||
}
|
||||
|
||||
class _StarLockLoginPageState extends State<StarLockLoginXHJPage> {
|
||||
final logic = Get.put(StarLockLoginLogic());
|
||||
final state = Get.find<StarLockLoginLogic>().state;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
backgroundColor: const Color(0xFFFFFFFF),
|
||||
body: ListView(
|
||||
padding: EdgeInsets.only(top: 120.h, left: 40.w, right: 40.w),
|
||||
children: [
|
||||
Text(
|
||||
'${"欢迎使用".tr}${F.title}',
|
||||
style: TextStyle(
|
||||
color: AppColors.darkGrayTextColor,
|
||||
fontSize: 48.sp,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 30.h),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
var result = await Get.toNamed(Routers.selectCountryRegionPage);
|
||||
if (result != null) {
|
||||
result as Map<String, dynamic>;
|
||||
state.countryCode.value = result['code'];
|
||||
state.countryName.value = result['countryName'];
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
color: Colors.transparent,
|
||||
child: Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 5.w,
|
||||
),
|
||||
Text(
|
||||
TranslationLoader.lanKeys!.countryAndRegion!.tr,
|
||||
style: TextStyle(
|
||||
fontSize: 22.sp, color: AppColors.darkGrayTextColor),
|
||||
),
|
||||
SizedBox(
|
||||
width: 40.w,
|
||||
),
|
||||
Text(
|
||||
'${state.countryName.value} +${state.countryCode.value}',
|
||||
style: TextStyle(
|
||||
fontSize: 22.sp, color: AppColors.mainColor),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
LoginInput(
|
||||
controller: state.emailOrPhoneController,
|
||||
onchangeAction: (v) {
|
||||
logic.checkNext(state.emailOrPhoneController);
|
||||
},
|
||||
leftWidget: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: 30.w,
|
||||
bottom: 20.w,
|
||||
right: 20.w,
|
||||
),
|
||||
),
|
||||
rightSlot: IconButton(
|
||||
icon: Icon(Icons.close),
|
||||
onPressed: () {},
|
||||
),
|
||||
label: TranslationLoader.lanKeys!.pleaseEnterNumberOrEmail!.tr,
|
||||
// keyboardType: TextInputType.number,
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(30),
|
||||
]),
|
||||
LoginInput(
|
||||
controller: state.pwdController,
|
||||
onchangeAction: (v) {
|
||||
logic.checkNext(state.pwdController);
|
||||
},
|
||||
isPwd: true,
|
||||
leftWidget: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: 30.w,
|
||||
bottom: 20.w,
|
||||
right: 20.w,
|
||||
),
|
||||
),
|
||||
label:
|
||||
"${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.password!.tr}",
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(20),
|
||||
]),
|
||||
SizedBox(height: 30.h),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
state.agree.value = !state.agree.value;
|
||||
logic.changeAgreeState();
|
||||
},
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 10.h),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Obx(
|
||||
() => Container(
|
||||
padding: EdgeInsets.only(
|
||||
left: 5.w,
|
||||
right: 10.w,
|
||||
),
|
||||
child: Image.asset(
|
||||
state.agree.value
|
||||
? 'images/icon_round_select.png'
|
||||
: 'images/icon_round_unSelect.png',
|
||||
width: 20.w,
|
||||
height: 20.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
Flexible(
|
||||
child: RichText(
|
||||
text: TextSpan(
|
||||
text: TranslationLoader.lanKeys!.readAndAgree!.tr,
|
||||
style: TextStyle(
|
||||
color: const Color(0xff333333), fontSize: 20.sp),
|
||||
children: [
|
||||
WidgetSpan(
|
||||
alignment: PlaceholderAlignment.middle,
|
||||
child: GestureDetector(
|
||||
child: Text(
|
||||
'《${TranslationLoader.lanKeys!.userAgreement!.tr}》',
|
||||
style: TextStyle(
|
||||
color: AppColors.mainColor,
|
||||
fontSize: 20.sp)),
|
||||
onTap: () {
|
||||
Get.toNamed(Routers.webviewShowPage,
|
||||
arguments: {
|
||||
"url": XSConstantMacro.userAgreementURL,
|
||||
"title": '用户协议'.tr
|
||||
});
|
||||
},
|
||||
)),
|
||||
WidgetSpan(
|
||||
alignment: PlaceholderAlignment.middle,
|
||||
child: GestureDetector(
|
||||
child: Text(
|
||||
'《${TranslationLoader.lanKeys!.privacyPolicy!.tr}》',
|
||||
style: TextStyle(
|
||||
color: AppColors.mainColor,
|
||||
fontSize: 20.sp)),
|
||||
onTap: () {
|
||||
Get.toNamed(Routers.webviewShowPage,
|
||||
arguments: {
|
||||
"url": XSConstantMacro.privacyPolicyURL,
|
||||
"title": '隐私政策'.tr
|
||||
});
|
||||
},
|
||||
)),
|
||||
],
|
||||
)),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 15.w),
|
||||
Obx(() => SubmitBtn(
|
||||
btnName: TranslationLoader.lanKeys!.login!.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: 10.h),
|
||||
ElevatedButton(
|
||||
onPressed: () async {
|
||||
var 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);
|
||||
}
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: AppColors.mainColor),
|
||||
child: Text(
|
||||
TranslationLoader.lanKeys!.register!.tr,
|
||||
style: TextStyle(fontSize: 22.sp, color: Colors.white),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 5.w),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
GestureDetector(
|
||||
child: SizedBox(
|
||||
// width: 150.w,
|
||||
height: 50.h,
|
||||
// color: Colors.red,
|
||||
child: Center(
|
||||
child: Text(
|
||||
'${TranslationLoader.lanKeys!.forgetPassword!.tr}?',
|
||||
style: TextStyle(
|
||||
fontSize: 22.sp, color: AppColors.mainColor)),
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.pushNamed(
|
||||
context, Routers.starLockForgetPasswordPage);
|
||||
},
|
||||
),
|
||||
Expanded(
|
||||
child: SizedBox(
|
||||
width: 10.sp,
|
||||
)),
|
||||
F.isLite
|
||||
? Container()
|
||||
: 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: () {
|
||||
Get.toNamed(Routers.demoModeLockDetailPage);
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
Widget loginInput(
|
||||
{TextEditingController? controller,
|
||||
List<TextInputFormatter>? inputFormatters,
|
||||
String? hintText,
|
||||
bool? isHaveLeftWidget,
|
||||
Widget? leftWidget,
|
||||
String? label,
|
||||
bool? isPwd,
|
||||
BlockStrCallback? onchangeAction}) {
|
||||
return Container(
|
||||
width: 1.sp,
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
color: Colors.red,
|
||||
child: Image.asset(
|
||||
'images/icon_login_password.png',
|
||||
width: 36.w,
|
||||
height: 36.w,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 40.w,
|
||||
),
|
||||
Expanded(
|
||||
child: TextField(
|
||||
//输入框一行
|
||||
maxLines: 1,
|
||||
controller: controller,
|
||||
onChanged: onchangeAction,
|
||||
// autofocus: false,
|
||||
inputFormatters: inputFormatters,
|
||||
decoration: InputDecoration(
|
||||
//输入里面输入文字内边距设置
|
||||
contentPadding: const EdgeInsets.only(
|
||||
top: 8.0, left: -19.0, right: -15.0, bottom: 8.0),
|
||||
labelText: label,
|
||||
labelStyle: TextStyle(fontSize: 22.sp),
|
||||
hintStyle: TextStyle(fontSize: 22.sp),
|
||||
hintText: hintText,
|
||||
//不需要输入框下划线
|
||||
border: InputBorder.none,
|
||||
//左边图标设置
|
||||
// icon: isHaveLeftWidget == true
|
||||
// ? leftWidget
|
||||
// : SizedBox(
|
||||
// width: 20.w,
|
||||
// height: 40.w,
|
||||
// ),
|
||||
),
|
||||
obscureText: isPwd ?? false,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
height: 0.5.h,
|
||||
color: Colors.grey,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
305
star_lock/lib/login/register/starLock_register_xhj_page.dart
Normal file
305
star_lock/lib/login/register/starLock_register_xhj_page.dart
Normal file
@ -0,0 +1,305 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../appRouters.dart';
|
||||
import '../../app_settings/app_colors.dart';
|
||||
import '../../common/XSConstantMacro/XSConstantMacro.dart';
|
||||
import '../../tools/tf_loginInput.dart';
|
||||
import '../../tools/submitBtn.dart';
|
||||
import '../../tools/titleAppBar.dart';
|
||||
import '../../translations/trans_lib.dart';
|
||||
import 'starLock_register_logic.dart';
|
||||
|
||||
class StarLockRegisterXHJPage extends StatefulWidget {
|
||||
const StarLockRegisterXHJPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<StarLockRegisterXHJPage> createState() => _StarLockRegisterPageState();
|
||||
}
|
||||
|
||||
class _StarLockRegisterPageState extends State<StarLockRegisterXHJPage> {
|
||||
final logic = Get.put(StarLockRegisterLogic());
|
||||
final state = Get.find<StarLockRegisterLogic>().state;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
backgroundColor: Colors.white,
|
||||
appBar: TitleAppBar(
|
||||
barTitle: TranslationLoader.lanKeys!.register!.tr,
|
||||
haveBack: true,
|
||||
iconColor: AppColors.blackColor,
|
||||
titleColor: AppColors.blackColor,
|
||||
backgroundColor: Colors.white),
|
||||
body: ListView(
|
||||
padding: EdgeInsets.only(left: 40.w, right: 40.w),
|
||||
children: [
|
||||
topSelectCountryAndRegionWidget(),
|
||||
middleTFWidget(),
|
||||
_buildBottomAgreement(),
|
||||
SizedBox(
|
||||
height: 10.h,
|
||||
),
|
||||
Obx(() {
|
||||
return SubmitBtn(
|
||||
btnName: TranslationLoader.lanKeys!.register!.tr,
|
||||
// backgroundColorList: state.canSub.value ? [AppColors.mainColor] :[Colors.grey],
|
||||
fontSize: 30.sp,
|
||||
borderRadius: 20.w,
|
||||
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
||||
isDisabled: state.canSub.value,
|
||||
onClick: state.canSub.value
|
||||
? () {
|
||||
if (state.agree.value == false) {
|
||||
logic.showToast('请先同意用户协议及隐私政策'.tr);
|
||||
return;
|
||||
} else {
|
||||
logic.register();
|
||||
}
|
||||
}
|
||||
: null);
|
||||
}),
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
Widget topSelectCountryAndRegionWidget() {
|
||||
return Column(
|
||||
children: [
|
||||
Container(
|
||||
height: 80.h,
|
||||
child: DefaultTabController(
|
||||
length: 2,
|
||||
child: TabBar(
|
||||
onTap: (int index) {
|
||||
state.isIphoneType.value = index == 0;
|
||||
},
|
||||
overlayColor: MaterialStateProperty.resolveWith((states) {
|
||||
return Colors.transparent;
|
||||
}),
|
||||
dividerHeight: 0,
|
||||
indicatorSize: TabBarIndicatorSize.tab,
|
||||
tabs: [
|
||||
Text(TranslationLoader.lanKeys!.iphone!.tr),
|
||||
Text(TranslationLoader.lanKeys!.email!.tr)
|
||||
],
|
||||
indicatorColor: AppColors.mainColor,
|
||||
labelStyle:
|
||||
TextStyle(color: AppColors.mainColor, fontSize: 26.sp),
|
||||
unselectedLabelStyle:
|
||||
TextStyle(color: AppColors.blackColor, fontSize: 22.sp),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 15.h,
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
var result = await Get.toNamed(Routers.selectCountryRegionPage);
|
||||
if (result != null) {
|
||||
result as Map<String, dynamic>;
|
||||
state.countryCode.value = result['code'];
|
||||
state.countryName.value = result['countryName'];
|
||||
}
|
||||
Get.log("路由返回值: $result, countryCode:${logic.state.countryCode}");
|
||||
},
|
||||
child: Obx(() => Container(
|
||||
color: Colors.white,
|
||||
height: 70.h,
|
||||
child: Row(
|
||||
children: [
|
||||
SizedBox(width: 5.w),
|
||||
Text(TranslationLoader.lanKeys!.countryAndRegion!.tr,
|
||||
style: TextStyle(
|
||||
fontSize: 26.sp, color: AppColors.blackColor)),
|
||||
SizedBox(width: 50.w),
|
||||
Text(
|
||||
state.isIphoneType.value
|
||||
? '${state.countryName.value} +${state.countryCode.value}'
|
||||
: state.countryName.value,
|
||||
style: TextStyle(
|
||||
fontSize: 26.sp, color: AppColors.mainColor),
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget middleTFWidget() {
|
||||
return Column(
|
||||
children: [
|
||||
Obx(() => LoginInput(
|
||||
controller: state.phoneOrEmailController,
|
||||
onchangeAction: (v) {
|
||||
logic.checkNext(state.phoneOrEmailController);
|
||||
},
|
||||
leftWidget: Padding(
|
||||
padding: EdgeInsets.only(right: 10.w, left: 5.w),
|
||||
),
|
||||
label:
|
||||
"${TranslationLoader.lanKeys!.pleaseEnter!.tr}${state.isIphoneType.value ? "手机号".tr : TranslationLoader.lanKeys!.email!.tr}",
|
||||
keyboardType: TextInputType.number,
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(30),
|
||||
])),
|
||||
LoginInput(
|
||||
controller: state.pwdController,
|
||||
onchangeAction: (v) {
|
||||
logic.checkNext(state.pwdController);
|
||||
},
|
||||
isPwd: true,
|
||||
leftWidget: Padding(
|
||||
padding: EdgeInsets.only(right: 10.w, left: 5.w),
|
||||
),
|
||||
label:
|
||||
"${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.password!.tr}",
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(20),
|
||||
]),
|
||||
Text(
|
||||
TranslationLoader.lanKeys!.registerPasswordTip!.tr,
|
||||
style:
|
||||
TextStyle(color: AppColors.placeholderTextColor, fontSize: 20.sp),
|
||||
),
|
||||
LoginInput(
|
||||
controller: state.sureController,
|
||||
onchangeAction: (v) {
|
||||
logic.checkNext(state.sureController);
|
||||
},
|
||||
isPwd: true,
|
||||
leftWidget: Padding(
|
||||
padding: EdgeInsets.only(right: 10.w, left: 5.w),
|
||||
),
|
||||
label:
|
||||
"${TranslationLoader.lanKeys!.sure!.tr}${TranslationLoader.lanKeys!.password!.tr}",
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(20),
|
||||
]),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: LoginInput(
|
||||
controller: state.codeController,
|
||||
onchangeAction: (v) {
|
||||
logic.checkNext(state.codeController);
|
||||
},
|
||||
leftWidget: Padding(
|
||||
padding: EdgeInsets.only(right: 10.w, left: 5.w),
|
||||
),
|
||||
label:
|
||||
"${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.verificationCode!.tr}",
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(20),
|
||||
]),
|
||||
),
|
||||
Obx(() => GestureDetector(
|
||||
onTap:
|
||||
state.phoneOrEmailStrIsOK.value && state.canResend.value
|
||||
? () async {
|
||||
// Navigator.pushNamed(context, Routers.safetyVerificationPage, arguments: {"countryCode":"+86", "account":state.phoneOrEmailStr.value});
|
||||
var result = await Navigator.pushNamed(
|
||||
context, Routers.safetyVerificationPage,
|
||||
arguments: {
|
||||
"countryCode": state.countryCode,
|
||||
"account": state.phoneOrEmailStr.value
|
||||
});
|
||||
state.xWidth.value =
|
||||
(result as Map<String, dynamic>)['xWidth'];
|
||||
logic.sendValidationCode();
|
||||
}
|
||||
: null,
|
||||
child: Container(
|
||||
color: Colors.transparent,
|
||||
padding: EdgeInsets.all(10.h),
|
||||
child: Center(
|
||||
child: Text(state.btnText.value,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: AppColors.mainColor,
|
||||
fontSize: 22.sp,
|
||||
)),
|
||||
),
|
||||
),
|
||||
)),
|
||||
SizedBox(
|
||||
width: 20.w,
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 50.w),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildBottomAgreement() {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
state.agree.value = !state.agree.value;
|
||||
logic.changeAgreeState();
|
||||
},
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 16.h),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Obx(() => Image.asset(
|
||||
state.agree.value
|
||||
? 'images/icon_round_select.png'
|
||||
: 'images/icon_round_unSelect.png',
|
||||
width: 20.w,
|
||||
height: 20.w,
|
||||
)),
|
||||
SizedBox(
|
||||
width: 15.w,
|
||||
),
|
||||
Flexible(
|
||||
child: RichText(
|
||||
text: TextSpan(
|
||||
text: TranslationLoader.lanKeys!.readAndAgree!.tr,
|
||||
style:
|
||||
TextStyle(color: const Color(0xff333333), fontSize: 20.sp),
|
||||
children: [
|
||||
WidgetSpan(
|
||||
alignment: PlaceholderAlignment.middle,
|
||||
child: GestureDetector(
|
||||
child: Text(
|
||||
'《${TranslationLoader.lanKeys!.userAgreement!.tr}》',
|
||||
style: TextStyle(
|
||||
color: AppColors.mainColor, fontSize: 20.sp)),
|
||||
onTap: () {
|
||||
Get.toNamed(Routers.webviewShowPage, arguments: {
|
||||
"url": XSConstantMacro.userAgreementURL,
|
||||
"title": '用户协议'.tr
|
||||
});
|
||||
},
|
||||
)),
|
||||
WidgetSpan(
|
||||
alignment: PlaceholderAlignment.middle,
|
||||
child: GestureDetector(
|
||||
child: Text(
|
||||
'《${TranslationLoader.lanKeys!.privacyPolicy!.tr}》',
|
||||
style: TextStyle(
|
||||
color: AppColors.mainColor, fontSize: 20.sp)),
|
||||
onTap: () {
|
||||
Get.toNamed(Routers.webviewShowPage, arguments: {
|
||||
"url": XSConstantMacro.privacyPolicyURL,
|
||||
"title": '隐私政策'.tr
|
||||
});
|
||||
},
|
||||
)),
|
||||
],
|
||||
)),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -55,8 +55,12 @@ class _AboutPageState extends State<AboutPage> {
|
||||
children: [
|
||||
SizedBox(height: 150.h),
|
||||
Row(mainAxisAlignment: MainAxisAlignment.center, children: [
|
||||
Image.asset("images/icon_main_1024.png",
|
||||
width: 160.w, height: 160.w),
|
||||
Image.asset(
|
||||
F.sw(
|
||||
defaultCall: () => "images/icon_main_1024.png",
|
||||
xhjCall: () => "images/icon_main_xhj_1024.png"),
|
||||
width: 160.w,
|
||||
height: 160.w),
|
||||
]),
|
||||
SizedBox(height: 20.h),
|
||||
Text(
|
||||
@ -95,11 +99,10 @@ class _AboutPageState extends State<AboutPage> {
|
||||
isHaveLine: false,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Get.toNamed(Routers.webviewShowPage,
|
||||
arguments: {
|
||||
"url": XSConstantMacro.userAgreementURL,
|
||||
"title": '用户协议'.tr
|
||||
});
|
||||
Get.toNamed(Routers.webviewShowPage, arguments: {
|
||||
"url": XSConstantMacro.userAgreementURL,
|
||||
"title": '用户协议'.tr
|
||||
});
|
||||
}),
|
||||
Divider(
|
||||
height: 1,
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/app_settings/app_colors.dart';
|
||||
import 'package:star_lock/flavors.dart';
|
||||
import 'package:star_lock/mine/about/webviewShow_logic.dart';
|
||||
import 'package:star_lock/tools/titleAppBar.dart';
|
||||
import 'package:webview_flutter/webview_flutter.dart';
|
||||
@ -24,6 +26,10 @@ class _WebviewShowPageState extends State<WebviewShowPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
state.webViewController.loadRequest(Uri.parse(state.webURL));
|
||||
return F.sw(defaultCall: () => defaultView(), xhjCall: () => xhjView());
|
||||
}
|
||||
|
||||
Widget defaultView() {
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
backgroundColor: const Color(0xFFFFFFFF),
|
||||
@ -35,6 +41,21 @@ class _WebviewShowPageState extends State<WebviewShowPage> {
|
||||
body: WebViewWidget(controller: state.webViewController));
|
||||
}
|
||||
|
||||
Widget xhjView() {
|
||||
return SafeArea(
|
||||
child: Stack(
|
||||
children: [
|
||||
WebViewWidget(controller: state.webViewController),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
},
|
||||
icon: Icon(Icons.arrow_back_ios)),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
String getWebTitle() {
|
||||
String webTitleStr = state.webTitle;
|
||||
state.webViewController.getTitle().then((result) {
|
||||
|
||||
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/flavors.dart';
|
||||
import 'package:star_lock/login/login/starLock_login_page.dart';
|
||||
import 'package:star_lock/login/login/starLock_login_xhj_page.dart';
|
||||
import 'package:star_lock/main/lockMian/lockMain/xhj/lockMain_xhj_page.dart';
|
||||
import 'package:star_lock/tools/appFirstEnterHandle.dart';
|
||||
import 'package:star_lock/debug/debug_tool.dart';
|
||||
@ -44,15 +45,19 @@ class _StarLockApplicationState extends State<StarLockApplication> {
|
||||
if (snapshot.data!) {
|
||||
// 如果用户已登录,返回主页面
|
||||
return F.sw(
|
||||
defaultCall: () => StarLockMainPage(),
|
||||
defaultCall: () => StarLockMainPage(),
|
||||
xhjCall: () => const StarLockMainXHJPage());
|
||||
} else {
|
||||
// 如果用户未登录,返回登录页面
|
||||
return const StarLockLoginPage();
|
||||
return F.sw(
|
||||
defaultCall: () => const StarLockLoginPage(),
|
||||
xhjCall: () => const StarLockLoginXHJPage());
|
||||
}
|
||||
} else {
|
||||
// 如果没有数据,返回一个空白的小部件
|
||||
return const StarLockLoginPage();
|
||||
return F.sw(
|
||||
defaultCall: () => const StarLockLoginPage(),
|
||||
xhjCall: () => const StarLockLoginXHJPage());
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
@ -2,6 +2,7 @@ import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:star_lock/app_settings/app_colors.dart';
|
||||
|
||||
/*
|
||||
* 登录注册页面 input
|
||||
@ -41,15 +42,13 @@ class LoginInput extends StatelessWidget {
|
||||
this.isHaveLeftWidget = true,
|
||||
this.leftWidget,
|
||||
this.onchangeAction,
|
||||
this.onTapAction})
|
||||
this.onTapAction,
|
||||
})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
// color: Colors.red,
|
||||
// width: 1.sp,
|
||||
// height: 200.h,
|
||||
child: Column(
|
||||
children: [
|
||||
TextField(
|
||||
@ -66,7 +65,7 @@ class LoginInput extends StatelessWidget {
|
||||
contentPadding: const EdgeInsets.only(
|
||||
top: 8.0, left: -19.0, right: -15.0, bottom: 8.0),
|
||||
labelText: label,
|
||||
labelStyle: TextStyle(fontSize: 22.sp),
|
||||
labelStyle: TextStyle(fontSize: 22.sp,color: AppColors.darkGrayTextColor),
|
||||
hintStyle: TextStyle(fontSize: 22.sp),
|
||||
hintText: hintText,
|
||||
//不需要输入框下划线
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user