46 lines
1.4 KiB
Dart
Executable File
46 lines
1.4 KiB
Dart
Executable File
import 'package:flutter/material.dart';
|
||
import 'package:get/get.dart';
|
||
import 'package:star_lock/login/login/entity/LoginData.dart';
|
||
|
||
class SafeVerifyState {
|
||
|
||
SafeVerifyState() {
|
||
resetResend();
|
||
}
|
||
final TextEditingController codeController = TextEditingController();
|
||
|
||
static int currentTimeMillis() {
|
||
return DateTime.now().millisecondsSinceEpoch;
|
||
}
|
||
|
||
RxString countryCode = '+86'.obs;
|
||
RxString countryId = '9'.obs;
|
||
RxString codeType = '5'.obs; // //1注册,2找回密码,3绑定手机号,4解绑手机(换绑),5删除账号,6 绑定邮箱,7解绑邮箱(换绑)
|
||
RxString verificationCode = ''.obs;
|
||
RxString xWidth = ''.obs; // 滑动验证码滑动位置
|
||
RxBool canSub = false.obs;
|
||
RxString date = currentTimeMillis().toString().obs;
|
||
RxString accountStr = ''.obs;
|
||
RxString toggleStr = ''.obs; //可切换字眼
|
||
RxBool isToggle = false.obs; //是否点击切换
|
||
RxString channel = '1'.obs; //短信通道 1 短信,2 邮箱
|
||
|
||
bool get codeIsOK => verificationCode.value.isNotEmpty;
|
||
|
||
RxBool canResend = false.obs;
|
||
RxString btnText = ''.obs;
|
||
int totalSeconds = 120;
|
||
int currentSecond = 120;
|
||
|
||
final Rx<LoginData> loginData = LoginData().obs;
|
||
|
||
void resetResend() {
|
||
canResend.value = totalSeconds == currentSecond;
|
||
btnText.value = !canResend.value
|
||
? '$currentSecond s'
|
||
: btnText.value = '获取验证码'.tr;
|
||
}
|
||
|
||
void onClose() {}
|
||
}
|