|
@@ -86,7 +86,7 @@ JSExportAs(showRedSpotOnMenu, -(void)jsShowRedSpotOnMenu:(NSString*)str);
|
|
@property(nonatomic, assign)BOOL afterOpenPushMessage;
|
|
@property(nonatomic, assign)BOOL afterOpenPushMessage;
|
|
@property(nonatomic, strong)NoNetView *noNetView;
|
|
@property(nonatomic, strong)NoNetView *noNetView;
|
|
@property(nonatomic, strong)NSURLRequest *errRequest;
|
|
@property(nonatomic, strong)NSURLRequest *errRequest;
|
|
-@property(nonatomic, strong)NSString *signOutContent;
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
@property (nonatomic, strong)NSMutableDictionary *notiDict;
|
|
@property (nonatomic, strong)NSMutableDictionary *notiDict;
|
|
@@ -473,11 +473,6 @@ NSString *const AesKey_0 = @"mGlAgnIBB8bx2nch";
|
|
if([notification.userInfo[@"item_index"] integerValue]!=0) {
|
|
if([notification.userInfo[@"item_index"] integerValue]!=0) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
-
|
|
|
|
- self.signOutContent = notification.object;
|
|
|
|
- if (!self.signOutContent) {
|
|
|
|
- self.signOutContent = @"1";
|
|
|
|
- }
|
|
|
|
|
|
|
|
[self jsRemoveUserToken:nil];
|
|
[self jsRemoveUserToken:nil];
|
|
[self webViewRequestByMsg];
|
|
[self webViewRequestByMsg];
|
|
@@ -655,9 +650,9 @@ NSString *const AesKey_0 = @"mGlAgnIBB8bx2nch";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-#pragma mark 捕获js中调用的方法
|
|
|
|
|
|
|
|
-//捕获js中调用的方法
|
|
|
|
|
|
+
|
|
|
|
+#pragma mark webView代理方法
|
|
- (void)webViewDidFinishLoad:(UIWebView *)webView{
|
|
- (void)webViewDidFinishLoad:(UIWebView *)webView{
|
|
|
|
|
|
if(!notiFinish) {
|
|
if(!notiFinish) {
|
|
@@ -689,22 +684,7 @@ NSString *const AesKey_0 = @"mGlAgnIBB8bx2nch";
|
|
// [context evaluateScript:@"afterOpenPushMessage()"];
|
|
// [context evaluateScript:@"afterOpenPushMessage()"];
|
|
[context evaluateScript:[NSString stringWithFormat:@"afterOpenPushMessage('%d')", [self jsIsCanBack:nil]]];
|
|
[context evaluateScript:[NSString stringWithFormat:@"afterOpenPushMessage('%d')", [self jsIsCanBack:nil]]];
|
|
}
|
|
}
|
|
-
|
|
|
|
- NSString *url = webView.request.URL.absoluteString;
|
|
|
|
- [self doSomeWithLoadUrl:url];
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- //加载第一次成功的时候 调JS
|
|
|
|
-// if(!autologin&&[LXUserDefaults token]) {
|
|
|
|
-// autologin = YES;
|
|
|
|
-// NSString *textJS = [NSString stringWithFormat:@"refAutoLogin('%@')",@"S"];
|
|
|
|
-// JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
|
|
|
|
-// [context evaluateScript:textJS];
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
|
|
+
|
|
if(!autologin) {
|
|
if(!autologin) {
|
|
//第一次加载页面成功
|
|
//第一次加载页面成功
|
|
if([LXUserDefaults token]) {
|
|
if([LXUserDefaults token]) {
|
|
@@ -715,43 +695,11 @@ NSString *const AesKey_0 = @"mGlAgnIBB8bx2nch";
|
|
}
|
|
}
|
|
autologin = YES;
|
|
autologin = YES;
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
-// CGSize actualSize =[webView sizeThatFits:CGSizeZero];
|
|
|
|
-//
|
|
|
|
-// CGRect newFrame = webView.frame;
|
|
|
|
-//
|
|
|
|
-// newFrame.size.height = actualSize.height;
|
|
|
|
-//
|
|
|
|
-// webView.frame = newFrame;
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
-//15737190152
|
|
|
|
--(void)doSomeWithLoadUrl:(NSString *)url{
|
|
|
|
- if (!url) {
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- if ([url containsString:@"/free/login"]){ // 如果通过接收消息 跳转到登录页面 展示消息内容
|
|
|
|
- if (self.signOutContent && ![self.signOutContent isEqualToString:@"1"]) {
|
|
|
|
- [[LXViewControllerManager shareViewControllerManager] showAlertViewWithTitle:@"提示" message:self.signOutContent actions:@[[UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
|
|
|
|
- self.signOutContent = nil;
|
|
|
|
- }]]];
|
|
|
|
- }else{
|
|
|
|
- self.signOutContent = nil;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
|
|
|
|
-(void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error{
|
|
-(void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error{
|
|
[[LXViewControllerManager shareViewControllerManager] hideHud];
|
|
[[LXViewControllerManager shareViewControllerManager] hideHud];
|
|
-
|
|
|
|
- NSString *url = webView.request.URL.absoluteString;
|
|
|
|
- [self doSomeWithLoadUrl:url];
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -794,11 +742,6 @@ NSString *const AesKey_0 = @"mGlAgnIBB8bx2nch";
|
|
|
|
|
|
|
|
|
|
#pragma mark JS 回调
|
|
#pragma mark JS 回调
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
// 微信登录
|
|
// 微信登录
|
|
-(NSString *)jsLoginByWeixin:(NSString *)str{
|
|
-(NSString *)jsLoginByWeixin:(NSString *)str{
|
|
|
|
|