|
|
@ -41,9 +41,11 @@ class _LoginPageState extends State<LoginPage> {
|
|
|
|
late TextEditingController _phoneController;
|
|
|
|
late TextEditingController _phoneController;
|
|
|
|
late TextEditingController _smsCodeController;
|
|
|
|
late TextEditingController _smsCodeController;
|
|
|
|
late FocusNode _phoneFocusNode;
|
|
|
|
late FocusNode _phoneFocusNode;
|
|
|
|
|
|
|
|
|
|
|
|
late FocusNode _smsCodeFocusNode;
|
|
|
|
late FocusNode _smsCodeFocusNode;
|
|
|
|
bool _cantSelected = false;
|
|
|
|
bool _cantSelected = false;
|
|
|
|
DateTime? _lastTap;
|
|
|
|
DateTime? _lastTap;
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
super.initState();
|
|
|
@ -130,26 +132,27 @@ class _LoginPageState extends State<LoginPage> {
|
|
|
|
} else if (!_chooseAgreement) {
|
|
|
|
} else if (!_chooseAgreement) {
|
|
|
|
BotToast.showText(text: "请同意并勾选隐私政策");
|
|
|
|
BotToast.showText(text: "请同意并勾选隐私政策");
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if(_lastTap != null &&DateTime.now().difference(_lastTap!).inSeconds < 2){
|
|
|
|
if (_lastTap != null &&
|
|
|
|
|
|
|
|
DateTime.now().difference(_lastTap!).inSeconds < 2) {
|
|
|
|
// BotToast.showText(text: "过快");
|
|
|
|
// BotToast.showText(text: "过快");
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_lastTap = DateTime.now();
|
|
|
|
_lastTap = DateTime.now();
|
|
|
|
var base = await apiClient.request(API.app.login,
|
|
|
|
var base = await apiClient.request(API.app.login, data: {
|
|
|
|
data: {'phone': _phoneController.text, 'code': _smsCodeController.text});
|
|
|
|
'phone': _phoneController.text,
|
|
|
|
|
|
|
|
'code': _smsCodeController.text
|
|
|
|
|
|
|
|
});
|
|
|
|
if (base.code == 0) {
|
|
|
|
if (base.code == 0) {
|
|
|
|
print("123123${base.data['token']}");
|
|
|
|
print("123123${base.data['token']}");
|
|
|
|
await UserTool.userProvider.setToken(base.data['token']);
|
|
|
|
await UserTool.userProvider.setToken(base.data['token']);
|
|
|
|
// print(a);
|
|
|
|
// print(a);
|
|
|
|
// print("4567899");
|
|
|
|
// print("4567899");
|
|
|
|
Get.offAll(const TabNavigator());
|
|
|
|
Get.offAll(const TabNavigator());
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
else {
|
|
|
|
|
|
|
|
CloudToast.show(base.msg);
|
|
|
|
CloudToast.show(base.msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
text: "立即登录",
|
|
|
|
text: "立即登录",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
32.hb,
|
|
|
|
32.hb,
|
|
|
@ -223,8 +226,10 @@ class _LoginPageState extends State<LoginPage> {
|
|
|
|
await apiClient.request(API.app.captcha, data: {
|
|
|
|
await apiClient.request(API.app.captcha, data: {
|
|
|
|
'phone': _phoneController.text,
|
|
|
|
'phone': _phoneController.text,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
var res= RegExp( r'^((13[0-9])|(14[0-9])|(15[0-9])|(16[0-9])|(17[0-9])|(18[0-9])|(19[0-9]))\d{8}$');
|
|
|
|
var res = RegExp(
|
|
|
|
if((_phoneController.text).isNotEmpty && res.hasMatch(_phoneController.text)){
|
|
|
|
r'^((13[0-9])|(14[0-9])|(15[0-9])|(16[0-9])|(17[0-9])|(18[0-9])|(19[0-9]))\d{8}$');
|
|
|
|
|
|
|
|
if ((_phoneController.text).isNotEmpty &&
|
|
|
|
|
|
|
|
res.hasMatch(_phoneController.text)) {
|
|
|
|
_beginCountDown();
|
|
|
|
_beginCountDown();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
BotToast.showText(text: "手机号不能为空且手机号格式错误");
|
|
|
|
BotToast.showText(text: "手机号不能为空且手机号格式错误");
|
|
|
@ -311,6 +316,7 @@ class _LoginPageState extends State<LoginPage> {
|
|
|
|
Get.to(() => const ContentAuthorityPage());
|
|
|
|
Get.to(() => const ContentAuthorityPage());
|
|
|
|
// print("点击协议了");
|
|
|
|
// print("点击协议了");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
///跳转到用户协议页面
|
|
|
|
///跳转到用户协议页面
|
|
|
|
};
|
|
|
|
};
|
|
|
|
return recognizer;
|
|
|
|
return recognizer;
|
|
|
@ -336,12 +342,11 @@ class _LoginPageState extends State<LoginPage> {
|
|
|
|
: const Icon(CupertinoIcons.checkmark_circle,
|
|
|
|
: const Icon(CupertinoIcons.checkmark_circle,
|
|
|
|
size: 18, color: Colors.blue),
|
|
|
|
size: 18, color: Colors.blue),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
|
|
RichText(
|
|
|
|
RichText(
|
|
|
|
text: TextSpan(
|
|
|
|
text: TextSpan(
|
|
|
|
text: "我已阅读并同意",
|
|
|
|
text: "我已阅读并同意",
|
|
|
|
style: TextStyle(
|
|
|
|
style:
|
|
|
|
color: BaseStyle.colorcccccc, fontSize: 12 * 2.sp),
|
|
|
|
TextStyle(color: BaseStyle.colorcccccc, fontSize: 12 * 2.sp),
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
// TextSpan(
|
|
|
|
// TextSpan(
|
|
|
|
// text: '《用户服务协议》',
|
|
|
|
// text: '《用户服务协议》',
|
|
|
@ -356,7 +361,9 @@ class _LoginPageState extends State<LoginPage> {
|
|
|
|
text: '《短信帮手隐私协议》',
|
|
|
|
text: '《短信帮手隐私协议》',
|
|
|
|
style: TextStyle(color: kPrimaryColor, fontSize: 12 * 2.sp),
|
|
|
|
style: TextStyle(color: kPrimaryColor, fontSize: 12 * 2.sp),
|
|
|
|
recognizer: _recognizer(context, 2)),
|
|
|
|
recognizer: _recognizer(context, 2)),
|
|
|
|
]))
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|