1
This commit is contained in:
@@ -8,6 +8,9 @@
|
||||
#import "KBEmailLoginVC.h"
|
||||
#import "KBEmailRegistVC.h"
|
||||
#import "KBForgetPwdVC.h"
|
||||
#import "KBLoginVM.h"
|
||||
#import "AppDelegate.h"
|
||||
#import "BaseTabBarController.h"
|
||||
@interface KBEmailLoginVC () <UITextViewDelegate, UITextFieldDelegate>
|
||||
|
||||
// 背景与顶部装饰
|
||||
@@ -41,6 +44,7 @@
|
||||
@property (nonatomic, strong) UITextView *agreementTextView;
|
||||
@property (nonatomic, strong) UILabel *accountTipLabel; // “Don't Have An Account?”
|
||||
@property (nonatomic, strong) UIButton *signUpButton; // “Sign Up”
|
||||
@property (nonatomic, strong) KBLoginVM *loginVM; // Confirm
|
||||
|
||||
@end
|
||||
|
||||
@@ -49,6 +53,7 @@
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// 与登录/注册页一致:隐藏通用导航栏,使用自定义背景 + 返回按钮
|
||||
self.loginVM = [[KBLoginVM alloc] init];
|
||||
self.kb_enableCustomNavBar = NO;
|
||||
self.view.backgroundColor = [UIColor whiteColor];
|
||||
[self kb_addTapToDismissKeyboard];
|
||||
@@ -217,8 +222,27 @@
|
||||
|
||||
- (void)onTapSubmit {
|
||||
KBLOG(@"KBEmailLoginVC onTapSubmit, email=%@, pwdLen=%zd",
|
||||
self.emailTextField.text,
|
||||
self.emailTextField.text,
|
||||
self.passwordTextField.text.length);
|
||||
NSString *email = self.emailTextField.text ? self.emailTextField.text : @"";
|
||||
NSString *password = self.passwordTextField.text ? self.passwordTextField.text : @"";
|
||||
|
||||
[self.loginVM emailLoginEmail:email password:password WithCompletion:^(BOOL success, NSError * _Nullable error) {
|
||||
if (success) {
|
||||
id<UIApplicationDelegate> appDelegate = UIApplication.sharedApplication.delegate;
|
||||
if ([appDelegate respondsToSelector:@selector(setupRootVC)]) {
|
||||
AppDelegate *delegate = (AppDelegate *)appDelegate;
|
||||
// [delegate toMainTabbarVC];
|
||||
delegate.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
|
||||
delegate.window.backgroundColor = [UIColor whiteColor];
|
||||
[delegate.window makeKeyAndVisible];
|
||||
UIViewController *rootVC = nil;
|
||||
rootVC = [[BaseTabBarController alloc] init];
|
||||
delegate.window.rootViewController = rootVC;
|
||||
}
|
||||
}
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
- (void)onTapForgotPassword {
|
||||
|
||||
Reference in New Issue
Block a user