|
@@ -114,6 +114,9 @@ NSString *const AesKey_0 = @"mGlAgnIBB8bx2nch";
|
|
|
[[LXViewControllerManager shareViewControllerManager] showHudText:nil];
|
|
|
[self webViewFirstRequest];//请求页面数据
|
|
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(requestWebView:) name:kRequestWebViewWithUrl object:nil];
|
|
|
+ //点击订阅通知
|
|
|
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(clickSubNotiMethods:) name:ClickSubNotiMethods object:nil];
|
|
|
+
|
|
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateNotifyState) name:kUpdateNotifyState object:nil];
|
|
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(afterReceiveNewMsg) name:kAfterReceiveNewMsg object:nil];
|
|
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadWebView) name:kReloadWebVIew object:nil];
|
|
@@ -173,7 +176,7 @@ NSString *const AesKey_0 = @"mGlAgnIBB8bx2nch";
|
|
|
|
|
|
}
|
|
|
|
|
|
- NSString *textJS = [NSString stringWithFormat:@"afterReceivePushMessage('%@','%@')",dict[@"typeMsg"],@""];
|
|
|
+ NSString *textJS = [NSString stringWithFormat:@"afterReceivePushMessage('%@','%@')",dict[@"typeMsg"],dict[@"url"]];
|
|
|
JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
|
|
|
[context evaluateScript:textJS];
|
|
|
}
|
|
@@ -221,19 +224,25 @@ NSString *const AesKey_0 = @"mGlAgnIBB8bx2nch";
|
|
|
_timeTick++;
|
|
|
NSLog(@"定时器");
|
|
|
if(self.webView&¬iFinish) {
|
|
|
- NSString * urlStr = [NSString stringWithFormat:@"%@",self.notiDict[@"url"]];
|
|
|
+ NSString * urlStr = [NSString stringWithFormat:@"%@",self.notiDict[@"info"][@"url"]];
|
|
|
|
|
|
if (urlStr) {
|
|
|
- [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
|
|
|
- self.afterOpenPushMessage = YES;
|
|
|
- [self performSelector:@selector(requestWebTime:) withObject:self.notiDict afterDelay:1];
|
|
|
+ if([self.notiDict[@"type"] isEqualToString:@"bid"]) {
|
|
|
+ AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
|
|
|
+ JYTabBarController *tab = (JYTabBarController *)delegate.window.rootViewController;
|
|
|
+ tab.selectedIndex = 1;
|
|
|
+ }else {
|
|
|
+ [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
|
|
|
+ self.afterOpenPushMessage = YES;
|
|
|
+ [self performSelector:@selector(requestWebTime:) withObject:self.notiDict afterDelay:1];
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
[self.timer invalidate];
|
|
|
self.timer = nil;
|
|
|
_timeTick = 0;
|
|
|
[[NSUserDefaults standardUserDefaults] removeObjectForKey:@"NotiDict"];
|
|
|
|
|
|
-
|
|
|
}
|
|
|
return;
|
|
|
}
|
|
@@ -405,7 +414,6 @@ NSString *const AesKey_0 = @"mGlAgnIBB8bx2nch";
|
|
|
NSString * urlStr = [NSString stringWithFormat:@"%@",infoDict[@"url"]];
|
|
|
|
|
|
if (urlStr) {
|
|
|
-
|
|
|
//当前控制器
|
|
|
if(self.tabBarController.selectedIndex != 0) {
|
|
|
return;
|
|
@@ -413,18 +421,31 @@ NSString *const AesKey_0 = @"mGlAgnIBB8bx2nch";
|
|
|
[[NSNotificationCenter defaultCenter] postNotificationName:@"refreshMine" object:nil];;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
[[LXViewControllerManager shareViewControllerManager] showHudText:nil];
|
|
|
self.afterOpenPushMessage = YES;
|
|
|
-
|
|
|
-
|
|
|
[self performSelector:@selector(requestWebTime:) withObject:infoDict afterDelay:1];
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
+-(void)clickSubNotiMethods:(NSNotification *)notification{
|
|
|
+ NSDictionary * infoDict = [notification object][@"info"];
|
|
|
+ if (!infoDict) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ NSString * urlStr = [NSString stringWithFormat:@"%@",infoDict[@"url"]];
|
|
|
+ if (urlStr) {
|
|
|
+ if(self.tabBarController.selectedIndex == 0) {
|
|
|
+ //底部栏置换到订阅
|
|
|
+ [[NSNotificationCenter defaultCenter] postNotificationName:@"refreshDY" object:nil userInfo:nil];
|
|
|
+ AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
|
|
|
+ JYTabBarController *tab = (JYTabBarController *)delegate.window.rootViewController;
|
|
|
+ tab.selectedIndex = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -969,16 +990,16 @@ NSString *const AesKey_0 = @"mGlAgnIBB8bx2nch";
|
|
|
-(int)jsGetUnReadMessageCount:(NSString *)openid{
|
|
|
NSLog(@"openid=%@",openid);
|
|
|
// NSLog(@"%d",[[LXDataBaseManager shareDataBaseManager] getUnReadMessageCount:openid]);
|
|
|
- if([[LXDataBaseManager shareDataBaseManager] getUnReadMessageCount:openid] ==0){
|
|
|
- //显示
|
|
|
- kMainQueue(^{
|
|
|
- [self.tabBarController.tabBar hideBadgeOnItemIndex:3];
|
|
|
- });
|
|
|
- }else {
|
|
|
- kMainQueue(^{
|
|
|
- [self.tabBarController.tabBar showBadgeOnItemIndex:3];
|
|
|
- });
|
|
|
- }
|
|
|
+// if([[LXDataBaseManager shareDataBaseManager] getUnReadMessageCount:openid] ==0){
|
|
|
+// //显示
|
|
|
+// kMainQueue(^{
|
|
|
+// [self.tabBarController.tabBar hideBadgeOnItemIndex:3];
|
|
|
+// });
|
|
|
+// }else {
|
|
|
+// kMainQueue(^{
|
|
|
+// [self.tabBarController.tabBar showBadgeOnItemIndex:3];
|
|
|
+// });
|
|
|
+// }
|
|
|
return [[LXDataBaseManager shareDataBaseManager] getUnReadMessageCount:openid];
|
|
|
}
|
|
|
|