apple 6 jaren geleden
bovenliggende
commit
52d903cdeb

+ 1 - 1
ios/JianYuIOS/JianYuIOS.xcodeproj/xcuserdata/apple.xcuserdatad/xcschemes/JianYuIOS.xcscheme

@@ -85,7 +85,7 @@
          <EnvironmentVariable
             key = "OS_ACTIVITY_MODE"
             value = "disable"
-            isEnabled = "NO">
+            isEnabled = "YES">
          </EnvironmentVariable>
       </EnvironmentVariables>
       <AdditionalOptions>

BIN
ios/JianYuIOS/JianYuIOS.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate


+ 32 - 0
ios/JianYuIOS/JianYuIOS.xcworkspace/xcuserdata/apple.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -35,5 +35,37 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "JianYuIOS/Classes&#xff08;&#x6a21;&#x5757;&#xff09;/JYMineViewController.m"
+            timestampString = "563443315.552611"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "277"
+            endingLineNumber = "277"
+            landmarkName = "-loginOut:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "JianYuIOS/AppDelegate.m"
+            timestampString = "563442116.880715"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "407"
+            endingLineNumber = "407"
+            landmarkName = "-networkDidReceiveMessage:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
 </Bucket>

+ 2 - 0
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYExpViewController.h

@@ -10,4 +10,6 @@
 
 @interface JYExpViewController : UIViewController
 
+-(void)dealTabBar;
+
 @end

+ 10 - 2
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYExpViewController.m

