eunmi.kim 8 anni fa
parent
commit
ada0d72bad

+ 10 - 7
OneCable/Classes/AppDelegate.m

@@ -206,13 +206,15 @@
         [[JDFacade facade] alert:message];
         [[JDFacade facade] updateMainViewController];
         
-    } else if ([pushTypeCode isEqualToString:@"HOME_MEM_BAN"]) {//홈에서 강퇴됨
-        [[JDFacade facade] alert:message completionHander:^{
-            [[JDFacade facade] updateMainViewController];
-            [[JDFacade facade] requestPollingHomeHubStatus:nil];
-        }];
-        
-    }  else if ([pushTypeCode isEqualToString:@"HOME_MEM_SEL"]) {//홈에서 멤버가 탈퇴함
+    }
+//    else if ([pushTypeCode isEqualToString:@"HOME_MEM_BAN"]) {//홈에서 강퇴됨
+//        [[JDFacade facade] alert:message completionHander:^{
+//            [[JDFacade facade] updateMainViewController];
+//            [[JDFacade facade] requestPollingHomeHubStatus:nil];
+//        }];
+//        
+//    }
+    else if ([pushTypeCode isEqualToString:@"HOME_MEM_SEL"]) {//홈에서 멤버가 탈퇴함
         [[JDFacade facade] alert:message];
         [[JDFacade facade] updateMainViewController];
         
@@ -321,6 +323,7 @@
     }
     //계정 삭제 당함
     else if ( EQUALS(pushTypeCode, @"HOME_MEM_BAN") ) {
+        
         [[JDFacade facade] alertTitle:title message:message completionHander:^{
             
             [[JDFacade facade]logout];

+ 2 - 1
OneCable/Classes/ViewControllers/HomeMemberScreens/HomeMemberViewController.m

@@ -101,6 +101,7 @@
     [[NSNotificationCenter defaultCenter] removeObserver:self
                                                     name:kMasGradeNoti
                                                   object:nil];
+    
     [[NSNotificationCenter defaultCenter] addObserver:self
                                              selector:@selector(notichageGrade:)
                                                  name:kMasGradeNoti
@@ -728,7 +729,7 @@
 #pragma mark - noti
 -(void)notichageGrade:(NSNotification *)notification {
     
-    NSLog(@"noti : %@", notification);
+    NSLog(@"notichageGrade : %@\n%@\n\n", self.navigationController.viewControllers, notification);
     
     if (notification.object == nil) {
         //보낸 마스터 양도 완료

+ 37 - 14
OneCable/Classes/ViewControllers/MainScreens/LoginViewController.m

@@ -26,6 +26,7 @@
 #import "PwdPopupView.h"
 #import "QuizSetViewController.h"
 #import "TempPwViewController.h"
+#import "SettingsNumChangeViewController.h"
 
 //#import "MobilesOverViewController.h"
 //#import "InvitationListViewController.h"
@@ -276,13 +277,13 @@ ID / PW Input Box Text Color
 
         }
 
-        [self actionAfterLogin];
+         [self gotoMainView];
     }
 }
 
 //퀴즈 설정 메뉴 dismiss 시
 - (void)dismissQuizView {
-    [self actionAfterInvitaion];
+     [self gotoMainView];
 }
 
 //홈그룹 체크 및 대시보드 이동
@@ -296,11 +297,12 @@ ID / PW Input Box Text Color
     }
     
     if ([[JDFacade facade].loginUser.invitationsCount integerValue] > 0) {
-        [self actionForInvitation];
+        [[JDFacade facade] loadInvitationView];
         return;
     }
 
-    //임시 비밀번호 체크 후 이동
+    //로그인 성공 후
+    //1. 임시 비밀번호 발급 Y인 경우 체크 후 이동
     if ([JDFacade facade].loginUser.tempPasswordYn && [[JDFacade facade].loginUser.tempPasswordYn boolValue]) {
         
         TempPwViewController *vc = (TempPwViewController *)[CommonUtil instantiateViewControllerWithIdentifier:@"TempPwSetViewController" storyboardName:@"SignUp"];
@@ -308,21 +310,42 @@ ID / PW Input Box Text Color
         return;
     }
     
-    [self actionAfterInvitaion];
+    
+    //2.휴대폰 번호 유효성 체크후 이동
+    if ([JDFacade facade].loginUser.phoneAuthYn && ![[JDFacade facade].loginUser.phoneAuthYn boolValue]) {
+        
+        [self precessPhoneAuth];
+        return;
+    }
+    
+     [self gotoMainView];
 }
 
-//초대알림 화면으로 이동
-- (void)actionForInvitation {
-    [[JDFacade facade] loadInvitationView];
-}
 
-//초대화면 액션이 종료된 후,
-- (void)actionAfterInvitaion {
-    
-    //메인으로 이동
-    [self gotoMainView];
+- (void)precessPhoneAuth {
+    
+    [[JDFacade facade] confirmTitle:@"알림"
+                            message:@"현재 사용 중인 휴대폰 번호로 계정 정보를 업데이트 하세요. 휴대폰 번호를 재등록 하지 않으면 비밀번호 찾기를 할 수 없습니다."
+                         btnOKLabel:@"지금"
+                     btnCancelLabel:@"나중에"
+                         completion:^(CustomAlertView *alertView, NSInteger buttonIndex) {
+                             
+                             if (buttonIndex == 0) {
+                                 
+                                 SettingsNumChangeViewController *vc = (SettingsNumChangeViewController *)[CommonUtil instantiateViewControllerWithIdentifier:@"SettingsNumChangeViewController" storyboardName:@"Settings"];
+                                 vc.isPresente = YES;
+                                 vc.moveToMain = YES;
+                                 [self presentViewController:vc animated:YES completion:nil];
+                                 
+                             }
+                             else{
+                                 
+                                  [self gotoMainView];
+                             }
+                         }];
 }
 
+
 //새로운 단말 인증 필요 - 화면 이동
 - (void)actionForNeedsRegisteringNewDevice:(NSString *)nickname {
 

+ 1 - 0
OneCable/Classes/ViewControllers/SettingsScreens/SettingsNumChangeViewController.h

@@ -15,6 +15,7 @@
 @interface SettingsNumChangeViewController : JDViewController
 
 @property BOOL isPresente;
+@property BOOL moveToMain;
 @property (weak, nonatomic) IBOutlet CustomTextField *txtInputNum; // 번호 입력
 @property (weak, nonatomic) IBOutlet CustomTextField *txtInputAuthNum; //인증 번호 입력
 @property (weak, nonatomic) IBOutlet CustomButton *btnSend; // 인증번호 전송 버튼

+ 10 - 1
OneCable/Classes/ViewControllers/SettingsScreens/SettingsNumChangeViewController.m

@@ -99,7 +99,7 @@
         
             [JDFacade facade].loginUser.phoneAuthYn = @"Y";
             
-            [self dismissViewControllerAnimated:YES completion:nil];
+            [self gotoMainView];
         }
         else
             [[self navigationController] popViewControllerAnimated:YES];
@@ -200,4 +200,13 @@
 
 }
 
+
+- (void)gotoMainView {
+    
+    UIViewController *vc = [CommonUtil instantiateViewControllerWithIdentifier:@"MainViewController" storyboardName:@"Main"];
+    
+    [JDFacade facade].mainViewController = (MainViewController *)vc;
+    [[JDFacade facade].appDelegate.window setRootViewController:vc];
+}
+
 @end

+ 10 - 33
OneCable/Classes/ViewControllers/ThingsScreens/ThingsViewController.m

@@ -33,7 +33,6 @@
 #import "CustomTableView.h"
 #import "JYPullToRefreshController.h"
 #import "HomeMemberViewController.h"
-#import "SettingsNumChangeViewController.h"
 #import "HomeHubUpdateGuideViewController.h"
 #import "HomeHubUpdateStartViewController.h"
 #import "MultiHomeHubViewController.h"
@@ -129,7 +128,6 @@
     
     UIGestureRecognizer *_titleBarClick;
     
-    BOOL checkPhone;
     BOOL checkMaster;
     BOOL checkUpdate;
 }
