Эх сурвалжийг харах

测试通知跳转tabbar红点

apple 6 жил өмнө
parent
commit
1f5b00ed8a

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


+ 6 - 0
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYExpViewController.m

@@ -244,6 +244,12 @@ NSString *const AesKey_2 = @"mGlAgnIBB8bx2nch";
     NSString * urlStr = [NSString stringWithFormat:@"%@",infoDict[@"url"]];
     
     if (urlStr) {
+        
+        if(self.tabBarController.selectedIndex != 2) {
+            return;
+        }else {
+            [[NSNotificationCenter defaultCenter] postNotificationName:@"refreshMine" object:nil];;
+        }
         [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
         self.afterOpenPushMessage = YES;
         

+ 16 - 0
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYMineViewController.m

@@ -102,6 +102,10 @@ NSString *const AesKey_3 = @"mGlAgnIBB8bx2nch";
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadWebView) name:kReloadWebVIew object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(loginOut:) name:kLoginOut object:nil];
     
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(refreshMine:) name:@"refreshMine" object:nil];
+   
+    
+    
     [[AFNetworkReachabilityManager sharedManager] startMonitoring];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(netReachChanged:) name:AFNetworkingReachabilityDidChangeNotification object:nil];
     
@@ -113,6 +117,8 @@ NSString *const AesKey_3 = @"mGlAgnIBB8bx2nch";
     
     [self clearWeb];
     
+    
+    
 }
 
 -(void)moveViewWithX:(float)x
@@ -247,6 +253,10 @@ NSString *const AesKey_3 = @"mGlAgnIBB8bx2nch";
     
 }
 
+//刷新我的
+-(void)refreshMine:(NSNotification *)notification{
+    [self webViewFirstRequest];
+}
 // 点击通知 跳转到通知内url
 -(void)requestWebView:(NSNotification *)notification{
     NSDictionary * infoDict = [notification object];
@@ -256,6 +266,12 @@ NSString *const AesKey_3 = @"mGlAgnIBB8bx2nch";
     NSString * urlStr = [NSString stringWithFormat:@"%@",infoDict[@"url"]];
     
     if (urlStr) {
+        if(self.tabBarController.selectedIndex != 3) {
+            return;
+        }else {
+            [self webViewFirstRequest];
+        }
+        
         [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
         self.afterOpenPushMessage = YES;
         

+ 12 - 2
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYSearchViewController.m

@@ -146,7 +146,7 @@ NSString *const AesKey_0 = @"mGlAgnIBB8bx2nch";
             [self.timer invalidate];
             self.timer = nil;
             _timeTick = 0;
-            [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"notiDict"];
+            [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"NotiDict"];
             
             
         }
@@ -157,7 +157,7 @@ NSString *const AesKey_0 = @"mGlAgnIBB8bx2nch";
         [self.timer invalidate];
         self.timer = nil;
         _timeTick = 0;
-        [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"notiDict"];
+        [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"NotiDict"];
     }
 }
 
@@ -303,6 +303,16 @@ NSString *const AesKey_0 = @"mGlAgnIBB8bx2nch";
     NSString * urlStr = [NSString stringWithFormat:@"%@",infoDict[@"url"]];
     
     if (urlStr) {
+        
+        //当前控制器
+        if(self.tabBarController.selectedIndex != 0) {
+            return;
+        }else {
+            [[NSNotificationCenter defaultCenter] postNotificationName:@"refreshMine" object:nil];;
+        }
+        
+        
+        
         [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
         self.afterOpenPushMessage = YES;
         

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

@@ -240,6 +240,12 @@ NSString *const AesKey_1 = @"mGlAgnIBB8bx2nch";
     NSString * urlStr = [NSString stringWithFormat:@"%@",infoDict[@"url"]];
     
     if (urlStr) {
+        
+        if(self.tabBarController.selectedIndex != 1) {
+            return;
+        }else {
+            [[NSNotificationCenter defaultCenter] postNotificationName:@"refreshMine" object:nil];;
+        }
         [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
         self.afterOpenPushMessage = YES;