Commit 645017624d83f43ce79a63ffd82d53cf19a50415

Authored by biao
1 parent e6a08b82

修复 忘记密码时可以输入手机号

lib/pages/home/widgets/BaseHomeHeaderWidget.dart
@@ -103,7 +103,7 @@ class BaseHomeHeaderWidget extends StatelessWidget { @@ -103,7 +103,7 @@ class BaseHomeHeaderWidget extends StatelessWidget {
103 // 图片和文本之间的间隔 103 // 图片和文本之间的间隔
104 UserUtil.hasPermission() 104 UserUtil.hasPermission()
105 ? Text('还剩${UserUtil.getRemainingValidity()}天') 105 ? Text('还剩${UserUtil.getRemainingValidity()}天')
106 - : const Text('已过期'), 106 + : const Text('未购买'),
107 ]), 107 ]),
108 )), 108 )),
109 ScreenUtil().bottomBarHeight.horizontalSpace, 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,6 +16,13 @@ class ForgetPwdHomeBloc extends Bloc<ForgetPwdHomeEvent, ForgetPwdHomeState> {
16 bool _canSetPwd = false; 16 bool _canSetPwd = false;
17 17
18 bool get canSetPwd => _canSetPwd; 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 final TextEditingController phoneNumController = 27 final TextEditingController phoneNumController =
21 TextEditingController(text: UserUtil.getUser()?.phoneNum); 28 TextEditingController(text: UserUtil.getUser()?.phoneNum);
lib/pages/login/forgetpwd/forget_password_home_page.dart
@@ -93,14 +93,19 @@ class _ForgetPasswordHomePageView extends StatelessWidget { @@ -93,14 +93,19 @@ class _ForgetPasswordHomePageView extends StatelessWidget {
93 Expanded( 93 Expanded(
94 child: TextFieldCustomerWidget( 94 child: TextFieldCustomerWidget(
95 height: 50.h, 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 textInputType: TextInputType.phone, 106 textInputType: TextInputType.phone,
102 bgImageName: 'Input_layer_up', 107 bgImageName: 'Input_layer_up',
103 - enabel: false, 108 + enabel: bloc.enableInputPhone,
104 controller: bloc.phoneNumController, 109 controller: bloc.phoneNumController,
105 )) 110 ))
106 ], 111 ],