5
This commit is contained in:
@@ -259,11 +259,24 @@
|
||||
}
|
||||
|
||||
- (void)onTapSubmit {
|
||||
// 后续接入具体注册/登录逻辑
|
||||
KBLOG(@"onTapSubmit email=%@, password length=%zd",
|
||||
self.emailTextField.text,
|
||||
self.passwordTextField.text.length);
|
||||
// 校验基础表单后,进入邮箱验证码验证页
|
||||
NSString *email = [self.emailTextField.text ?: @"" stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
|
||||
NSString *pwd = self.passwordTextField.text ?: @"";
|
||||
NSString *repeat = self.repeatPasswordTextField.text ?: @"";
|
||||
|
||||
if (email.length == 0 || pwd.length == 0 || repeat.length == 0) {
|
||||
[KBHUD showInfo:KBLocalized(@"Please complete all fields")];
|
||||
return;
|
||||
}
|
||||
if (![pwd isEqualToString:repeat]) {
|
||||
[KBHUD showInfo:KBLocalized(@"The two passwords do not match")];
|
||||
return;
|
||||
}
|
||||
|
||||
KBLOG(@"onTapSubmit email=%@, password length=%zd", email, pwd.length);
|
||||
|
||||
KBRegistVerEmailVC *vc = [[KBRegistVerEmailVC alloc] init];
|
||||
vc.email = email;
|
||||
UINavigationController *nav = KB_CURRENT_NAV;
|
||||
if ([nav isKindOfClass:[BaseNavigationController class]]) {
|
||||
[(BaseNavigationController *)nav kb_pushViewControllerRemovingSameClass:vc animated:YES];
|
||||
|
||||
@@ -11,6 +11,9 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface KBRegistVerEmailVC : BaseViewController
|
||||
|
||||
/// 注册时用于邮箱验证的邮箱地址,由上一个页面(KBEmailRegistVC)传入。
|
||||
@property (nonatomic, copy) NSString *email;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -149,8 +149,8 @@
|
||||
|
||||
// 这里用 %@ 预留邮箱地址占位
|
||||
NSString *template = KBLocalized(@"We have already sent it to the email address %@. Please enter the 6-digit verification code from the email to verify your mailbox.");
|
||||
// 默认先用一个占位邮箱,外部可以根据真实邮箱重新设置
|
||||
NSString *email = @"example@mail.com";
|
||||
// 使用上个页面传入的邮箱;若为空则使用占位邮箱
|
||||
NSString *email = self.email.length > 0 ? self.email : @"example@mail.com";
|
||||
_descLabel.text = [NSString stringWithFormat:template, email];
|
||||
}
|
||||
return _descLabel;
|
||||
|
||||
Reference in New Issue
Block a user