|
@@ -7,6 +7,8 @@
|
|
|
//
|
|
|
|
|
|
#import "JYExpViewController.h"
|
|
|
+#import "JYTabBarController.h"
|
|
|
+
|
|
|
|
|
|
@protocol JYExpViewControllerJSExport<JSExport>
|
|
|
|
|
@@ -44,6 +46,11 @@ JSExportAs(hiddenBottom, -(void)jsHiddenBottom:(NSString*)hidden);
|
|
|
JSExportAs(checkLab, -(void)jsCheckLab:(NSString*)str);
|
|
|
|
|
|
|
|
|
+
|
|
|
+JSExportAs(loginSuccess, -(void)jsLoginSuccess:(NSString*)status);
|
|
|
+
|
|
|
+JSExportAs(backUrl, -(void)jsBackUrl:(NSString*)str);
|
|
|
+
|
|
|
@end
|
|
|
|
|
|
|
|
@@ -226,7 +233,8 @@ NSString *const AesKey_2 = @"mGlAgnIBB8bx2nch";
|
|
|
|
|
|
//收到消息退出并重新加载web
|
|
|
-(void)webViewRequestByMsg{
|
|
|
- NSString *url = [NSString stringWithFormat:@"%@%@", kHost, @"jyapp/free/kicked"];
|
|
|
+// NSString *url = [NSString stringWithFormat:@"%@%@", kHost, @"jyapp/free/kicked"];
|
|
|
+ NSString *url = [NSString stringWithFormat:@"%@%@", kHost, @"jyapp/free/login?back=index&isios=t"];
|
|
|
url = [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
|
|
|
[self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
|
|
|
}
|
|
@@ -288,6 +296,9 @@ NSString *const AesKey_2 = @"mGlAgnIBB8bx2nch";
|
|
|
|
|
|
// 收到退出登录消息
|
|
|
-(void)loginOut:(NSNotification *)notification{
|
|
|
+ if([notification.userInfo[@"item_index"] integerValue]!=2) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
self.signOutContent = notification.object;
|
|
|
if (!self.signOutContent) {
|
|
|
self.signOutContent = @"1";
|
|
@@ -295,12 +306,12 @@ NSString *const AesKey_2 = @"mGlAgnIBB8bx2nch";
|
|
|
NSString *url = [NSString stringWithFormat:@"%@%@?sign=%@", kHost, @"jyapp/free/signOut", [LXUserDefaults token]];
|
|
|
url = [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
|
|
|
|
|
|
- UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectZero];
|
|
|
- webView.delegate = self;
|
|
|
- [self.view addSubview:webView];
|
|
|
- [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
|
|
|
+// UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectZero];
|
|
|
+// webView.delegate = self;
|
|
|
+// [self.view addSubview:webView];
|
|
|
+// [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
|
|
|
|
|
|
- // [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
|
|
|
+ [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
|
|
|
[self jsRemoveUserToken:nil];
|
|
|
}
|
|
|
|
|
@@ -352,6 +363,7 @@ NSString *const AesKey_2 = @"mGlAgnIBB8bx2nch";
|
|
|
{
|
|
|
NSString *current_url = [self.webView stringByEvaluatingJavaScriptFromString:@"document.location.href"];
|
|
|
//http://w4blmjy.qmx.top/jyapp/free/login?back=index
|
|
|
+ NSLog(@"%@",current_url);
|
|
|
if([current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/jylab/index",kHost]]
|
|
|
||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/free/login?back=index",kHost]]){
|
|
|
NSLog(@"展示");
|
|
@@ -851,6 +863,46 @@ NSString *const AesKey_2 = @"mGlAgnIBB8bx2nch";
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
+-(void)jsBackUrl:(NSString*)str
|
|
|
+{
|
|
|
+ NSLog(@"Mine返回首页%@",str);
|
|
|
+ if([str isEqualToString:@"H"]) {
|
|
|
+ //测试返回首页
|
|
|
+ kMainQueue(^{
|
|
|
+ AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
|
|
|
+ JYTabBarController *tab = (JYTabBarController *)delegate.window.rootViewController;
|
|
|
+ tab.selectedIndex = 0;
|
|
|
+
|
|
|
+ [[NSNotificationCenter defaultCenter] postNotificationName:@"changeItems" object:nil userInfo:@{@"item_index":@"0"}];
|
|
|
+
|
|
|
+ [self dealTabBar];
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+-(void)jsLoginSuccess:(NSString*)status
|
|
|
+{
|
|
|
+ NSLog(@"Mine登录成功提示");
|
|
|
+ if([status isEqualToString:@"S"]) {
|
|
|
+ kMainQueue(^{
|
|
|
+ AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
|
|
|
+ JYTabBarController *tab = (JYTabBarController *)delegate.window.rootViewController;
|
|
|
+ tab.selectedIndex = 0;
|
|
|
+
|
|
|
+ [[NSNotificationCenter defaultCenter] postNotificationName:@"changeItems" object:nil userInfo:@{@"item_index":@"5"}];
|
|
|
+ });
|
|
|
+ }else {
|
|
|
+
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
/*
|
|
|
#pragma mark - Navigation
|
|
|
|