id登录去掉限制手机号 去掉了一些rac的点击时间的监听

This commit is contained in:
fengshuo
2021-11-30 16:58:00 +08:00
committed by zu
parent dd303d1176
commit e552c39856
17 changed files with 243 additions and 277 deletions

View File

@@ -103,28 +103,9 @@
}
- (void)initEvents {
@weakify(self);
RAC(self.nextButton, enabled) = [[RACSignal combineLatest:@[self.phoneView.textField.rac_textSignal, self.codeView.textField.rac_textSignal] reduce:^id _Nonnull(NSString *phone, NSString* password){
return @((phone.length ==11) && password.length >= 6);
return @((phone.length > 0) && password.length >= 6);
}] takeUntil:self.rac_willDeallocSignal];
[[self.forgetPasswordButton rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(__kindof UIControl * _Nullable x) {
@strongify(self);
LoginForgetPasswordViewController * forgetPasswordVC = [[LoginForgetPasswordViewController alloc] init];
[self.navigationController pushViewController:forgetPasswordVC animated:YES];
}];
///
[[self.nextButton rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(__kindof UIControl * _Nullable x) {
@strongify(self);
[self.presenter loginWithPhone:self.phoneView.textField.text password:self.codeView.textField.text];
}];
///
[[self.codeLoginButton rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(__kindof UIControl * _Nullable x) {
@strongify(self);
[self.navigationController popViewControllerAnimated:YES];
}];
}
- (void)disMissVC {
@@ -141,6 +122,20 @@
[self disMissVC];
}
#pragma mark - Event Response
- (void)forgetPasswordButtonAction:(UIButton *)sender {
LoginForgetPasswordViewController * forgetPasswordVC = [[LoginForgetPasswordViewController alloc] init];
[self.navigationController pushViewController:forgetPasswordVC animated:YES];
}
- (void)nextButtonAction:(UIButton *)sender {
[self.presenter loginWithPhone:self.phoneView.textField.text password:self.codeView.textField.text];
}
- (void)codeLoginButtonAction:(UIButton *)sender {
[self.navigationController popViewControllerAnimated:YES];
}
#pragma mark - Getters And Setters
- (UIButton *)nextButton {
if (!_nextButton) {
@@ -156,6 +151,7 @@
UIImage *image = [UIImage gradientColorImageFromColors:@[[ThemeColor confirmButtonGradientStartColor],[ThemeColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)];
[_nextButton setBackgroundImage:image forState:UIControlStateNormal];
[_nextButton setTitleColor:[ThemeColor confirmButtonTextColor] forState:UIControlStateDisabled];
[_nextButton addTarget:self action:@selector(nextButtonAction:) forControlEvents:UIControlEventTouchUpInside];
}
return _nextButton;
}
@@ -165,7 +161,8 @@
_codeLoginButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_codeLoginButton setTitle:@"验证码登录" forState:UIControlStateNormal];
[_codeLoginButton setTitleColor:[ThemeColor mainTextColor] forState:UIControlStateNormal];
_codeLoginButton.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Bold" size:15];;
_codeLoginButton.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Bold" size:15];
[_codeLoginButton addTarget:self action:@selector(codeLoginButtonAction:) forControlEvents:UIControlEventTouchUpInside];
}
return _codeLoginButton;
}
@@ -176,7 +173,8 @@
_forgetPasswordButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_forgetPasswordButton setTitle:@"忘记密码?" forState:UIControlStateNormal];
[_forgetPasswordButton setTitleColor:[ThemeColor mainTextColor] forState:UIControlStateNormal];
_forgetPasswordButton.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Regular" size:11];;
_forgetPasswordButton.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Regular" size:11];
[_forgetPasswordButton addTarget:self action:@selector(forgetPasswordButtonAction:) forControlEvents:UIControlEventTouchUpInside];
}
return _forgetPasswordButton;
}