由sms切换阿里短信验证码,去除语音验证码

This commit is contained in:
kai60
2021-07-03 22:27:05 +08:00
parent 3f5ee249b5
commit 6f07bde049
7 changed files with 113 additions and 79 deletions
@@ -239,13 +239,13 @@ extern BOOL formLogIn;
}
- (IBAction)qrcodeSwithBtnClicked:(UIButton *)sender {
if ([[self.timeBtn titleForState:UIControlStateNormal] isEqualToString:@"语音验证码"]) {
[self.timeBtn setTitle:@"短信验证码" forState:UIControlStateNormal];
self.qrcodeSwitchLbl.text = @"语音验证码";
} else if ([[self.timeBtn titleForState:UIControlStateNormal] isEqualToString:@"短信验证码"]) {
[self.timeBtn setTitle:@"语音验证码" forState:UIControlStateNormal];
self.qrcodeSwitchLbl.text = @"短信验证码";
}
// if ([[self.timeBtn titleForState:UIControlStateNormal] isEqualToString:@"语音验证码"]) {
// [self.timeBtn setTitle:@"短信验证码" forState:UIControlStateNormal];
// self.qrcodeSwitchLbl.text = @"语音验证码";
// } else if ([[self.timeBtn titleForState:UIControlStateNormal] isEqualToString:@"短信验证码"]) {
// [self.timeBtn setTitle:@"语音验证码" forState:UIControlStateNormal];
// self.qrcodeSwitchLbl.text = @"短信验证码";
// }
}
#pragma mark-设置键盘样式
@@ -447,35 +447,54 @@ extern BOOL formLogIn;
btn.userInteractionEnabled=NO;
btn.backgroundColor=[UIColor lightGrayColor];
[SMSSDK commitVerificationCode:self.verifyTextField.text phoneNumber:self.phoneNumberTextField.text zone:self.areaCode result:^(NSError *error) {
{
if (!error)
{
NSLog(@"验证成功");
if (self.isBind)
{
[self bindPhone];
}
else
{
[self ifishAddUser];
}
}
else
if ([self.verifyTextField.text isEqualToString:_verifyData])
{
if (self.isBind)
{
NSLog(@"错误信息:%@",error);
NSString *str =@"验证码验证失败";
[self.view makeToast:str];
btn.userInteractionEnabled=YES;
btn.backgroundColor=COLOR_LABEL_TITLE;
[self bindPhone];
}
else
{
[self ifishAddUser];
}
}
}
}];
}
else
{
NSString *str =@"验证码验证失败";
[self.view makeToast:str];
btn.userInteractionEnabled=YES;
btn.backgroundColor=COLOR_LABEL_TITLE;
}
// [SMSSDK commitVerificationCode:self.verifyTextField.text phoneNumber:self.phoneNumberTextField.text zone:self.areaCode result:^(NSError *error) {
//
// {
// if (!error)
// {
//
// NSLog(@"验证成功");
// if (self.isBind)
// {
// [self bindPhone];
// }
// else
// {
// [self ifishAddUser];
// }
//
//
// }
// else
// {
// NSLog(@"错误信息:%@",error);
// NSString *str =@"验证码验证失败";
// [self.view makeToast:str];
// btn.userInteractionEnabled=YES;
// btn.backgroundColor=COLOR_LABEL_TITLE;
//
// }
// }
// }];
}
@@ -754,9 +773,10 @@ extern BOOL formLogIn;
}
- (IBAction)verifyBtn:(id)sender {
// [self timeFire];
//阿里验证码
[self timeFire];
[self getVerifycode];
// [self getVerifycode];
}
-(void)showTitle:(NSString*)title messsage:(NSString*)message{