Merge branch 'optimized_startup_wei' into develop

# Conflicts:
#	lan/lan_en.json
#	lan/lan_keys.json
#	lan/lan_zh.json
This commit is contained in:
魏少阳 2024-09-13 14:59:55 +08:00
commit baad7fdea0
17 changed files with 175 additions and 87 deletions

View File

@ -912,4 +912,6 @@
"支持的国家值":"United States, Canada, United Kingdom, Germany, France, Italy, Spain, Australia, New Zealand, India, Japan", "支持的国家值":"United States, Canada, United Kingdom, Germany, France, Italy, Spain, Australia, New Zealand, India, Japan",
"操作流程": "Operation process", "操作流程": "Operation process",
"操作流程值": "1. Open the Alexa app and search for the Skye Smart Lock skill\n2. Click Enable Skill and log in to your Skye account\n3. Say 'Alexa, discover devices' to Alexa\n4. After discovering the device, you can use the voice command to control the lock" "操作流程值": "1. Open the Alexa app and search for the Skye Smart Lock skill\n2. Click Enable Skill and log in to your Skye account\n3. Say 'Alexa, discover devices' to Alexa\n4. After discovering the device, you can use the voice command to control the lock"
"秒内不可使用面容开锁": "Face unlocking cannot be used within seconds",
"密码需至少包含数字/字母/字符中的2种组合": "The password must contain at least 2 combinations of numbers/letters/characters"
} }

View File

@ -948,4 +948,7 @@
"支持的国家值":"支持的国家值", "支持的国家值":"支持的国家值",
"操作流程":"操作流程", "操作流程":"操作流程",
"操作流程值":"操作流程值" "操作流程值":"操作流程值"
"秒内不可使用面容开锁": "秒内不可使用面容开锁",
"密码需至少包含数字/字母/字符中的2种组合": "密码需至少包含数字/字母/字符中的2种组合"
} }

View File

@ -908,4 +908,8 @@
"支持的国家值": "美国、加拿大、英国、澳大利亚、印度、德国、法国、意大利、西班牙、日本", "支持的国家值": "美国、加拿大、英国、澳大利亚、印度、德国、法国、意大利、西班牙、日本",
"操作流程": "操作流程", "操作流程": "操作流程",
"操作流程值":"1 用智能锁APP添加锁和网关\n\n2 在APP里开启锁的远程开锁功能这个功能默认是关闭的。如果没有这个选项则锁不支持Alexa \n\n3 在Alexa中添加Skill并用智能锁APP的账号和密码进行授权。授权成功后就可以发现账号下的设备\n\n4 在Alexa app里找到锁开启语音开锁的功能并设置语言密码\n\n5 可以通过Alexa操作锁了" "操作流程值":"1 用智能锁APP添加锁和网关\n\n2 在APP里开启锁的远程开锁功能这个功能默认是关闭的。如果没有这个选项则锁不支持Alexa \n\n3 在Alexa中添加Skill并用智能锁APP的账号和密码进行授权。授权成功后就可以发现账号下的设备\n\n4 在Alexa app里找到锁开启语音开锁的功能并设置语言密码\n\n5 可以通过Alexa操作锁了"
"秒内不可使用面容开锁": "秒内不可使用面容开锁",
"密码需至少包含数字/字母/字符中的2种组合": "密码需至少包含数字/字母/字符中的2种组合"
} }

View File