@@ -148,7 +146,6 @@
 - (void)viewDidLoad {
     [super viewDidLoad];
     
-    checkPhone = YES ;
     checkMaster = YES ;
     checkUpdate = YES ;
     
@@ -353,7 +350,7 @@
 - (void)prepareViewDidLoadRefreshPopup:(BOOL)refresh {
 
     if (refresh) {
-        checkPhone = YES ;
+//        checkPhone = YES ;
         checkMaster = YES ;
         checkUpdate = YES ;
     }
@@ -392,16 +389,16 @@
 //        [JDFacade facade].loginUser.ctrtGrp.firmwareUpdateYn = @"Y";
    
     
-    //휴대폰 번호 유효성 체크
-    if (checkPhone && [JDFacade facade].loginUser.phoneAuthYn
-        && ![[JDFacade facade].loginUser.phoneAuthYn boolValue]) {
-   
-        checkPhone = NO;
-        //vc dissmiss 된 후에 띄워야함
-        [self performSelector:@selector(precessPhoneAuth) withObject:nil afterDelay:1.0f];
-    }
+//    //휴대폰 번호 유효성 체크
+//    if (checkPhone && [JDFacade facade].loginUser.phoneAuthYn
+//        && ![[JDFacade facade].loginUser.phoneAuthYn boolValue]) {
+//   
+//        checkPhone = NO;
+//        //vc dissmiss 된 후에 띄워야함
+//        [self performSelector:@selector(precessPhoneAuth) withObject:nil afterDelay:1.0f];
+//    }
     //마스터 권한 양도 수락
-    else if(checkMaster && ctrtGrp != nil && [ctrtGrp.masterTransferPopupYn boolValue]) {
+    if(checkMaster && ctrtGrp != nil && [ctrtGrp.masterTransferPopupYn boolValue]) {
 
         checkMaster = NO;
         [self performSelector:@selector(precessMasterTransfer) withObject:nil afterDelay:1.0f];
@@ -416,26 +413,6 @@
 }
 
 
-- (void)precessPhoneAuth {
-    
-    [[JDFacade facade] confirmTitle:@"알림"
-                            message:@"현재 사용 중인 휴대폰 번호로 계정 정보를 업데이트 하세요. 휴대폰 번호를 재등록 하지 않으면 비밀번호 찾기를 할 수 없습니다."
-                         btnOKLabel:@"지금"
-                     btnCancelLabel:@"나중에"
-                         completion:^(CustomAlertView *alertView, NSInteger buttonIndex) {
-
-                             if (buttonIndex == 0) {
-                                 
-                                 SettingsNumChangeViewController *vc = (SettingsNumChangeViewController *)[CommonUtil instantiateViewControllerWithIdentifier:@"SettingsNumChangeViewController" storyboardName:@"Settings"];
-                                 vc.isPresente = YES;
-                                 [self presentViewController:vc animated:YES completion:nil];
-                             }
-                             else {
-                                 
-                                 [self checkProcess];
-                             }
-                         }];
-}
 
 - (void)precessMasterTransfer {