|
@@ -22,6 +22,7 @@
|
|
|
BOOL isLoadRedDot;
|
|
|
CGPoint startTouch;
|
|
|
BOOL _isMoving;
|
|
|
+ BOOL isExistNoNewWork;
|
|
|
}
|
|
|
|
|
|
@property (nonatomic, strong) UIProgressView *progressView;
|
|
@@ -38,6 +39,7 @@
|
|
|
|
|
|
|
|
|
@property(nonatomic, strong)NoNetView *noNetView;
|
|
|
+@property(nonatomic, strong)NoNetView *failNetView;
|
|
|
@property(nonatomic, strong)UIPanGestureRecognizer *recognizer;
|
|
|
@property(nonatomic, strong)ZKClipboardView *clipboardView;
|
|
|
@property(nonatomic, strong)ZKFaceVerifyMsgView *verifyMsgView;
|
|
@@ -520,6 +522,7 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
|
|
|
|
self.view.backgroundColor = [UIColor whiteColor];
|
|
|
|
|
|
+
|
|
|
[self.view addSubview:self.webView];
|
|
|
[self.view addSubview:self.progressView];
|
|
|
[self webViewFirstRequest];
|
|
@@ -545,11 +548,7 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
|
|
|
|
// UIButton *btn1 = [ZKControl createButtonWithFrame:CGRectMake(100, 100, 100, 100) title:@"测试上传" imageName:nil bgImageName:nil target:self method:@selector(btn1click)];
|
|
|
// [self.view addSubview:btn1];
|
|
|
-
|
|
|
- [[GlobalData shareInstance] addOnePlistData:@{
|
|
|
- @"detail":[[self stringByEvaluatingJavaScriptFromString:@"document.location.href"] stringByAppendingString:[NSString stringWithFormat:@"\nJS异常方法:%@\n%@",@"",@""]],
|
|
|
- @"reqTime":[NSNumber numberWithInt:0],
|
|
|
- }];
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|
|
@@ -736,6 +735,7 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
|
[self.webView evaluateJavaScript:@"document.documentElement.style.webkitUserSelect='none';"completionHandler:nil];
|
|
|
[self judgeIsHiddenBottom];//是否隐藏
|
|
|
[self removeNoNetViews];
|
|
|
+ [self removeFailNetViews];
|
|
|
[[LXViewControllerManager shareViewControllerManager] hideHud];
|
|
|
//写数据
|
|
|
// [self writeWKWebData:webView.URL];
|
|
@@ -776,6 +776,17 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
|
|
|
|
// 页面加载失败时调用
|
|
|
- (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(WKNavigation *)navigation withError:(nonnull NSError *)error{
|
|
|
+
|
|
|
+ NSLog(@"页面加载失败");
|
|
|
+ //加载失败 有网络-弹出页面 , 无网络-记录标记
|
|
|
+ if ([ZKMethod judgmentNetwork]) {
|
|
|
+ //弹出页面
|
|
|
+ [self addNoNetViews];
|
|
|
+ }else {
|
|
|
+ //记录标记
|
|
|
+ isExistNoNewWork = YES;
|
|
|
+ }
|
|
|
+
|
|
|
self.recognizer.enabled = YES;
|
|
|
[[GlobalData shareInstance] addOnePlistData:@{
|
|
|
@"detail":[[self stringByEvaluatingJavaScriptFromString:@"document.location.href"] stringByAppendingString:[NSString stringWithFormat:@"\n%@",[error description]]],
|
|
@@ -1843,6 +1854,9 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
|
return mutStr;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
-(void)addNoNetViews{
|
|
|
kMainQueue(^{
|
|
|
[self removeNoNetViews];
|
|
@@ -1859,6 +1873,22 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
|
}
|
|
|
|
|
|
|
|
|
+-(void)addFailNetViews{
|
|
|
+ kMainQueue(^{
|
|
|
+ [self removeNoNetViews];
|
|
|
+ self.failNetView = [NoNetView shareView];
|
|
|
+ [self.view addSubview:self.failNetView];
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+-(void)removeFailNetViews{
|
|
|
+ if (self.failNetView ) {
|
|
|
+ [self.failNetView removeFromSuperview];
|
|
|
+ self.failNetView = nil;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -1983,9 +2013,16 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
|
-(void)netReachChanged:(NSNotification *)notificaition{
|
|
|
NSDictionary *userInfo = notificaition.userInfo;
|
|
|
if ([userInfo[@"AFNetworkingReachabilityNotificationStatusItem"] intValue] == 0 || [userInfo[@"AFNetworkingReachabilityNotificationStatusItem"] intValue] == -1) {
|
|
|
+ NSLog(@"针对首页-监听无网络");
|
|
|
[self addNoNetViews];
|
|
|
}else{
|
|
|
+ NSLog(@"针对首页-监听有网络");
|
|
|
[self removeNoNetViews];
|
|
|
+ if (isExistNoNewWork) {
|
|
|
+ NSLog(@"标记清数据");
|
|
|
+ isExistNoNewWork = NO;
|
|
|
+ [self webViewFirstRequest];
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|