Commit 685e9641 authored by skeyboy's avatar skeyboy

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

parent b72d1fa9
......@@ -26,6 +26,7 @@ class SignInController extends GetxController {
RxBool codeEnable = false.obs;
RxBool checkBox = false.obs;
RxBool loginBtnEable = false.obs;
RxString codeTileStr = "获取验证码".obs;
/// 倒计时的计时器。
late Timer _timer;
......@@ -176,11 +177,13 @@ class SignInController extends GetxController {
_seconds = 60;
verifyStr.value = '重新发送';
codeEnable.value = true;
codeTileStr.value = "重新发送验证码";
return;
}
_seconds--;
verifyStr.value = '已发送$_seconds' + 's';
codeTileStr.value = "${_seconds}s后重试";
codeEnable.value = false;
_seconds--;
});
}
......
......@@ -590,7 +590,9 @@ class SignInPage extends GetView<SignInController> {
}
Widget buildAndroidSigin(BuildContext buildContext) {
return GestureDetector(
return WillPopScope(onWillPop: () async{
return false;
},child: GestureDetector(
behavior: HitTestBehavior.translucent,
onTap: () => Focus.of(buildContext).unfocus(),
child: SingleChildScrollView(
......@@ -711,11 +713,11 @@ class SignInPage extends GetView<SignInController> {
Flexible(child: Container()),
GestureDetector(
onTap: () => controller.chageCodeStatus(),
child: const Text(
"获取验证码",
style: TextStyle(
child: Obx(()=>Text(
controller.codeTileStr.value,
style: const TextStyle(
color: Colors.white54, fontSize: 12),
),
)),
)
],
),
......@@ -752,8 +754,7 @@ class SignInPage extends GetView<SignInController> {
),
),
),
);
),);
// return GestureDetector(
// behavior: HitTestBehavior.translucent,
// 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