|
@@ -36,7 +36,7 @@
|
|
|
|
|
|
|
|
|
@property(nonatomic, strong)NoNetView *noNetView;
|
|
|
-
|
|
|
+@property(nonatomic, strong)UIPanGestureRecognizer *recognizer;
|
|
|
|
|
|
@end
|
|
|
|
|
@@ -145,6 +145,7 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
|
self.progressView.alpha = 1.0f;
|
|
|
[self.progressView setProgress:newprogress animated:YES];
|
|
|
if (newprogress >= 1.0f) {
|
|
|
+ self.recognizer.enabled = YES;
|
|
|
[UIView animateWithDuration:0.3f
|
|
|
delay:0.3f
|
|
|
options:UIViewAnimationOptionCurveEaseOut
|
|
@@ -214,7 +215,10 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
|
if ([current_url containsString:@"jyapp/jylab/mainSearch#"]) {
|
|
|
[self isExitCallToJS:@"afterClickBack()" withMethodName:@"afterClickBack"];
|
|
|
}
|
|
|
- [self.webView goBack];
|
|
|
+// [self.webView goBack];
|
|
|
+
|
|
|
+ NSString *jsStr = @"window.history.back()";
|
|
|
+ [self executeCallJS:jsStr];
|
|
|
|
|
|
} completion:^(BOOL finished) {
|
|
|
_isMoving = NO;
|
|
@@ -430,7 +434,7 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
|
NSString *jsName = [NSString stringWithFormat:@"function exist(){return !window['%@']};exist()",name];
|
|
|
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.15 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
|
|
[_webView evaluateJavaScript:jsName completionHandler:^(id _Nullable result, NSError * _Nullable error) {
|
|
|
- NSLog(@"是否存在 result:%@,error:%@",result,error);
|
|
|
+// NSLog(@"是否存在 result:%@,error:%@",result,error);
|
|
|
if ([result intValue]==0) {
|
|
|
[self executeCallJS:jsStr];
|
|
|
}else {
|
|
@@ -441,7 +445,7 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
|
}
|
|
|
-(void)executeCallJS:(NSString *)jsStr {
|
|
|
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.15 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
|
|
- NSLog(@"OC调JS交互%@:",jsStr);
|
|
|
+// NSLog(@"OC调JS交互%@:",jsStr);
|
|
|
[_webView evaluateJavaScript:jsStr completionHandler:^(id _Nullable result, NSError * _Nullable error) {
|
|
|
if (error!=nil) {
|
|
|
NSLog(@"result:%@,error:%@",result,error);
|
|
@@ -469,9 +473,9 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
|
[self initApnsTimer];
|
|
|
[self initNotification];
|
|
|
|
|
|
- UIPanGestureRecognizer *recognizer = [[UIPanGestureRecognizer alloc]initWithTarget:self action:@selector(paningGestureReceive:)];
|
|
|
- [recognizer delaysTouchesBegan];
|
|
|
- [self.view addGestureRecognizer:recognizer];
|
|
|
+ self.recognizer = [[UIPanGestureRecognizer alloc]initWithTarget:self action:@selector(paningGestureReceive:)];
|
|
|
+ [self.recognizer delaysTouchesBegan];
|
|
|
+ [self.view addGestureRecognizer:self.recognizer];
|
|
|
|
|
|
//初始化临时属性
|
|
|
self.placeAdr = [NSString new];
|
|
@@ -648,7 +652,7 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
|
|
|
|
// 页面开始加载时调用
|
|
|
- (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation{
|
|
|
-
|
|
|
+ self.recognizer.enabled = NO;
|
|
|
}
|
|
|
// 当内容开始返回时调用
|
|
|
- (void)webView:(WKWebView *)webView didCommitNavigation:(WKNavigation *)navigation{
|
|
@@ -656,6 +660,7 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
|
|
|
|
// 页面加载失败时调用
|
|
|
- (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(WKNavigation *)navigation withError:(nonnull NSError *)error{
|
|
|
+ self.recognizer.enabled = YES;
|
|
|
[[GlobalData shareInstance] addOnePlistData:@{
|
|
|
@"detail":[[self stringByEvaluatingJavaScriptFromString:@"document.location.href"] stringByAppendingString:[NSString stringWithFormat:@"\n%@",[error description]]],
|
|
|
@"reqTime":[NSNumber numberWithInt:0],
|