Browse Source

未登录跳转登录

apple 6 years ago
parent
commit
65d6df8276

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


+ 18 - 0
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYSearchViewController.m

@@ -93,6 +93,9 @@ NSString *const AesKey_0 = @"mGlAgnIBB8bx2nch";
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(netReachChanged:) name:AFNetworkingReachabilityDidChangeNotification object:nil];
 
     
+    //前往登录通知-tabbar
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(isLoginTabBar:) name:@"isLoginTabBar" object:nil];
+    
     UIPanGestureRecognizer *recognizer = [[UIPanGestureRecognizer alloc]initWithTarget:self action:@selector(paningGestureReceive:)];
     [recognizer delaysTouchesBegan];
     [self.view addGestureRecognizer:recognizer];
@@ -282,6 +285,20 @@ NSString *const AesKey_0 = @"mGlAgnIBB8bx2nch";
 }
 
 
+-(void)isLoginTabBar:(NSNotification *)notification
+{
+    NSDictionary *dict = notification.userInfo;
+    //
+    NSLog(@"我从第几个页面过来:%@",dict[@"item_index"]);
+    
+    
+    //
+    NSString *url = [NSString stringWithFormat:@"%@%@", kHost, @"jyapp/free/login"];
+    url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+    
+}
+
 - (void)hideTabBar {
     if (self.tabBarController.tabBar.hidden == YES) {
         return;
@@ -362,6 +379,7 @@ NSString *const AesKey_0 = @"mGlAgnIBB8bx2nch";
     [self doSomeWithLoadUrl:url];
 }
 
+//15737190152
 -(void)doSomeWithLoadUrl:(NSString *)url{
     if (!url) {
         return;

+ 1 - 1
ios/JianYuIOS/JianYuIOS/JYTabBarController.m

@@ -72,7 +72,7 @@
 //    NSLog(@"点击了第几个item:%ld",tabBarController.tabBar.selectedItem.tag);
     if (![LXUserDefaults token]) {
         NSString *index = [NSString stringWithFormat:@"%ld",tabBarController.tabBar.selectedItem.tag];
-        [[NSNotificationCenter defaultCenter] postNotificationName:@"isLogin" object:nil userInfo:@{@"item_index":index}];
+        [[NSNotificationCenter defaultCenter] postNotificationName:@"isLoginTabBar" object:nil userInfo:@{@"item_index":index}];
         return NO;
     }
     return YES;