app-starlock/lib/mine/minePersonInfo/minePersonInfoResetPassword/minePersonInfoResetPassword_page.dart
魏少阳 918df59662 1、修改锁详情-记录模块无记录时不上传
2、开完锁上传记录添加password字段
3、修复锁列表单次电子钥匙过期状态不显示问题
4、修复重置密码提交按钮置灰时能点击问题
5、修复我的模块客服不显示问题
2024-09-24 09:55:54 +08:00

173 lines
6.1 KiB
Dart
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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 'package:star_lock/mine/minePersonInfo/minePersonInfoResetPassword/minePersonInfoResetPassword_logic.dart';
import 'package:star_lock/mine/minePersonInfo/minePersonInfoResetPassword/minePersonInfoResetPassword_state.dart';
import '../../../appRouters.dart';
import '../../../app_settings/app_colors.dart';
import '../../../main/lockMian/lockMain/lockMain_logic.dart';
import '../../../tools/submitBtn.dart';
import '../../../tools/tf_loginInput.dart';
import '../../../tools/titleAppBar.dart';
import '../../../translations/trans_lib.dart';
class MinePersonInfoResetPasswordPage extends StatefulWidget {
const MinePersonInfoResetPasswordPage({Key? key}) : super(key: key);
@override
State<MinePersonInfoResetPasswordPage> createState() =>
_MinePersonInfoResetPasswordPageState();
}
class _MinePersonInfoResetPasswordPageState
extends State<MinePersonInfoResetPasswordPage> {
final MinePersonInfoResetPasswordLogic logic = Get.put(MinePersonInfoResetPasswordLogic());
final MinePersonInfoResetPasswordState state = Get.find<MinePersonInfoResetPasswordLogic>().state;
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.mainBackgroundColor,
appBar: F.sw(
skyCall: () => TitleAppBar(
barTitle: '重置密码'.tr,
haveBack: true,
backgroundColor: AppColors.mainColor,
),
xhjCall: () => TitleAppBar(
barTitle: '重置密码'.tr,
haveBack: true,
backgroundColor: Colors.white,
iconColor: AppColors.blackColor,
titleColor: AppColors.blackColor,
),
),
body: Container(
margin: EdgeInsets.only(left: 30.w, right: 30.w),
child: Column(
children: <Widget>[
loginView(),
SizedBox(height: 50.w),
Obx(() => SubmitBtn(
btnName: TranslationLoader.lanKeys!.save!.tr,
fontSize: 30.sp,
borderRadius: 20.w,
isDisabled: state.canSub.value,
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
onClick: state.canSub.value ? () async {
final bool isNetWork =
await LockMainLogic.to()?.judgeTheNetwork() ??
false;
if (!isNetWork) {
return;
}
logic.changePasswordRequest();
} : null
)),
SizedBox(height: 40.w),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
GestureDetector(
child: SizedBox(
// width: 150.w,
height: 60.h,
// color: Colors.red,
child: Center(
child: Text(
'${TranslationLoader.lanKeys!.forgetPassword!.tr}',
style: TextStyle(
color: AppColors.mainColor, fontSize: 18.sp)),
),
),
onTap: () {
Get.toNamed(Routers.starLockForgetPasswordPage);
},
)
],
),
],
),
));
}
Widget loginView() {
Widget view = Column(
children: <Widget>[
LoginInput(
controller: state.oldPwdController,
onchangeAction: (textStr) {
logic.changeInput(state.oldPwdController);
},
isPwd: true,
leftWidget: Text(
'${TranslationLoader.lanKeys!.originalPassword!.tr} ',
style: TextStyle(fontSize: 22.sp),
),
hintText: '',
isLogin: true,
inputFormatters: <TextInputFormatter>[
LengthLimitingTextInputFormatter(20),
]),
LoginInput(
controller: state.newPwdController,
onchangeAction: (textStr) {
logic.changeInput(state.newPwdController);
},
isPwd: true,
leftWidget: Text(
'${TranslationLoader.lanKeys!.newPassword!.tr} ',
style: TextStyle(fontSize: 22.sp),
),
hintText: '',
isLogin: true,
inputFormatters: <TextInputFormatter>[
LengthLimitingTextInputFormatter(20),
]),
LoginInput(
controller: state.surePwdController,
onchangeAction: (textStr) {
logic.changeInput(state.surePwdController);
},
isPwd: true,
// isHaveLeftWidget: false,
leftWidget: Text(
'${'确认密码'.tr} ',
style: TextStyle(fontSize: 22.sp),
),
hintText: '',
isLogin: true,
inputFormatters: <TextInputFormatter>[
LengthLimitingTextInputFormatter(20),
]),
Container(
width: 1.sw,
padding: EdgeInsets.only(top: 15.h, bottom: 10.h),
child: Text(TranslationLoader.lanKeys!.registerPasswordTip!.tr,
style: TextStyle(
fontSize: 18.w, color: AppColors.darkGrayTextColor))),
],
);
view = F.sw(
skyCall: () => view,
xhjCall: () => Container(
margin: EdgeInsets.only(
top: 20.h,
),
padding: EdgeInsets.all(16.r),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(20.r))),
child: ClipRRect(
borderRadius: BorderRadius.circular(20.r),
child: view,
),
));
return view;
}
}