|
@@ -100,7 +100,7 @@ NSString *const AesKey_3 = @"mGlAgnIBB8bx2nch";
|
|
|
-(void)viewDidAppear:(BOOL)animated
|
|
|
{
|
|
|
[super viewDidAppear:animated];
|
|
|
-// [self.webView reload];
|
|
|
+ // [self.webView reload];
|
|
|
}
|
|
|
|
|
|
- (void)viewDidLoad {
|
|
@@ -124,7 +124,7 @@ NSString *const AesKey_3 = @"mGlAgnIBB8bx2nch";
|
|
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(loginOut:) name:kLoginOut object:nil];
|
|
|
|
|
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(refreshMine:) name:@"refreshMine" object:nil];
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -138,8 +138,8 @@ NSString *const AesKey_3 = @"mGlAgnIBB8bx2nch";
|
|
|
//手势
|
|
|
|
|
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(refreshAllVC:) name:@"refreshAllVC" object:nil];
|
|
|
-
|
|
|
-// [self clearWeb];
|
|
|
+
|
|
|
+ // [self clearWeb];
|
|
|
|
|
|
}
|
|
|
|
|
@@ -255,10 +255,10 @@ NSString *const AesKey_3 = @"mGlAgnIBB8bx2nch";
|
|
|
// 首次加载web
|
|
|
-(void)webViewFirstRequest{
|
|
|
NSString *url = [NSString stringWithFormat:@"%@%@", kHost, @"jyapp/free/me"];
|
|
|
-// NSString *token = [LXUserDefaults token];
|
|
|
-// if (token) {
|
|
|
-// url = [url stringByAppendingString:[NSString stringWithFormat:@"?sign=%@&url=/jyapp/jylab/mainSearch&from=restart", token]];
|
|
|
-// }
|
|
|
+ // NSString *token = [LXUserDefaults token];
|
|
|
+ // if (token) {
|
|
|
+ // url = [url stringByAppendingString:[NSString stringWithFormat:@"?sign=%@&url=/jyapp/jylab/mainSearch&from=restart", token]];
|
|
|
+ // }
|
|
|
NSLog(@"444第一次加载%@",url);
|
|
|
url = [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
|
|
|
|
|
@@ -272,7 +272,7 @@ NSString *const AesKey_3 = @"mGlAgnIBB8bx2nch";
|
|
|
|
|
|
//收到消息退出并重新加载web
|
|
|
-(void)webViewRequestByMsg{
|
|
|
-
|
|
|
+
|
|
|
NSString *url = [NSString stringWithFormat:@"%@%@", kHost, @"jyapp/free/login?back=index&isios=t&flag=kicked"];
|
|
|
url = [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
|
|
|
[self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
|
|
@@ -320,7 +320,7 @@ NSString *const AesKey_3 = @"mGlAgnIBB8bx2nch";
|
|
|
if(self.tabBarController.selectedIndex != 3) {
|
|
|
return;
|
|
|
}else {
|
|
|
-// [self webViewFirstRequest];
|
|
|
+ // [self webViewFirstRequest];
|
|
|
}
|
|
|
|
|
|
[[LXViewControllerManager shareViewControllerManager] showHudText:nil];
|
|
@@ -342,16 +342,24 @@ NSString *const AesKey_3 = @"mGlAgnIBB8bx2nch";
|
|
|
}
|
|
|
NSString * urlStr = [NSString stringWithFormat:@"%@",infoDict[@"url"]];
|
|
|
if (urlStr) {
|
|
|
+ NSLog(@"有info");
|
|
|
if(self.tabBarController.selectedIndex == 3) {
|
|
|
//底部栏置换到订阅
|
|
|
- [[NSNotificationCenter defaultCenter] postNotificationName:@"refreshDY" object:nil userInfo:nil];
|
|
|
AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
|
|
|
JYTabBarController *tab = (JYTabBarController *)delegate.window.rootViewController;
|
|
|
tab.selectedIndex = 1;
|
|
|
+
|
|
|
+ [self performSelector:@selector(pushDY:) withObject:infoDict afterDelay:1];
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+-(void)pushDY:(NSDictionary *)infoDict
|
|
|
+{
|
|
|
+ [[NSNotificationCenter defaultCenter] postNotificationName:@"refreshDY" object:nil userInfo:infoDict];
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -367,44 +375,44 @@ NSString *const AesKey_3 = @"mGlAgnIBB8bx2nch";
|
|
|
if([notification.userInfo[@"item_index"] integerValue]!=3) {
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
[self webViewRequestByMsg];
|
|
|
}
|
|
|
|
|
|
- (void)hideTabBar {
|
|
|
|
|
|
kMainQueue(^{
|
|
|
- if (self.tabBarController.tabBar.hidden == YES) {
|
|
|
- return;
|
|
|
- }
|
|
|
- UIView *contentView;
|
|
|
- if ( [[self.tabBarController.view.subviews objectAtIndex:0] isKindOfClass:[UITabBar class]] )
|
|
|
- contentView = [self.tabBarController.view.subviews objectAtIndex:1];
|
|
|
- else
|
|
|
- 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;
|
|
|
+ if (self.tabBarController.tabBar.hidden == YES) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ UIView *contentView;
|
|
|
+ if ( [[self.tabBarController.view.subviews objectAtIndex:0] isKindOfClass:[UITabBar class]] )
|
|
|
+ contentView = [self.tabBarController.view.subviews objectAtIndex:1];
|
|
|
+ else
|
|
|
+ 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;
|
|
|
- }
|
|
|
- UIView *contentView;
|
|
|
- if ([[self.tabBarController.view.subviews objectAtIndex:0] isKindOfClass:[UITabBar class]])
|
|
|
-
|
|
|
- contentView = [self.tabBarController.view.subviews objectAtIndex:1];
|
|
|
-
|
|
|
- else
|
|
|
+ if (self.tabBarController.tabBar.hidden == NO)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ UIView *contentView;
|
|
|
+ if ([[self.tabBarController.view.subviews objectAtIndex:0] isKindOfClass:[UITabBar class]])
|
|
|
+
|
|
|
+ contentView = [self.tabBarController.view.subviews objectAtIndex:1];
|
|
|
|
|
|
- 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;
|
|
|
- });
|
|
|
+ else
|
|
|
+
|
|
|
+ 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
|
|
@@ -433,14 +441,14 @@ NSString *const AesKey_3 = @"mGlAgnIBB8bx2nch";
|
|
|
|
|
|
#pragma mark webView代理方法
|
|
|
- (void)webViewDidFinishLoad:(UIWebView *)webView{
|
|
|
-
|
|
|
+
|
|
|
if(searchRefreshBool) {
|
|
|
searchRefreshBool = NO;
|
|
|
}else {
|
|
|
//正常的网页加载
|
|
|
[self judgeIsHidden];//是否隐藏
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
|
|
|
[self removeNoNetViews];
|
|
|
[[LXViewControllerManager shareViewControllerManager] hideHud];
|
|
@@ -466,13 +474,13 @@ NSString *const AesKey_3 = @"mGlAgnIBB8bx2nch";
|
|
|
|
|
|
|
|
|
-(void)webViewDidStartLoad:(UIWebView *)webView{
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
|
- (void)didReceiveMemoryWarning {
|
|
|
[super didReceiveMemoryWarning];
|
|
|
-// [self clearWeb];
|
|
|
+ // [self clearWeb];
|
|
|
// Dispose of any resources that can be recreated.
|
|
|
}
|
|
|
|
|
@@ -705,16 +713,16 @@ NSString *const AesKey_3 = @"mGlAgnIBB8bx2nch";
|
|
|
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];
|
|
|
}
|
|
@@ -877,9 +885,9 @@ NSString *const AesKey_3 = @"mGlAgnIBB8bx2nch";
|
|
|
|
|
|
[self dealTabBar];
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|
|
@@ -898,7 +906,7 @@ NSString *const AesKey_3 = @"mGlAgnIBB8bx2nch";
|
|
|
[[NSNotificationCenter defaultCenter] postNotificationName:@"changeItems" object:nil userInfo:@{@"item_index":@"5"}];
|
|
|
});
|
|
|
}else {
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -959,15 +967,15 @@ NSString *const AesKey_3 = @"mGlAgnIBB8bx2nch";
|
|
|
*/
|
|
|
|
|
|
//吊起微信
|
|
|
-// PayReq *request = [[PayReq alloc] init] ;
|
|
|
-// request.package = @"Sign=WXPay";
|
|
|
-// request.nonceStr= data[@"nonceStr"];
|
|
|
-// request.partnerId = data[@"partnerid"];
|
|
|
-// request.sign= data[@"paySign"];
|
|
|
-// request.timeStamp= [data[@"timeStamp"] intValue];
|
|
|
-// request.openID = data[@"appId"];
|
|
|
-// request.prepayId= data[@"prepay_id"];
|
|
|
-// [WXApi sendReq:request];
|
|
|
+ // PayReq *request = [[PayReq alloc] init] ;
|
|
|
+ // request.package = @"Sign=WXPay";
|
|
|
+ // request.nonceStr= data[@"nonceStr"];
|
|
|
+ // request.partnerId = data[@"partnerid"];
|
|
|
+ // request.sign= data[@"paySign"];
|
|
|
+ // request.timeStamp= [data[@"timeStamp"] intValue];
|
|
|
+ // request.openID = data[@"appId"];
|
|
|
+ // request.prepayId= data[@"prepay_id"];
|
|
|
+ // [WXApi sendReq:request];
|
|
|
}
|
|
|
|
|
|
|