@ -2,12 +2,14 @@ import 'dart:async';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:star_lock/app_settings/app_settings.dart';
import 'package:star_lock/login/forgetPassword/starLock_forgetPassword_state.dart'; import 'package:star_lock/login/forgetPassword/starLock_forgetPassword_state.dart';
import 'package:star_lock/login/login/entity/LoginEntity.dart'; import 'package:star_lock/login/login/entity/LoginEntity.dart';
import 'package:star_lock/login/register/entity/SendValidationCodeEntity.dart'; import 'package:star_lock/login/register/entity/SendValidationCodeEntity.dart';
import '../../network/api_repository.dart'; import '../../network/api_repository.dart';
import '../../tools/baseGetXController.dart'; import '../../tools/baseGetXController.dart';
import '../../tools/regularExpression.dart';
import '../../tools/showTipView.dart'; import '../../tools/showTipView.dart';
import '../register/entity/checkIP_entity.dart'; import '../register/entity/checkIP_entity.dart';
@ -33,6 +35,16 @@ class StarLockForgetPasswordLogic extends BaseGetXController {
} }
Future<void> resetPassword() async { Future<void> resetPassword() async {
if(state.pwd.value != state.surePwd.value){
showToast('两次密码不一致哦'.tr);
return;
}
if(!RegularExpression().validateString(state.pwd.value)){
showToast('密码需至少包含数字/字母/字符中的2种组合'.tr);
return;
}
final LoginEntity entity = await ApiRepository.to.resetPassword( final LoginEntity entity = await ApiRepository.to.resetPassword(
state.countryCode.value, state.countryCode.value,
state.phoneStr.value, state.phoneStr.value,
@ -82,7 +94,6 @@ class StarLockForgetPasswordLogic extends BaseGetXController {
}else{ }else{
state.codeType.value = '1'; state.codeType.value = '1';
} }
state.phoneStrIsOK.value = state.phoneStr.value.isNotEmpty;
} }
if (controller == state.pwdController) { if (controller == state.pwdController) {
state.pwd.value = controller.text; state.pwd.value = controller.text;
@ -93,10 +104,16 @@ class StarLockForgetPasswordLogic extends BaseGetXController {
if (controller == state.codeController) { if (controller == state.codeController) {
state.verificationCode.value = controller.text; state.verificationCode.value = controller.text;
} }
_resetCanSendCode();
_resetCanSub(); _resetCanSub();
AppLog.log('state.canSub.value:${state.canSub.value} state.pwdIsOK:${state.pwdIsOK} state.codeIsOK:${state.codeIsOK} state.phoneStr.value:${state.phoneStr.value}');
} }
void _resetCanSub() { void _resetCanSub() {
state.canSub.value = state.pwdIsOK && state.codeIsOK; state.canSub.value = state.pwdIsOK && state.codeIsOK && state.phoneStr.value.isNotEmpty;
}
void _resetCanSendCode() {
state.canSendCode.value = state.pwdIsOK && state.phoneStr.value.isNotEmpty;
} }
} }

View File

