Commit 685e9641 authored by skeyboy's avatar skeyboy

登录页验证码倒计时/登录页禁用Android侧滑返回

parent b72d1fa9
...@@ -26,6 +26,7 @@ class SignInController extends GetxController { ...@@ -26,6 +26,7 @@ class SignInController extends GetxController {
RxBool codeEnable = false.obs; RxBool codeEnable = false.obs;
RxBool checkBox = false.obs; RxBool checkBox = false.obs;
RxBool loginBtnEable = false.obs; RxBool loginBtnEable = false.obs;
RxString codeTileStr = "获取验证码".obs;
/// 倒计时的计时器。 /// 倒计时的计时器。
late Timer _timer; late Timer _timer;
...@@ -176,11 +177,13 @@ class SignInController extends GetxController { ...@@ -176,11 +177,13 @@ class SignInController extends GetxController {
_seconds = 60; _seconds = 60;
verifyStr.value = '重新发送'; verifyStr.value = '重新发送';
codeEnable.value = true; codeEnable.value = true;
codeTileStr.value = "重新发送验证码";
return; return;
} }
_seconds--;
verifyStr.value = '已发送$_seconds' + 's'; verifyStr.value = '已发送$_seconds' + 's';
codeTileStr.value = "${_seconds}s后重试";
codeEnable.value = false; codeEnable.value = false;
_seconds--;
}); });
} }
......
...@@ -590,7 +590,9 @@ class SignInPage extends GetView<SignInController> { ...@@ -590,7 +590,9 @@ class SignInPage extends GetView<SignInController> {
} }
Widget buildAndroidSigin(BuildContext buildContext) { Widget buildAndroidSigin(BuildContext buildContext) {
return GestureDetector( return WillPopScope(onWillPop: () async{
return false;
},child: GestureDetector(
behavior: HitTestBehavior.translucent, behavior: HitTestBehavior.translucent,
onTap: () => Focus.of(buildContext).unfocus(), onTap: () => Focus.of(buildContext).unfocus(),
child: SingleChildScrollView( child: SingleChildScrollView(
...@@ -711,11 +713,11 @@ class SignInPage extends GetView<SignInController> { ...@@ -711,11 +713,11 @@ class SignInPage extends GetView<SignInController> {
Flexible(child: Container()), Flexible(child: Container()),
GestureDetector( GestureDetector(
onTap: () => controller.chageCodeStatus(), onTap: () => controller.chageCodeStatus(),
child: const Text( child: Obx(()=>Text(
"获取验证码", controller.codeTileStr.value,
style: TextStyle( style: const TextStyle(
color: Colors.white54, fontSize: 12), color: Colors.white54, fontSize: 12),
), )),
) )
], ],
), ),
...@@ -752,8 +754,7 @@ class SignInPage extends GetView<SignInController> { ...@@ -752,8 +754,7 @@ class SignInPage extends GetView<SignInController> {
), ),
), ),
), ),
); ),);
// return GestureDetector( // return GestureDetector(
// behavior: HitTestBehavior.translucent, // behavior: HitTestBehavior.translucent,
// onTap: () => FocusScope.of(buildContext).unfocus(), // onTap: () => FocusScope.of(buildContext).unfocus(),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment