|
@@ -37,6 +37,9 @@
|
|
|
@property(nonatomic, strong)ZKClipboardView *clipboardView;
|
|
|
@property(nonatomic, strong)ZKFaceVerifyMsgView *verifyMsgView;
|
|
|
|
|
|
+//进度条是否加载中
|
|
|
+@property(nonatomic, assign)BOOL isRuningLoad;
|
|
|
+
|
|
|
@end
|
|
|
|
|
|
|
|
@@ -173,11 +176,16 @@ NSString *const new_AesKey_4 = @"mGlAgnIBB8bx2nch";
|
|
|
#pragma mark - event response
|
|
|
// 计算wkWebView进度条
|
|
|
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
|
|
|
+ if (!self.isRuningLoad) {
|
|
|
+ self.isRuningLoad = YES;
|
|
|
+ }
|
|
|
if (object == self.webView && [keyPath isEqualToString:@"estimatedProgress"]) {
|
|
|
CGFloat newprogress = [[change objectForKey:NSKeyValueChangeNewKey] doubleValue];
|
|
|
self.progressView.alpha = 1.0f;
|
|
|
[self.progressView setProgress:newprogress animated:YES];
|
|
|
if (newprogress >= 1.0f) {
|
|
|
+ NSLog(@"进度条加载完毕...");
|
|
|
+ self.isRuningLoad = NO;
|
|
|
self.recognizer.enabled = YES;
|
|
|
[UIView animateWithDuration:0.3f
|
|
|
delay:0.3f
|
|
@@ -457,11 +465,7 @@ NSString *const new_AesKey_4 = @"mGlAgnIBB8bx2nch";
|
|
|
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.15 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
|
|
[_webView evaluateJavaScript:jsStr completionHandler:^(id _Nullable result, NSError * _Nullable error) {
|
|
|
if (error!=nil) {
|
|
|
-// NSLog(@"result:%@,error:%@",result,error);
|
|
|
-// [[GlobalData shareInstance] addOnePlistData:@{
|
|
|
-// @"detail":[[self stringByEvaluatingJavaScriptFromString:@"document.location.href"] stringByAppendingString:[NSString stringWithFormat:@"\nJS异常方法:%@\n%@",jsStr,[error description]]],
|
|
|
-// @"reqTime":[NSNumber numberWithInt:0],
|
|
|
-// }];
|
|
|
+
|
|
|
}
|
|
|
}];
|
|
|
});
|
|
@@ -539,7 +543,9 @@ NSString *const new_AesKey_4 = @"mGlAgnIBB8bx2nch";
|
|
|
if ([ZKMethod judegeNetworkIsAvailable]) {
|
|
|
//弹出页面
|
|
|
NSLog(@"页面加载失败-有网络");
|
|
|
- [self addFailNetViews];
|
|
|
+ if (!self.isRuningLoad) {
|
|
|
+ [self addFailNetViews];
|
|
|
+ }
|
|
|
}else {
|
|
|
//记录标记
|
|
|
NSLog(@"页面加载失败-无网络");
|