Эх сурвалжийг харах

处理 - 多次点击 加载失败页面

apple 4 жил өмнө
parent
commit
bc4a17b0a8

+ 4 - 4
ios/JianYuIOS/JianYuIOS.xcodeproj/project.pbxproj

@@ -916,7 +916,7 @@
 				CODE_SIGN_ENTITLEMENTS = "JianYuIOS/剑鱼标讯Debug.entitlements";
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 60;
+				CURRENT_PROJECT_VERSION = 61;
 				DEVELOPMENT_TEAM = 4S438G3ZUL;
 				ENABLE_BITCODE = NO;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -937,7 +937,7 @@
 					"$(PROJECT_DIR)/JianYuIOS/ThirdSDK/UMSocial/UMSocialSDKPlugin",
 					"$(PROJECT_DIR)/JianYuIOS/Libs(第三方)/WeChatSDK1.8.4",
 				);
-				MARKETING_VERSION = 2.9.9;
+				MARKETING_VERSION = 3.0.0;
 				ONLY_ACTIVE_ARCH = YES;
 				OTHER_LDFLAGS = (
 					"$(inherited)",
@@ -998,7 +998,7 @@
 				CODE_SIGN_ENTITLEMENTS = JianYuIOS/JianYuIOS.entitlements;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 60;
+				CURRENT_PROJECT_VERSION = 61;
 				DEVELOPMENT_TEAM = 4S438G3ZUL;
 				ENABLE_BITCODE = NO;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -1019,7 +1019,7 @@
 					"$(PROJECT_DIR)/JianYuIOS/ThirdSDK/UMSocial/UMSocialSDKPlugin",
 					"$(PROJECT_DIR)/JianYuIOS/Libs(第三方)/WeChatSDK1.8.4",
 				);
-				MARKETING_VERSION = 2.9.9;
+				MARKETING_VERSION = 3.0.0;
 				ONLY_ACTIVE_ARCH = NO;
 				OTHER_LDFLAGS = (
 					"$(inherited)",

BIN
ios/JianYuIOS/JianYuIOS.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate


+ 0 - 16
ios/JianYuIOS/JianYuIOS.xcworkspace/xcuserdata/apple.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -32,21 +32,5 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            uuid = "9BBBE563-F4E9-40B1-89BA-CE3CB39242C4"
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "JianYuIOS/AppDelegate.m"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "409"
-            endingLineNumber = "409"
-            landmarkName = "-timerClickMethod:"
-            landmarkType = "7">
-         </BreakpointContent>
-      </BreakpointProxy>
    </Breakpoints>
 </Bucket>

+ 13 - 5
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYNewExpViewController.m

@@ -27,6 +27,10 @@
 @property(nonatomic, strong)ZKFaceVerifyMsgView *verifyMsgView;
 @property(nonatomic, strong)UIPanGestureRecognizer *recognizer;
 
+
+//进度条是否加载中
+@property(nonatomic, assign)BOOL isRuningLoad;
+
 @end
 
 
@@ -160,11 +164,16 @@ NSString *const new_AesKey_3 = @"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
@@ -532,7 +541,9 @@ NSString *const new_AesKey_3 = @"mGlAgnIBB8bx2nch";
     if ([ZKMethod judegeNetworkIsAvailable]) {
         //弹出页面
         NSLog(@"页面加载失败-有网络");
-        [self addFailNetViews];
+        if (!self.isRuningLoad) {
+            [self addFailNetViews];
+        }
     }else {
         //记录标记
         NSLog(@"页面加载失败-无网络");
@@ -540,10 +551,7 @@ NSString *const new_AesKey_3 = @"mGlAgnIBB8bx2nch";
     }
     
     self.recognizer.enabled = YES;
-    [[GlobalData shareInstance] addOnePlistData:@{
-        @"detail":[[self stringByEvaluatingJavaScriptFromString:@"document.location.href"] stringByAppendingString:[NSString stringWithFormat:@"\n%@",[error description]]],
-        @"reqTime":[NSNumber numberWithInt:0],
-    }];
+
 }
 
 

+ 12 - 6
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYNewMineViewController.m

@@ -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(@"页面加载失败-无网络");

+ 11 - 8
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYNewSearchViewController.m

@@ -41,8 +41,8 @@
 @property(nonatomic, strong)ZKFaceVerifyMsgView *verifyMsgView;
 
 
-
-
+//进度条是否加载中
+@property(nonatomic, assign)BOOL isRuningLoad;
 
 @end
 
@@ -183,12 +183,17 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
 #pragma mark - event response
 // 计算wkWebView进度条
 - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
-//    NSLog(@"进度条加载完毕");
+//    NSLog(@"进度条加载中...");
+    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
@@ -777,7 +782,9 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
     if ([ZKMethod judegeNetworkIsAvailable]) {
         //弹出页面
         NSLog(@"页面加载失败-有网络");
-        [self addFailNetViews];
+        if (!self.isRuningLoad) {
+            [self addFailNetViews];
+        }
     }else {
         //记录标记
         NSLog(@"页面加载失败-无网络");
@@ -785,10 +792,6 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
     }
     
     self.recognizer.enabled = YES;
-    [[GlobalData shareInstance] addOnePlistData:@{
-        @"detail":[[self stringByEvaluatingJavaScriptFromString:@"document.location.href"] stringByAppendingString:[NSString stringWithFormat:@"\n%@",[error description]]],
-        @"reqTime":[NSNumber numberWithInt:0],
-    }];
 }
 
 

+ 13 - 5
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYNewSubViewController.m

@@ -27,6 +27,10 @@
 @property(nonatomic, strong)ZKFaceVerifyMsgView *verifyMsgView;
 @property(nonatomic, strong)UIPanGestureRecognizer *recognizer;
 
+
+//进度条是否加载中
+@property(nonatomic, assign)BOOL isRuningLoad;
+
 @end
 
 
@@ -164,11 +168,16 @@ NSString *const new_AesKey_2 = @"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
@@ -532,7 +541,9 @@ NSString *const new_AesKey_2 = @"mGlAgnIBB8bx2nch";
     if ([ZKMethod judegeNetworkIsAvailable]) {
         //弹出页面
         NSLog(@"页面加载失败-有网络");
-        [self addFailNetViews];
+        if (!self.isRuningLoad) {
+            [self addFailNetViews];
+        }
     }else {
         //记录标记
         NSLog(@"页面加载失败-无网络");
@@ -540,10 +551,7 @@ NSString *const new_AesKey_2 = @"mGlAgnIBB8bx2nch";
     }
     
     self.recognizer.enabled = YES;
-    [[GlobalData shareInstance] addOnePlistData:@{
-        @"detail":[[self stringByEvaluatingJavaScriptFromString:@"document.location.href"] stringByAppendingString:[NSString stringWithFormat:@"\n%@",[error description]]],
-        @"reqTime":[NSNumber numberWithInt:0],
-    }];
+ 
 }
 
 

+ 1 - 1
ios/JianYuIOS/JianYuIOS/JYgRPC/JYgRPCClient.m

@@ -62,7 +62,7 @@
     isRunning = NO;
     //不断监听  10秒执行一次 注册
     NSLog(@"初始化定时器");
-    self.hostTimer = [NSTimer scheduledTimerWithTimeInterval:5 target:self selector:@selector(hostTimerFireMethod) userInfo:nil repeats:YES];
+    self.hostTimer = [NSTimer scheduledTimerWithTimeInterval:10 target:self selector:@selector(hostTimerFireMethod) userInfo:nil repeats:YES];
     [self.hostTimer fire];