|
@@ -72,6 +72,12 @@ NSString *const AesKey_3 = @"mGlAgnIBB8bx2nch";
|
|
|
[self.navigationController setNavigationBarHidden:YES animated:animated];
|
|
|
}
|
|
|
|
|
|
+-(void)viewDidAppear:(BOOL)animated
|
|
|
+{
|
|
|
+ [super viewDidAppear:animated];
|
|
|
+// [self.webView reload];
|
|
|
+}
|
|
|
+
|
|
|
- (void)viewDidLoad {
|
|
|
[super viewDidLoad];
|
|
|
self.view.backgroundColor = [UIColor whiteColor];
|
|
@@ -196,11 +202,11 @@ NSString *const AesKey_3 = @"mGlAgnIBB8bx2nch";
|
|
|
|
|
|
// 首次加载web
|
|
|
-(void)webViewFirstRequest{
|
|
|
- NSString *url = [NSString stringWithFormat:@"%@%@", kHost, @"jyapp/free/index"];
|
|
|
- NSString *token = [LXUserDefaults token];
|
|
|
- if (token) {
|
|
|
- url = [url stringByAppendingString:[NSString stringWithFormat:@"?sign=%@&url=/jyapp/jylab/mainSearch&from=restart", token]];
|
|
|
- }
|
|
|
+ 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]];
|
|
|
+// }
|
|
|
url = [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
|
|
|
[self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
|
|
|
|
|
@@ -280,7 +286,35 @@ NSString *const AesKey_3 = @"mGlAgnIBB8bx2nch";
|
|
|
[self jsRemoveUserToken:nil];
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+- (void)hideTabBar {
|
|
|
+ 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{
|
|
|
+ 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
|
|
|
+
|
|
|
+ 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;
|
|
|
+}
|
|
|
|
|
|
|
|
|
|
|
@@ -288,6 +322,17 @@ NSString *const AesKey_3 = @"mGlAgnIBB8bx2nch";
|
|
|
|
|
|
//捕获js中调用的方法
|
|
|
- (void)webViewDidFinishLoad:(UIWebView *)webView{
|
|
|
+
|
|
|
+
|
|
|
+ NSString *current_url = [self.webView stringByEvaluatingJavaScriptFromString:@"document.location.href"];
|
|
|
+ if([current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/free/me",kHost]]){
|
|
|
+ [self showTabBar];
|
|
|
+ self.webView.frame = CGRectMake(0, -STATUS_BAR_HEIGHT, WIDTH, HEIGHT-TAB_BAR_HEIGHT+STATUS_BAR_HEIGHT);
|
|
|
+ }else {
|
|
|
+ [self hideTabBar];
|
|
|
+ self.webView.frame = CGRectMake(0, -STATUS_BAR_HEIGHT, WIDTH, HEIGHT+STATUS_BAR_HEIGHT);
|
|
|
+ }
|
|
|
+
|
|
|
[self removeNoNetViews];
|
|
|
[[LXViewControllerManager shareViewControllerManager] hideHud];
|
|
|
JSContext *context = [webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
|