@ -185,7 +185,7 @@ class _StarLockForgetPasswordPageState
width: 10.w, width: 10.w,
), ),
Obx(() => GestureDetector( Obx(() => GestureDetector(
onTap: (state.phoneStrIsOK.value && state.canResend.value) onTap: (state.canSendCode.value && state.canResend.value)
? () async { ? () async {
// Navigator.pushNamed(context, Routers.safetyVerificationPage, arguments: {"countryCode":"+86", "account":state.phoneOrEmailStr.value}); // Navigator.pushNamed(context, Routers.safetyVerificationPage, arguments: {"countryCode":"+86", "account":state.phoneOrEmailStr.value});
final Object? result = await Navigator.pushNamed( final Object? result = await Navigator.pushNamed(
@ -204,7 +204,7 @@ class _StarLockForgetPasswordPageState
// height: 60.h, // height: 60.h,
padding: EdgeInsets.all(10.h), padding: EdgeInsets.all(10.h),
decoration: BoxDecoration( decoration: BoxDecoration(
color: state.phoneStrIsOK.value color: (state.canSendCode.value && state.canResend.value)
? AppColors.mainColor ? AppColors.mainColor
: AppColors.btnDisableColor, : AppColors.btnDisableColor,
borderRadius: BorderRadius.circular(5)), borderRadius: BorderRadius.circular(5)),

View File

@ -1,10 +1,15 @@
import 'package:flustars/flustars.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import '../../translations/trans_lib.dart'; import '../../translations/trans_lib.dart';
import '../selectCountryRegion/common/index.dart';
class StarLockForgetPasswordState { class StarLockForgetPasswordState {
StarLockForgetPasswordState() {
resetResend();
}
final TextEditingController phoneController = TextEditingController(); final TextEditingController phoneController = TextEditingController();
final TextEditingController pwdController = TextEditingController(); final TextEditingController pwdController = TextEditingController();
final TextEditingController sureController = TextEditingController(); final TextEditingController sureController = TextEditingController();
@ -14,30 +19,27 @@ class StarLockForgetPasswordState {
return DateTime.now().millisecondsSinceEpoch; return DateTime.now().millisecondsSinceEpoch;
} }
var countryCode = "86".obs; RxString countryCode = '86'.obs;
var countryName = '中国'.tr.obs; RxString countryName = '中国'.tr.obs;
var codeType = '2'.obs; // 1: 2: RxString codeType = '2'.obs; // 1: 2:
var pwd = ''.obs; RxString pwd = ''.obs;
var surePwd = ''.obs; RxString surePwd = ''.obs;
var verificationCode = ''.obs; RxString verificationCode = ''.obs;
var xWidth = ''.obs; // RxString xWidth = ''.obs; //
var canSub = false.obs; RxString phoneStr = ''.obs;
var phoneStr = ''.obs; RxBool canSub = false.obs;//
var phoneStrIsOK = false.obs; RxBool canSendCode = false.obs;//
var date = currentTimeMillis().toString().obs; RxString date = currentTimeMillis().toString().obs;
// bool get isEmail => RegexUtil.isEmail(phoneStr.value);
// bool get isIphone => RegexUtil.isMobileSimple(phoneStr.value); // bool get isIphone => RegexUtil.isMobileSimple(phoneStr.value);
bool get pwdIsOK => pwd.value.isNotEmpty && (pwd.value == surePwd.value); bool get pwdIsOK => pwd.value.isNotEmpty && surePwd.value.isNotEmpty && pwd.value.length >= 8 && surePwd.value.length >= 8;
bool get codeIsOK => verificationCode.value.isNotEmpty; bool get codeIsOK => verificationCode.value.isNotEmpty && verificationCode.value.length >= 6;
var canResend = false.obs; RxBool canResend = false.obs;//
var btnText = ''.obs; RxString btnText = ''.obs;
var totalSeconds = 120; int totalSeconds = 120;
var currentSecond = 120; int currentSecond = 120;
StarLockForgetPasswordState() {
resetResend();
}
void resetResend() { void resetResend() {
canResend.value = totalSeconds == currentSecond; canResend.value = totalSeconds == currentSecond;

View File

@ -143,7 +143,7 @@ class _StarLockForgetPasswordPageState
]), ]),
), ),
Obx(() => GestureDetector( Obx(() => GestureDetector(
onTap: (state.phoneStrIsOK.value && state.canResend.value) onTap: (state.canSendCode.value && state.canResend.value)
? () async { ? () async {
final Object? result = await Navigator.pushNamed( final Object? result = await Navigator.pushNamed(
context, Routers.safetyVerificationPage, context, Routers.safetyVerificationPage,
@ -159,11 +159,16 @@ class _StarLockForgetPasswordPageState
child: Container( child: Container(
width: 180.w, width: 180.w,
padding: EdgeInsets.all(10.h), padding: EdgeInsets.all(10.h),
decoration: BoxDecoration(
color: (state.canSendCode.value && state.canResend.value)
? AppColors.mainColor
: AppColors.btnDisableColor,
borderRadius: BorderRadius.circular(5)),
child: Center( child: Center(
child: Text(state.btnText.value, child: Text(state.btnText.value,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
color: AppColors.mainColor, color: Colors.white,
fontSize: 24.sp, fontSize: 24.sp,
)), )),
), ),

View File

@ -1,19 +1,20 @@
import 'dart:async'; import 'dart:async';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:star_lock/appRouters.dart'; import 'package:star_lock/appRouters.dart';
import 'package:star_lock/app_settings/app_settings.dart'; import 'package:star_lock/app_settings/app_settings.dart';
import 'package:star_lock/blue/blue_manage.dart'; import 'package:star_lock/blue/blue_manage.dart';
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart'; import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
import 'package:star_lock/login/login/entity/LoginEntity.dart'; import 'package:star_lock/login/login/entity/LoginEntity.dart';
import 'package:star_lock/login/register/entity/SendValidationCodeEntity.dart'; import 'package:star_lock/login/register/entity/SendValidationCodeEntity.dart';
import 'package:star_lock/tools/eventBusEventManage.dart'; import 'package:star_lock/tools/eventBusEventManage.dart';
import 'package:star_lock/tools/storage.dart';
import 'package:star_lock/tools/push/xs_jPhush.dart'; import 'package:star_lock/tools/push/xs_jPhush.dart';
import 'package:star_lock/tools/storage.dart';
import '../../network/api_repository.dart'; import '../../network/api_repository.dart';
import '../../tools/baseGetXController.dart'; import '../../tools/baseGetXController.dart';
import '../../tools/regularExpression.dart';
import '../../tools/showTipView.dart'; import '../../tools/showTipView.dart';
import 'entity/checkIP_entity.dart'; import 'entity/checkIP_entity.dart';
import 'starLock_register_state.dart'; import 'starLock_register_state.dart';
@ -40,12 +41,15 @@ class StarLockRegisterLogic extends BaseGetXController {
} }
Future<void> register() async { Future<void> register() async {
AppLog.log(
'state.pwd.value:${state.pwd.value} state.surePwd.value:${state.surePwd.value}');
if (state.pwd.value != state.surePwd.value) { if (state.pwd.value != state.surePwd.value) {
showToast('密码不一致哦'.tr); showToast('密码不一致哦'.tr);
return; return;
} }
if(!RegularExpression().validateString(state.pwd.value)){
showToast('密码需至少包含数字/字母/字符中的2种组合'.tr);
return;
}
final LoginEntity entity = await ApiRepository.to.register( final LoginEntity entity = await ApiRepository.to.register(
receiverType: state.isIphoneType.value == true ? 1 : 2, receiverType: state.isIphoneType.value == true ? 1 : 2,
countryCode: int.parse(state.countryCode.value), countryCode: int.parse(state.countryCode.value),
@ -101,7 +105,6 @@ class StarLockRegisterLogic extends BaseGetXController {
void changeInput(TextEditingController controller) { void changeInput(TextEditingController controller) {
if (controller == state.phoneOrEmailController) { if (controller == state.phoneOrEmailController) {
state.phoneOrEmailStr.value = controller.text; state.phoneOrEmailStr.value = controller.text;
state.phoneOrEmailStrIsOK.value = state.phoneOrEmailStr.value.isNotEmpty;
} }
if (controller == state.pwdController) { if (controller == state.pwdController) {
state.pwd.value = controller.text; state.pwd.value = controller.text;
@ -113,12 +116,17 @@ class StarLockRegisterLogic extends BaseGetXController {
state.verificationCode.value = controller.text; state.verificationCode.value = controller.text;
} }
_resetCanSub(); _resetCanSub();
_resetCanSendCode();
} }
//
void _resetCanSub() { void _resetCanSub() {
state.canSub.value = state.pwdIsOK && state.canSub.value = state.pwdIsOK && state.codeIsOK && state.phoneOrEmailStr.value.isNotEmpty;
state.codeIsOK && }
(state.isIphoneType.value ? state.isIphone : state.isEmail);
//
void _resetCanSendCode() {
state.canSendCode.value = state.pwdIsOK && state.phoneOrEmailStr.value.isNotEmpty;
} }
@override @override

View File

@ -295,7 +295,7 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
), ),
Obx(() => GestureDetector( Obx(() => GestureDetector(
onTap: onTap:
state.phoneOrEmailStrIsOK.value && state.canResend.value (state.canSendCode.value && state.canResend.value)
? () async { ? () async {
// Navigator.pushNamed(context, Routers.safetyVerificationPage, arguments: {"countryCode":"+86", "account":state.phoneOrEmailStr.value}); // Navigator.pushNamed(context, Routers.safetyVerificationPage, arguments: {"countryCode":"+86", "account":state.phoneOrEmailStr.value});
final Object? result = await Navigator.pushNamed( final Object? result = await Navigator.pushNamed(
@ -314,7 +314,7 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
// height: 60.h, // height: 60.h,
padding: EdgeInsets.all(10.h), padding: EdgeInsets.all(10.h),
decoration: BoxDecoration( decoration: BoxDecoration(
color: state.phoneOrEmailStrIsOK.value color: (state.canSendCode.value && state.canResend.value)
? AppColors.mainColor ? AppColors.mainColor
: Colors.grey, : Colors.grey,
borderRadius: BorderRadius.circular(5)), borderRadius: BorderRadius.circular(5)),

View File

@ -18,21 +18,22 @@ class StarLockRegisterState {
RxString countryName = '中国'.tr.obs; RxString countryName = '中国'.tr.obs;
RxString phoneOrEmailStr = ''.obs; RxString phoneOrEmailStr = ''.obs;
RxBool phoneOrEmailStrIsOK = false.obs; // RxBool phoneOrEmailStrIsOK = false.obs;
RxString pwd = ''.obs; RxString pwd = ''.obs;
RxString surePwd = ''.obs; RxString surePwd = ''.obs;
RxString verificationCode = ''.obs; RxString verificationCode = ''.obs;
RxString xWidth = ''.obs; // RxString xWidth = ''.obs; //
RxBool isIphoneType = true.obs; RxBool isIphoneType = true.obs;
RxBool canSub = false.obs; RxBool canSub = false.obs;//
RxBool agree = false.obs; RxBool agree = false.obs;
RxBool canSendCode = false.obs;//
bool get isEmail => RegexUtil.isEmail(phoneOrEmailStr.value); // bool get isEmail => RegexUtil.isEmail(phoneOrEmailStr.value);
bool get isIphone => RegexUtil.isMobileSimple(phoneOrEmailStr.value); // bool get isIphone => RegexUtil.isMobileSimple(phoneOrEmailStr.value);
bool get pwdIsOK => pwd.value.isNotEmpty && surePwd.value.isNotEmpty; bool get pwdIsOK => pwd.value.isNotEmpty && surePwd.value.isNotEmpty && pwd.value.length >= 8 && surePwd.value.length >= 8;
bool get codeIsOK => verificationCode.value.isNotEmpty; bool get codeIsOK => verificationCode.value.isNotEmpty && verificationCode.value.length >= 6 ;
RxBool canResend = false.obs; RxBool canResend = false.obs;//
RxString btnText = ''.obs; RxString btnText = ''.obs;
int totalSeconds = 120; int totalSeconds = 120;
int currentSecond = 120; int currentSecond = 120;

View File

@ -195,7 +195,7 @@ class _StarLockRegisterPageState extends State<StarLockRegisterXHJPage> {
), ),
Obx(() => GestureDetector( Obx(() => GestureDetector(
onTap: onTap:
state.phoneOrEmailStrIsOK.value && state.canResend.value (state.canSendCode.value && state.canResend.value)
? () async { ? () async {
// Navigator.pushNamed(context, Routers.safetyVerificationPage, arguments: {"countryCode":"+86", "account":state.phoneOrEmailStr.value}); // Navigator.pushNamed(context, Routers.safetyVerificationPage, arguments: {"countryCode":"+86", "account":state.phoneOrEmailStr.value});
if (state.pwd.value != state.surePwd.value) { if (state.pwd.value != state.surePwd.value) {
@ -214,13 +214,17 @@ class _StarLockRegisterPageState extends State<StarLockRegisterXHJPage> {
} }
: null, : null,
child: Container( child: Container(
color: Colors.transparent,
padding: EdgeInsets.all(10.h), padding: EdgeInsets.all(10.h),
decoration: BoxDecoration(
color: (state.canSendCode.value && state.canResend.value)
? AppColors.mainColor
: AppColors.btnDisableColor,
borderRadius: BorderRadius.circular(5)),
child: Center( child: Center(
child: Text(state.btnText.value, child: Text(state.btnText.value,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
color: AppColors.mainColor, color: Colors.white,
fontSize: 22.sp, fontSize: 22.sp,
)), )),
), ),

View File

@ -2,35 +2,48 @@ import 'dart:async';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:star_lock/login/login/entity/LoginEntity.dart';
import 'package:star_lock/mine/minePersonInfo/minePersonInfoResetPassword/minePersonInfoResetPassword_state.dart'; import 'package:star_lock/mine/minePersonInfo/minePersonInfoResetPassword/minePersonInfoResetPassword_state.dart';
import 'package:star_lock/network/api_repository.dart'; import 'package:star_lock/network/api_repository.dart';
import 'package:star_lock/tools/baseGetXController.dart'; import 'package:star_lock/tools/baseGetXController.dart';
import '../../../tools/regularExpression.dart';
class MinePersonInfoResetPasswordLogic extends BaseGetXController { class MinePersonInfoResetPasswordLogic extends BaseGetXController {
final MinePersonInfoResetPasswordState state = MinePersonInfoResetPasswordState(); final MinePersonInfoResetPasswordState state = MinePersonInfoResetPasswordState();
void changePasswordRequest() async { Future<void> changePasswordRequest() async {
if(state.newPwd.value.length < 8){ // if(state.newPwd.value.length < 8){
showToast("新密码长度不足8位"); // showToast('新密码长度不足8位');
// return;
// }
//
// if(state.surePwd.value.length < 8){
// showToast('确认长度不足8位');
// return;
// }
//
// if(state.surePwd.value != state.newPwd.value){
// showToast('两次密码不一致');
// return;
// }
if(state.newPwd.value != state.surePwd.value){
showToast('两次密码不一致哦'.tr);
return; return;
} }
if(state.surePwd.value.length < 8){ if(!RegularExpression().validateString(state.newPwd.value)){
showToast("确认长度不足8位"); showToast('密码需至少包含数字/字母/字符中的2种组合'.tr);
return; return;
} }
if(state.surePwd.value != state.newPwd.value){ final LoginEntity entity = await ApiRepository.to.changePassword(
showToast("两次密码不一致");
return;
}
var entity = await ApiRepository.to.changePassword(
state.date.value, state.date.value,
state.surePwd.value, state.surePwd.value,
state.oldPwd.value); state.oldPwd.value);
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
showToast("重置成功"); showToast('重置成功');
Get.back(); Get.back();
} }
} }
@ -53,6 +66,6 @@ class MinePersonInfoResetPasswordLogic extends BaseGetXController {
} }
void _resetCanSub() { void _resetCanSub() {
state.canSub.value = state.oldPwdIsOK && state.newPwdIsOK; state.canSub.value = state.oldPwdIsOK && state.newPwdIsOK && state.surePwdIsOK;
} }
} }

View File

@ -4,6 +4,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:star_lock/flavors.dart'; import 'package:star_lock/flavors.dart';
import 'package:star_lock/mine/minePersonInfo/minePersonInfoResetPassword/minePersonInfoResetPassword_logic.dart'; import 'package:star_lock/mine/minePersonInfo/minePersonInfoResetPassword/minePersonInfoResetPassword_logic.dart';
import 'package:star_lock/mine/minePersonInfo/minePersonInfoResetPassword/minePersonInfoResetPassword_state.dart';
import '../../../appRouters.dart'; import '../../../appRouters.dart';
import '../../../app_settings/app_colors.dart'; import '../../../app_settings/app_colors.dart';
@ -22,8 +23,8 @@ class MinePersonInfoResetPasswordPage extends StatefulWidget {
class _MinePersonInfoResetPasswordPageState class _MinePersonInfoResetPasswordPageState
extends State<MinePersonInfoResetPasswordPage> { extends State<MinePersonInfoResetPasswordPage> {
final logic = Get.put(MinePersonInfoResetPasswordLogic()); final MinePersonInfoResetPasswordLogic logic = Get.put(MinePersonInfoResetPasswordLogic());
final state = Get.find<MinePersonInfoResetPasswordLogic>().state; final MinePersonInfoResetPasswordState state = Get.find<MinePersonInfoResetPasswordLogic>().state;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -46,7 +47,7 @@ class _MinePersonInfoResetPasswordPageState
body: Container( body: Container(
margin: EdgeInsets.only(left: 30.w, right: 30.w), margin: EdgeInsets.only(left: 30.w, right: 30.w),
child: Column( child: Column(
children: [ children: <Widget>[
loginView(), loginView(),
SizedBox(height: 50.w), SizedBox(height: 50.w),
Obx(() => SubmitBtn( Obx(() => SubmitBtn(
@ -61,7 +62,7 @@ class _MinePersonInfoResetPasswordPageState
SizedBox(height: 40.w), SizedBox(height: 40.w),
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: <Widget>[
GestureDetector( GestureDetector(
child: SizedBox( child: SizedBox(
// width: 150.w, // width: 150.w,
@ -87,7 +88,7 @@ class _MinePersonInfoResetPasswordPageState
Widget loginView() { Widget loginView() {
Widget view = Column( Widget view = Column(
children: [ children: <Widget>[
LoginInput( LoginInput(
controller: state.oldPwdController, controller: state.oldPwdController,
onchangeAction: (textStr) { onchangeAction: (textStr) {
@ -99,7 +100,8 @@ class _MinePersonInfoResetPasswordPageState
style: TextStyle(fontSize: 22.sp), style: TextStyle(fontSize: 22.sp),
), ),
hintText: '', hintText: '',
inputFormatters: [ isLogin: true,
inputFormatters: <TextInputFormatter>[
LengthLimitingTextInputFormatter(20), LengthLimitingTextInputFormatter(20),
]), ]),
LoginInput( LoginInput(
@ -113,7 +115,8 @@ class _MinePersonInfoResetPasswordPageState
style: TextStyle(fontSize: 22.sp), style: TextStyle(fontSize: 22.sp),
), ),
hintText: '', hintText: '',
inputFormatters: [ isLogin: true,
inputFormatters: <TextInputFormatter>[
LengthLimitingTextInputFormatter(20), LengthLimitingTextInputFormatter(20),
]), ]),
LoginInput( LoginInput(
@ -128,7 +131,8 @@ class _MinePersonInfoResetPasswordPageState
style: TextStyle(fontSize: 22.sp), style: TextStyle(fontSize: 22.sp),
), ),
hintText: '', hintText: '',
inputFormatters: [ isLogin: true,
inputFormatters: <TextInputFormatter>[
LengthLimitingTextInputFormatter(20), LengthLimitingTextInputFormatter(20),
]), ]),
Container( Container(

View File

@ -10,15 +10,15 @@ class MinePersonInfoResetPasswordState {
return DateTime.now().millisecondsSinceEpoch; return DateTime.now().millisecondsSinceEpoch;
} }
var oldPwd = ''.obs; RxString oldPwd = ''.obs;
var newPwd = ''.obs; RxString newPwd = ''.obs;
var surePwd = ''.obs; RxString surePwd = ''.obs;
var canSub = false.obs; RxBool canSub = false.obs;
var date = currentTimeMillis().toString().obs; RxString date = currentTimeMillis().toString().obs;
bool get oldPwdIsOK => oldPwd.value.isNotEmpty; bool get oldPwdIsOK => oldPwd.value.isNotEmpty && oldPwd.value.length >= 8;
bool get newPwdIsOK => bool get newPwdIsOK => newPwd.value.isNotEmpty && newPwd.value.length >= 8;
newPwd.value.isNotEmpty && (newPwd.value == surePwd.value); bool get surePwdIsOK => surePwd.value.isNotEmpty && surePwd.value.length >= 8;
void onClose() {} void onClose() {}
} }

View File

@ -321,15 +321,16 @@ class _MineSetPageState extends State<MineSetPage>
Navigator.pushNamed( Navigator.pushNamed(
context, Routers.aPPUnlockNeedMobileNetworkingLockPage); context, Routers.aPPUnlockNeedMobileNetworkingLockPage);
}), }),
CommonItem( if(!F.isSKY)
leftTitel: '增值服务'.tr, CommonItem(
isHaveLine: true, leftTitel: '增值服务'.tr,
isHaveDirection: true, isHaveLine: true,
action: () { isHaveDirection: true,
Get.back(); action: () {
Get.toNamed(Routers.valueAddedServicesPage); Get.back();
}, Get.toNamed(Routers.valueAddedServicesPage);
), },
),
SizedBox( SizedBox(
height: 10.h, height: 10.h,
), ),

View File

@ -16,4 +16,26 @@ class RegularExpression {
r'https?:\/\/\S+', r'https?:\/\/\S+',
caseSensitive: false, caseSensitive: false,
); );
//
bool validateString(String value) {
//
RegExp regExpNum = RegExp(r'\d'); //
RegExp regExpLetter = RegExp(r'[a-zA-Z]'); //
RegExp regExpSymbol = RegExp(r'[!@#\$&*~]'); //
//
bool hasNum = regExpNum.hasMatch(value);
bool hasLetter = regExpLetter.hasMatch(value);
bool hasSymbol = regExpSymbol.hasMatch(value);
//
int count = 0;
if (hasNum) count++;
if (hasLetter) count++;
if (hasSymbol) count++;
// 2true
return count >= 2;
}
} }

View File

@ -28,6 +28,7 @@ class LoginInput extends StatefulWidget {
BlockStrCallback? onchangeAction; BlockStrCallback? onchangeAction;
BlockStrCallback? onSubmitted; BlockStrCallback? onSubmitted;
BlockClickCallback? onTapAction; BlockClickCallback? onTapAction;
bool? isLogin;// false
LoginInput({ LoginInput({
Key? key, Key? key,
@ -46,6 +47,7 @@ class LoginInput extends StatefulWidget {
this.onchangeAction, this.onchangeAction,
this.onTapAction, this.onTapAction,
this.onSubmitted, this.onSubmitted,
this.isLogin = false,
}) : super(key: key); }) : super(key: key);
@override @override
@ -123,7 +125,7 @@ class _LoginInputState extends State<LoginInput> {
if (isPwd) if (isPwd)
Padding( Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: F.sw(skyCall: () => 27.h, xhjCall: () => 39.h)), top: F.sw(skyCall: () => 27.h, xhjCall: () => widget.isLogin! ? 27.h : 39.h)),
child: Text( child: Text(
pwd, pwd,
style: TextStyle( style: TextStyle(