修改手机验证码触发逻辑
This commit is contained in:
parent
ea869e7b42
commit
431a19b043
|
|
@ -90,12 +90,12 @@
|
||||||
GIGA_ShowToast(@"请输入正确手机号");
|
GIGA_ShowToast(@"请输入正确手机号");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
btn.userInteractionEnabled = NO;
|
|
||||||
[self startTimer:btn];
|
|
||||||
[self sendVerifiCode:btn];
|
[self sendVerifiCode:btn];
|
||||||
}
|
}
|
||||||
-(void)startTimer:(UIButton *)btn{
|
-(void)startTimer:(UIButton *)btn{
|
||||||
|
|
||||||
|
btn.userInteractionEnabled = NO;
|
||||||
if (_time>0) {
|
if (_time>0) {
|
||||||
_timer = [NSTimer scheduledTimerWithTimeInterval:1 count:60 callback:^{
|
_timer = [NSTimer scheduledTimerWithTimeInterval:1 count:60 callback:^{
|
||||||
NSString *timeStr=[NSString stringWithFormat:@"%lds",(long)self->_time];
|
NSString *timeStr=[NSString stringWithFormat:@"%lds",(long)self->_time];
|
||||||
|
|
@ -128,7 +128,9 @@
|
||||||
[api requstDataWithResult:^(GiGaAPIResult *result) {
|
[api requstDataWithResult:^(GiGaAPIResult *result) {
|
||||||
[MBProgressHUD hideHUDForView:self.view animated:YES];
|
[MBProgressHUD hideHUDForView:self.view animated:YES];
|
||||||
GILog(@"短信获取%@",result.message);
|
GILog(@"短信获取%@",result.message);
|
||||||
btn.userInteractionEnabled = YES;
|
if (result.success) {
|
||||||
|
[self startTimer:btn];
|
||||||
|
}
|
||||||
}];
|
}];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -79,17 +79,13 @@
|
||||||
GIGA_ShowToast(@"请输入正确手机号");
|
GIGA_ShowToast(@"请输入正确手机号");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
btn.userInteractionEnabled = NO;
|
|
||||||
|
|
||||||
[self startTimer:btn];
|
|
||||||
[self requstCode:btn];
|
[self requstCode:btn];
|
||||||
}
|
}
|
||||||
|
|
||||||
//计时
|
//计时
|
||||||
-(void)startTimer:(UIButton *)btn{
|
-(void)startTimer:(UIButton *)btn{
|
||||||
|
btn.userInteractionEnabled = NO;
|
||||||
if (_time>0) {
|
if (_time>0) {
|
||||||
_timer = [NSTimer scheduledTimerWithTimeInterval:1 count:60 callback:^{
|
_timer = [NSTimer scheduledTimerWithTimeInterval:1 count:60 callback:^{
|
||||||
NSString *timeStr=[NSString stringWithFormat:@"%lds",(long)self->_time];
|
NSString *timeStr=[NSString stringWithFormat:@"%lds",(long)self->_time];
|
||||||
|
|
@ -123,10 +119,12 @@
|
||||||
NSDictionary *params = @{@"mobile":self.phoneNumberTextField.text};
|
NSDictionary *params = @{@"mobile":self.phoneNumberTextField.text};
|
||||||
GiGaBaseAPiRequest *requst = [GiGaBaseAPiRequest initWithRequestPath:@"msg/sms/v1/retrievesendcode" method:RequestPostMethod parms:params];
|
GiGaBaseAPiRequest *requst = [GiGaBaseAPiRequest initWithRequestPath:@"msg/sms/v1/retrievesendcode" method:RequestPostMethod parms:params];
|
||||||
[requst requstDataWithResult:^(GiGaAPIResult *result) {
|
[requst requstDataWithResult:^(GiGaAPIResult *result) {
|
||||||
btn.userInteractionEnabled = YES;
|
|
||||||
[self.view hideToastActivity];
|
[self.view hideToastActivity];
|
||||||
GIGA_ShowToast(result.message);
|
GIGA_ShowToast(result.message);
|
||||||
|
if (result.success) {
|
||||||
|
//成功后再开始倒计时
|
||||||
|
[self startTimer:btn];
|
||||||
|
}
|
||||||
}];
|
}];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue