Commit 645017624d83f43ce79a63ffd82d53cf19a50415
1 parent
e6a08b82
修复 忘记密码时可以输入手机号
Showing
3 changed files
with
19 additions
and
7 deletions
lib/pages/home/widgets/BaseHomeHeaderWidget.dart
| ... | ... | @@ -103,7 +103,7 @@ class BaseHomeHeaderWidget extends StatelessWidget { |
| 103 | 103 | // 图片和文本之间的间隔 |
| 104 | 104 | UserUtil.hasPermission() |
| 105 | 105 | ? Text('还剩${UserUtil.getRemainingValidity()}天') |
| 106 | - : const Text('已过期'), | |
| 106 | + : const Text('未购买'), | |
| 107 | 107 | ]), |
| 108 | 108 | )), |
| 109 | 109 | ScreenUtil().bottomBarHeight.horizontalSpace, | ... | ... |
lib/pages/login/forgetpwd/bloc/forget_pwd_home_bloc.dart
| ... | ... | @@ -16,6 +16,13 @@ class ForgetPwdHomeBloc extends Bloc<ForgetPwdHomeEvent, ForgetPwdHomeState> { |
| 16 | 16 | bool _canSetPwd = false; |
| 17 | 17 | |
| 18 | 18 | bool get canSetPwd => _canSetPwd; |
| 19 | + bool get enableInputPhone { | |
| 20 | + if (UserUtil.getUser() == null) { | |
| 21 | + return true; | |
| 22 | + } else { | |
| 23 | + return UserUtil.getUser()!.phoneNum.isEmpty; | |
| 24 | + } | |
| 25 | + } | |
| 19 | 26 | |
| 20 | 27 | final TextEditingController phoneNumController = |
| 21 | 28 | TextEditingController(text: UserUtil.getUser()?.phoneNum); | ... | ... |
lib/pages/login/forgetpwd/forget_password_home_page.dart
| ... | ... | @@ -93,14 +93,19 @@ class _ForgetPasswordHomePageView extends StatelessWidget { |
| 93 | 93 | Expanded( |
| 94 | 94 | child: TextFieldCustomerWidget( |
| 95 | 95 | height: 50.h, |
| 96 | - textStyle: TextStyle( | |
| 97 | - fontWeight: FontWeight.w500, | |
| 98 | - color: const Color(0xFF999999), | |
| 99 | - fontSize: 21.sp, | |
| 100 | - ), | |
| 96 | + textStyle: !bloc.enableInputPhone | |
| 97 | + ? TextStyle( | |
| 98 | + fontWeight: FontWeight.w500, | |
| 99 | + color: const Color(0xFF999999), | |
| 100 | + fontSize: 21.sp, | |
| 101 | + ) | |
| 102 | + : TextStyle( | |
| 103 | + color: const Color(0xFF333333), | |
| 104 | + fontSize: 16.sp, | |
| 105 | + ), | |
| 101 | 106 | textInputType: TextInputType.phone, |
| 102 | 107 | bgImageName: 'Input_layer_up', |
| 103 | - enabel: false, | |
| 108 | + enabel: bloc.enableInputPhone, | |
| 104 | 109 | controller: bloc.phoneNumController, |
| 105 | 110 | )) |
| 106 | 111 | ], | ... | ... |