From 91e2b047eb93e985674d043f746f9f50e155d790 Mon Sep 17 00:00:00 2001 From: CodeST <694468528@qq.com> Date: Wed, 3 Dec 2025 16:48:25 +0800 Subject: [PATCH] 5 --- keyBoard/Class/Login/VC/KBEmailRegistVC.m | 21 ++++++++++++++++---- keyBoard/Class/Login/VC/KBRegistVerEmailVC.h | 3 +++ keyBoard/Class/Login/VC/KBRegistVerEmailVC.m | 4 ++-- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/keyBoard/Class/Login/VC/KBEmailRegistVC.m b/keyBoard/Class/Login/VC/KBEmailRegistVC.m index 4364ce5..4289c44 100644 --- a/keyBoard/Class/Login/VC/KBEmailRegistVC.m +++ b/keyBoard/Class/Login/VC/KBEmailRegistVC.m @@ -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]; diff --git a/keyBoard/Class/Login/VC/KBRegistVerEmailVC.h b/keyBoard/Class/Login/VC/KBRegistVerEmailVC.h index 67c2241..c02aee5 100644 --- a/keyBoard/Class/Login/VC/KBRegistVerEmailVC.h +++ b/keyBoard/Class/Login/VC/KBRegistVerEmailVC.h @@ -11,6 +11,9 @@ NS_ASSUME_NONNULL_BEGIN @interface KBRegistVerEmailVC : BaseViewController +/// 注册时用于邮箱验证的邮箱地址,由上一个页面(KBEmailRegistVC)传入。 +@property (nonatomic, copy) NSString *email; + @end NS_ASSUME_NONNULL_END diff --git a/keyBoard/Class/Login/VC/KBRegistVerEmailVC.m b/keyBoard/Class/Login/VC/KBRegistVerEmailVC.m index 89166dd..b1b8bf4 100644 --- a/keyBoard/Class/Login/VC/KBRegistVerEmailVC.m +++ b/keyBoard/Class/Login/VC/KBRegistVerEmailVC.m @@ -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;