@@ -281,6 +281,7 @@ NSString *const AesKey_2 = @"mGlAgnIBB8bx2nch";
 }
 
 - (void)hideTabBar {
+    kMainQueue(^{
     if (self.tabBarController.tabBar.hidden == YES) {
         return;
     }
@@ -291,9 +292,10 @@ NSString *const AesKey_2 = @"mGlAgnIBB8bx2nch";
         contentView = [self.tabBarController.view.subviews objectAtIndex:0];
     contentView.frame = CGRectMake(contentView.bounds.origin.x,  contentView.bounds.origin.y,  contentView.bounds.size.width, contentView.bounds.size.height + self.tabBarController.tabBar.frame.size.height);
     self.tabBarController.tabBar.hidden = YES;
-    
+    });
 }
 - (void)showTabBar{
+    kMainQueue(^{
     if (self.tabBarController.tabBar.hidden == NO)
     {
         return;
@@ -308,10 +310,16 @@ NSString *const AesKey_2 = @"mGlAgnIBB8bx2nch";
         contentView = [self.tabBarController.view.subviews objectAtIndex:0];
     contentView.frame = CGRectMake(contentView.bounds.origin.x, contentView.bounds.origin.y,  contentView.bounds.size.width, contentView.bounds.size.height - self.tabBarController.tabBar.frame.size.height);
     self.tabBarController.tabBar.hidden = NO;
+        
+        });
 }
 
 
-
+-(void)dealTabBar
+{
+    NSLog(@"刷新第二个页面");
+    [self webViewFirstRequest];
+}
 
 -(void)judgeIsHidden
 {

+ 2 - 0
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYMineViewController.h

@@ -10,4 +10,6 @@
 
 @interface JYMineViewController : UIViewController
 
+-(void)dealTabBar;
+
 @end

+ 11 - 2
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYMineViewController.m

@@ -287,6 +287,8 @@ NSString *const AesKey_3 = @"mGlAgnIBB8bx2nch";
 }
 
 - (void)hideTabBar {
+    
+    kMainQueue(^{
     if (self.tabBarController.tabBar.hidden == YES) {
         return;
     }
@@ -297,9 +299,11 @@ NSString *const AesKey_3 = @"mGlAgnIBB8bx2nch";
         contentView = [self.tabBarController.view.subviews objectAtIndex:0];
     contentView.frame = CGRectMake(contentView.bounds.origin.x,  contentView.bounds.origin.y,  contentView.bounds.size.width, contentView.bounds.size.height + self.tabBarController.tabBar.frame.size.height);
     self.tabBarController.tabBar.hidden = YES;
-    
+    });
 }
 - (void)showTabBar{
+    
+    kMainQueue(^{
     if (self.tabBarController.tabBar.hidden == NO)
     {
         return;
@@ -314,9 +318,14 @@ NSString *const AesKey_3 = @"mGlAgnIBB8bx2nch";
         contentView = [self.tabBarController.view.subviews objectAtIndex:0];
     contentView.frame = CGRectMake(contentView.bounds.origin.x, contentView.bounds.origin.y,  contentView.bounds.size.width, contentView.bounds.size.height - self.tabBarController.tabBar.frame.size.height);
     self.tabBarController.tabBar.hidden = NO;
+        });
 }
 
-
+-(void)dealTabBar
+{
+    NSLog(@"刷新第二个页面");
+    [self webViewFirstRequest];
+}
 
 -(void)judgeIsHidden
 {

+ 3 - 0
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYSearchViewController.h

@@ -10,4 +10,7 @@
 
 @interface JYSearchViewController : UIViewController
 
+
+-(void)dealTabBar;
+
 @end

+ 59 - 4
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYSearchViewController.m

@@ -36,9 +36,12 @@ JSExportAs(getCipherText, -(NSString *)jsGGetCipherText:(NSString *)phone);
 
 JSExportAs(business, -(NSInteger)jsBusiness:(NSInteger)shooID shopType:(NSInteger )shopType);
 
-JSExportAs(hiddenBottom, -(void)jsHiddenBottom:(NSString*)hidden);
 
 
+//新增
+JSExportAs(hiddenBottom, -(void)jsHiddenBottom:(NSString*)hidden);
+
+JSExportAs(loginSuccess, -(void)jsLoginSuccess:(NSString*)status);
 
 @end
 
@@ -48,7 +51,7 @@ JSExportAs(hiddenBottom, -(void)jsHiddenBottom:(NSString*)hidden);
     CGPoint startTouch;
     BOOL _isMoving;
     
-    
+    NSInteger pushIndex;
 }
 
 
@@ -284,12 +287,16 @@ NSString *const AesKey_0 = @"mGlAgnIBB8bx2nch";
     [self jsRemoveUserToken:nil];
 }
 
-
+//前往登录页面
 -(void)isLoginTabBar:(NSNotification *)notification
 {
     NSDictionary *dict = notification.userInfo;
     //
     NSLog(@"我从第几个页面过来:%@",dict[@"item_index"]);
+    pushIndex = [dict[@"item_index"] integerValue];
+
+    
+    
     
     
     //
@@ -297,9 +304,52 @@ NSString *const AesKey_0 = @"mGlAgnIBB8bx2nch";
     url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
     [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
     
+    
+    
+    
+//    NSString *index = [NSString stringWithFormat:@"%ld",pushIndex];
+//    [[NSNotificationCenter defaultCenter] postNotificationName:@"isLoginTabBar" object:nil userInfo:@{@"item_index":index}];
+    
 }
 
+
+//js方法登录成功
+-(void)jsLoginSuccess:(NSString*)status
+{
+    NSLog(@"登录成功提示");
+    if([status isEqualToString:@"S"]) {
+//        NSString *index = [NSString stringWithFormat:@"%ld",pushIndex];
+//        [[NSNotificationCenter defaultCenter] postNotificationName:@"isLoginTabBar" object:nil userInfo:@{@"item_index":@"0"}];
+        //搜索页面过来  我刷新
+        
+        
+        if(pushIndex!=0) {
+            //tabbar点击登录
+            NSString *index = [NSString stringWithFormat:@"%ld",pushIndex];
+            [[NSNotificationCenter defaultCenter] postNotificationName:@"changeItems" object:nil userInfo:@{@"item_index":index}];
+            pushIndex = 0;
+        }else {
+            [self.webView reload];
+        }
+    }else if ([status isEqualToString:@""]) {
+        //手动tabbar点击
+        NSString *index = [NSString stringWithFormat:@"%ld",pushIndex];
+        [[NSNotificationCenter defaultCenter] postNotificationName:@"changeItems" object:nil userInfo:@{@"item_index":index}];
+        pushIndex = 0;
+    }else {
+        
+    }
+}
+
+-(void)dealTabBar
+{
+    
+}
+
+
 - (void)hideTabBar {
+    
+    kMainQueue(^{
     if (self.tabBarController.tabBar.hidden == YES) {
         return;
     }
@@ -310,9 +360,10 @@ NSString *const AesKey_0 = @"mGlAgnIBB8bx2nch";
         contentView = [self.tabBarController.view.subviews objectAtIndex:0];
     contentView.frame = CGRectMake(contentView.bounds.origin.x,  contentView.bounds.origin.y,  contentView.bounds.size.width, contentView.bounds.size.height + self.tabBarController.tabBar.frame.size.height);
     self.tabBarController.tabBar.hidden = YES;
-    
+    });
 }
 - (void)showTabBar{
+    kMainQueue(^{
     if (self.tabBarController.tabBar.hidden == NO)
     {
         return;
@@ -327,6 +378,7 @@ NSString *const AesKey_0 = @"mGlAgnIBB8bx2nch";
         contentView = [self.tabBarController.view.subviews objectAtIndex:0];
     contentView.frame = CGRectMake(contentView.bounds.origin.x, contentView.bounds.origin.y,  contentView.bounds.size.width, contentView.bounds.size.height - self.tabBarController.tabBar.frame.size.height);
     self.tabBarController.tabBar.hidden = NO;
+    });
 }
 
 -(void)jsHiddenBottom:(NSString *)hidden
@@ -581,17 +633,20 @@ NSString *const AesKey_0 = @"mGlAgnIBB8bx2nch";
 
 // 登录时获取到令牌 并保存
 -(void)jsSaveUserToken:(NSString *)token{
+    NSLog(@"登陆成功");
     [[LXViewControllerManager shareViewControllerManager] hideHud];
     [LXUserDefaults saveToken:token];
 }
 
 // 取本地的用户令牌
 -(NSString *)jsGetUserToken:(NSString *)str{
+    NSLog(@"取用户token");
     return [LXUserDefaults token];
 }
 
 // 退出时 清空用户数据
 -(void)jsRemoveUserToken:(NSString *)str{
+    NSLog(@"清除用户token");
     [LXUserDefaults clearAll];
     //    [[LXDataBaseManager shareDataBaseManager] clearAll];
     

+ 2 - 0
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYSubViewController.h

@@ -10,4 +10,6 @@
 
 @interface JYSubViewController : UIViewController
 
+-(void)dealTabBar;
+
 @end

+ 12 - 0
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYSubViewController.m

@@ -279,6 +279,7 @@ NSString *const AesKey_1 = @"mGlAgnIBB8bx2nch";
 }
 
 - (void)hideTabBar {
+    kMainQueue(^{
     if (self.tabBarController.tabBar.hidden == YES) {
         return;
     }
@@ -289,9 +290,12 @@ NSString *const AesKey_1 = @"mGlAgnIBB8bx2nch";
         contentView = [self.tabBarController.view.subviews objectAtIndex:0];
     contentView.frame = CGRectMake(contentView.bounds.origin.x,  contentView.bounds.origin.y,  contentView.bounds.size.width, contentView.bounds.size.height + self.tabBarController.tabBar.frame.size.height);
     self.tabBarController.tabBar.hidden = YES;
+        
+        });
     
 }
 - (void)showTabBar{
+    kMainQueue(^{
     if (self.tabBarController.tabBar.hidden == NO)
     {
         return;
@@ -306,9 +310,17 @@ NSString *const AesKey_1 = @"mGlAgnIBB8bx2nch";
         contentView = [self.tabBarController.view.subviews objectAtIndex:0];
     contentView.frame = CGRectMake(contentView.bounds.origin.x, contentView.bounds.origin.y,  contentView.bounds.size.width, contentView.bounds.size.height - self.tabBarController.tabBar.frame.size.height);
     self.tabBarController.tabBar.hidden = NO;
+        
+        });
 }
 
+//
 
+-(void)dealTabBar
+{
+    NSLog(@"刷新第二个页面");
+    [self webViewFirstRequest];
+}
 
 -(void)judgeIsHidden
 {   

+ 32 - 2
ios/JianYuIOS/JianYuIOS/JYTabBarController.m

@@ -64,12 +64,14 @@
     self.tabBarController.tabBar.delegate = self;
     [self setUpAllChildVc];
     [self setSelectedIndex:0];
+    
+    [self switchRootViewController];
 }
 
 
 //判断是否跳转
 - (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController{
-//    NSLog(@"点击了第几个item:%ld",tabBarController.tabBar.selectedItem.tag);
+    NSLog(@"点击了第几个item:%ld",tabBarController.tabBar.selectedItem.tag);
     if (![LXUserDefaults token]) {
         NSString *index = [NSString stringWithFormat:@"%ld",tabBarController.tabBar.selectedItem.tag];
         [[NSNotificationCenter defaultCenter] postNotificationName:@"isLoginTabBar" object:nil userInfo:@{@"item_index":index}];
@@ -136,8 +138,36 @@
 }
 
 
+#pragma mark - 根控制器的切换
+-(void)switchRootViewController
+{
+   [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeItems:) name:@"changeItems" object:nil];
+}
 
-
+-(void)changeItems:(NSNotification *)notification
+{
+    
+    NSLog(@"收到改变tabbar的通知");
+    NSDictionary *dict = notification.userInfo;
+    NSInteger index = [dict[@"item_index"] integerValue];
+    [self setSelectedIndex:index];
+    
+//    [self.V1 dealTabBar];
+//    [self.V1 dealTabBar];
+//    [self.V1 dealTabBar];
+//    [self.V1 dealTabBar];
+    
+    if(index==1) {
+        [self.V2 dealTabBar];
+    }else if (index==2) {
+        [self.V3 dealTabBar];
+    }else if (index==3) {
+        [self.V4 dealTabBar];
+    }else {
+        
+    }
+    
+}
 - (void)didReceiveMemoryWarning {
     [super didReceiveMemoryWarning];
     // Dispose of any resources that can be recreated.