Browse Source

预留 切换模块刷新方法

apple 4 years ago
parent
commit
a9238268ba

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


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

@@ -26,8 +26,8 @@
             filePath = "JianYuIOS/Classes(模块)/JYNewExpViewController.m"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "1439"
-            endingLineNumber = "1439"
+            startingLineNumber = "1473"
+            endingLineNumber = "1473"
             landmarkName = "-popWebView:"
             landmarkType = "7">
          </BreakpointContent>

+ 3 - 3
ios/JianYuIOS/JianYuIOS/BaseClass1/LXUserDefaults.h

@@ -9,9 +9,9 @@
 #import <Foundation/Foundation.h>
 
 @interface LXUserDefaults : NSObject
-//推送id
-+(void)saveRegistrationID:(NSString *)registrationID;
-+(NSString *)registrationID;
+//推送id gprc
++(void)saveGrpcPushID:(NSString *)pushID;
++(NSString *)grpcPushID;
 //推送deviceToken
 +(void)saveDeviceToken:(NSString *)deviceToken;
 +(NSString *)deviceToken;

+ 4 - 4
ios/JianYuIOS/JianYuIOS/BaseClass1/LXUserDefaults.m

@@ -10,11 +10,11 @@
 
 @implementation LXUserDefaults
 
-+(void)saveRegistrationID:(NSString *)registrationID{
-    [[NSUserDefaults standardUserDefaults] setObject:registrationID forKey:@"registrationID"];
++(void)saveGrpcPushID:(NSString *)pushID {
+    [[NSUserDefaults standardUserDefaults] setObject:pushID forKey:GRPCPushID];
 }
-+(NSString *)registrationID{
-    NSString *registrationID = [[NSUserDefaults standardUserDefaults] objectForKey:@"registrationID"];
++(NSString *)grpcPushID{
+    NSString *registrationID = [[NSUserDefaults standardUserDefaults] objectForKey:GRPCPushID];
     if (!registrationID) {
         registrationID = @"";
     }

+ 3 - 0
ios/JianYuIOS/JianYuIOS/BaseClass1/PrefixHeader.pch

@@ -103,6 +103,9 @@ _Pragma("clang diagnostic pop")\
 #define OpenPushLinkUrlMethods @"OpenPushLinkUrlMethods"
 //接收红点相关
 #define JYReceiveNewsRedPoint @"JYReceiveNewsRedPoint"
+//刷新模块页面相关
+#define JYRefreshMenusView @"JYRefreshMenusView"
+
 
 //支付回调通知
 #define AlipayWXpayStatus @"AlipayWXpayStatus"

+ 46 - 2
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYNewExpViewController.m

@@ -115,6 +115,8 @@ NSString *const new_AesKey_3 = @"mGlAgnIBB8bx2nch";
                            @"savePic",
                            @"ocrVerifyService",
                            @"faceVerifyService",
+                           @"skipAppointTab",
+                           @"refreshAppointTab",
         ];
         for (NSString*jsName in jsArr) {
             [config.userContentController addScriptMessageHandler:self name:jsName];
@@ -182,7 +184,7 @@ NSString *const new_AesKey_3 = @"mGlAgnIBB8bx2nch";
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(openPushLinkUrlMethods:) name:OpenPushLinkUrlMethods object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(openPushUrlMethodsThree:) name:OpenPushUrlMethodsThree object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(jyReceiveNewsRedPoint:) name:JYReceiveNewsRedPoint object:nil];
-    
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(jyRefreshMenusView:) name:JYRefreshMenusView object:nil];
     
     //支付状态通知
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(alipayWXpayStatus:) name:AlipayWXpayStatus object:nil];
@@ -332,6 +334,10 @@ NSString *const new_AesKey_3 = @"mGlAgnIBB8bx2nch";
         [self jsOcrVerifyService:message.body];
     }else if ([message.name isEqualToString:@"faceVerifyService"]) {
         [self jsFaceVerifyService:message.body];
+    }else if ([message.name isEqualToString:@"skipAppointTab"]) {
+        [self jsSkipAppointTab:message.body];
+    }else if ([message.name isEqualToString:@"refreshAppointTab"]) {
+        [self jsRefreshAppointTab:message.body];
     }else {
         
     }
@@ -630,7 +636,7 @@ NSString *const new_AesKey_3 = @"mGlAgnIBB8bx2nch";
 }
 // 获取推送id
 -(NSString *)jsGetPushRid:(NSDictionary *)dict{
-    return [LXUserDefaults registrationID];
+    return [LXUserDefaults grpcPushID];
 }
 // 打开新页面 加载新web
 -(void)JsOpenExternalLink:(NSDictionary *)dict{
@@ -1091,6 +1097,34 @@ NSString *const new_AesKey_3 = @"mGlAgnIBB8bx2nch";
 }
 
 
+//切换模块
+-(void)jsSkipAppointTab:(NSDictionary *)dict {
+    if(self.tabBarController.selectedIndex == 2) {
+        AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+        JYTabBarController *tab = (JYTabBarController *)delegate.window.rootViewController;
+        NSString *name = [NSString stringWithFormat:@"%@",dict[@"name"]];
+        if ([name isEqualToString:@"search"]) {
+            tab.selectedIndex = 0;//切换底部栏
+        }else if ([name isEqualToString:@"subscribe"]) {
+            tab.selectedIndex = 1;//切换底部栏
+        }else if ([name isEqualToString:@"box"]) {
+            tab.selectedIndex = 2;//切换底部栏
+        }else if ([name isEqualToString:@"me"]) {
+            tab.selectedIndex = 3;//切换底部栏
+        }else {
+            
+        }
+    }
+}
+
+//刷新模块页面
+-(void)jsRefreshAppointTab:(NSDictionary *)dict {
+    if(self.tabBarController.selectedIndex == 2) {
+        [[NSNotificationCenter defaultCenter] postNotificationName:JYRefreshMenusView object:nil userInfo:dict];
+    }
+}
+
+
 #pragma mark   *****其他方法
 -(void)judgeIsHiddenBottom {
     if(self.tabBarController.selectedIndex == 2) {
@@ -1478,6 +1512,16 @@ NSString *const new_AesKey_3 = @"mGlAgnIBB8bx2nch";
         [self isExitCallToJS:textJS withMethodName:@"afterReceivePushMessage"];
     }
 }
+
+
+-(void)jyRefreshMenusView:(NSNotification *)notificaition {
+    NSDictionary *dict = notificaition.userInfo;
+    NSString *name = [NSString stringWithFormat:@"%@",dict[@"name"]];
+    if ([name isEqualToString:@"box"]) {
+        [self.webView reload];
+    }
+}
+
 //刷新页面相关
 -(void)refreshNonCurVC:(NSNotification *)notificaition{
     if(self.tabBarController.selectedIndex != 2) {

+ 42 - 2
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYNewMineViewController.m

@@ -125,6 +125,8 @@ NSString *const new_AesKey_4 = @"mGlAgnIBB8bx2nch";
                            @"savePic",
                            @"ocrVerifyService",
                            @"faceVerifyService",
+                           @"skipAppointTab",
+                           @"refreshAppointTab",
         ];
         for (NSString*jsName in jsArr) {
             [config.userContentController addScriptMessageHandler:self name:jsName];
@@ -194,7 +196,7 @@ NSString *const new_AesKey_4 = @"mGlAgnIBB8bx2nch";
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(openPushLinkUrlMethods:) name:OpenPushLinkUrlMethods object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(openPushUrlMethodsFour:) name:OpenPushUrlMethodsFour object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(jyReceiveNewsRedPoint:) name:JYReceiveNewsRedPoint object:nil];
- 
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(jyRefreshMenusView:) name:JYRefreshMenusView object:nil];
 
 
     //支付状态通知
@@ -342,6 +344,10 @@ NSString *const new_AesKey_4 = @"mGlAgnIBB8bx2nch";
         [self jsOcrVerifyService:message.body];
     }else if ([message.name isEqualToString:@"faceVerifyService"]) {
         [self jsFaceVerifyService:message.body];
+    }else if ([message.name isEqualToString:@"skipAppointTab"]) {
+        [self jsSkipAppointTab:message.body];
+    }else if ([message.name isEqualToString:@"refreshAppointTab"]) {
+        [self jsRefreshAppointTab:message.body];
     }else {
         
     }
@@ -644,7 +650,7 @@ NSString *const new_AesKey_4 = @"mGlAgnIBB8bx2nch";
 }
 // 获取推送id
 -(NSString *)jsGetPushRid:(NSDictionary *)dict{
-    return [LXUserDefaults registrationID];
+    return [LXUserDefaults grpcPushID];
 }
 // 打开新页面 加载新web
 -(void)JsOpenExternalLink:(NSDictionary *)dict{
@@ -1113,7 +1119,32 @@ NSString *const new_AesKey_4 = @"mGlAgnIBB8bx2nch";
     SKPayment * payment = [SKPayment paymentWithProduct:myProduct[0]];
     [[SKPaymentQueue defaultQueue] addPayment:payment];
 }
+//切换模块
+-(void)jsSkipAppointTab:(NSDictionary *)dict {
+    if(self.tabBarController.selectedIndex == 3) {
+        AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+        JYTabBarController *tab = (JYTabBarController *)delegate.window.rootViewController;
+        NSString *name = [NSString stringWithFormat:@"%@",dict[@"name"]];
+        if ([name isEqualToString:@"search"]) {
+            tab.selectedIndex = 0;//切换底部栏
+        }else if ([name isEqualToString:@"subscribe"]) {
+            tab.selectedIndex = 1;//切换底部栏
+        }else if ([name isEqualToString:@"box"]) {
+            tab.selectedIndex = 2;//切换底部栏
+        }else if ([name isEqualToString:@"me"]) {
+            tab.selectedIndex = 3;//切换底部栏
+        }else {
+            
+        }
+    }
+}
 
+//刷新模块页面
+-(void)jsRefreshAppointTab:(NSDictionary *)dict {
+    if(self.tabBarController.selectedIndex == 3) {
+        [[NSNotificationCenter defaultCenter] postNotificationName:JYRefreshMenusView object:nil userInfo:dict];
+    }
+}
 
 #pragma mark   *****其他方法
 -(void)judgeIsHiddenBottom {
@@ -1495,6 +1526,15 @@ NSString *const new_AesKey_4 = @"mGlAgnIBB8bx2nch";
         [self isExitCallToJS:textJS withMethodName:@"afterReceivePushMessage"];
     }
 }
+
+-(void)jyRefreshMenusView:(NSNotification *)notificaition {
+    NSDictionary *dict = notificaition.userInfo;
+    NSString *name = [NSString stringWithFormat:@"%@",dict[@"name"]];
+    if ([name isEqualToString:@"me"]) {
+        [self.webView reload];
+    }
+}
+
 //刷新页面相关
 -(void)refreshNonCurVC:(NSNotification *)notificaition{
     if(self.tabBarController.selectedIndex != 3) {

+ 51 - 1
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYNewSearchViewController.m

@@ -156,6 +156,8 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
                            @"savePic",
                            @"ocrVerifyService",
                            @"faceVerifyService",
+                           @"skipAppointTab",
+                           @"refreshAppointTab",
                 
         ];
         for (NSString*jsName in jsArr) {
@@ -233,6 +235,8 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(openPushLinkUrlMethods:) name:OpenPushLinkUrlMethods object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(openPushUrlMethodsOne:) name:OpenPushUrlMethodsOne object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(jyReceiveNewsRedPoint:) name:JYReceiveNewsRedPoint object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(jyRefreshMenusView:) name:JYRefreshMenusView object:nil];
+    
     
     
     //支付状态通知
@@ -380,6 +384,10 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
         [self jsOcrVerifyService:message.body];
     }else if ([message.name isEqualToString:@"faceVerifyService"]) {
         [self jsFaceVerifyService:message.body];
+    }else if ([message.name isEqualToString:@"skipAppointTab"]) {
+        [self jsSkipAppointTab:message.body];
+    }else if ([message.name isEqualToString:@"refreshAppointTab"]) {
+        [self jsRefreshAppointTab:message.body];
     }else {
         
     }
@@ -936,7 +944,7 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
 }
 // 获取推送id
 -(NSString *)jsGetPushRid:(NSDictionary *)dict{
-    return [LXUserDefaults registrationID];
+    return [LXUserDefaults grpcPushID];
 }
 // 打开新页面 加载新web
 -(void)JsOpenExternalLink:(NSDictionary *)dict{
@@ -1508,6 +1516,35 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
      [[SKPaymentQueue defaultQueue] finishTransaction: transaction];
 }
 
+//切换模块
+-(void)jsSkipAppointTab:(NSDictionary *)dict {
+    if(self.tabBarController.selectedIndex == 0) {
+        AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+        JYTabBarController *tab = (JYTabBarController *)delegate.window.rootViewController;
+        NSString *name = [NSString stringWithFormat:@"%@",dict[@"name"]];
+        if ([name isEqualToString:@"search"]) {
+            tab.selectedIndex = 0;//切换底部栏
+        }else if ([name isEqualToString:@"subscribe"]) {
+            tab.selectedIndex = 1;//切换底部栏
+        }else if ([name isEqualToString:@"box"]) {
+            tab.selectedIndex = 2;//切换底部栏
+        }else if ([name isEqualToString:@"me"]) {
+            tab.selectedIndex = 3;//切换底部栏
+        }else {
+            
+        }
+    }
+}
+
+//刷新模块页面
+-(void)jsRefreshAppointTab:(NSDictionary *)dict {
+    if(self.tabBarController.selectedIndex == 0) {
+        [[NSNotificationCenter defaultCenter] postNotificationName:JYRefreshMenusView object:nil userInfo:dict];
+    }
+}
+
+
+
 
 
 
@@ -2032,6 +2069,19 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
         [self isExitCallToJS:textJS withMethodName:@"afterReceivePushMessage"];
     }
 }
+
+-(void)jyRefreshMenusView:(NSNotification *)notificaition {
+    NSDictionary *dict = notificaition.userInfo;
+    NSString *name = [NSString stringWithFormat:@"%@",dict[@"name"]];
+    if ([name isEqualToString:@"search"]) {
+        [self.webView reload];
+    }
+}
+
+
+
+
+
 //刷新页面相关
 -(void)refreshNonCurVC:(NSNotification *)notificaition{
     if(self.tabBarController.selectedIndex != 0) {

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

@@ -121,6 +121,8 @@ NSString *const new_AesKey_2 = @"mGlAgnIBB8bx2nch";
                            @"savePic",
                            @"ocrVerifyService",
                            @"faceVerifyService",
+                           @"skipAppointTab",
+                           @"refreshAppointTab",
         ];
         for (NSString*jsName in jsArr) {
             [config.userContentController addScriptMessageHandler:self name:jsName];
@@ -188,7 +190,7 @@ NSString *const new_AesKey_2 = @"mGlAgnIBB8bx2nch";
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(openPushLinkUrlMethods:) name:OpenPushLinkUrlMethods object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(openPushUrlMethodsTwo:) name:OpenPushUrlMethodsTwo object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(jyReceiveNewsRedPoint:) name:JYReceiveNewsRedPoint object:nil];
-    
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(jyRefreshMenusView:) name:JYRefreshMenusView object:nil];
     //支付状态通知
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(alipayWXpayStatus:) name:AlipayWXpayStatus object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateNotifyState:) name:kUpdateNotifyState object:nil];
@@ -331,6 +333,10 @@ NSString *const new_AesKey_2 = @"mGlAgnIBB8bx2nch";
         [self jsOcrVerifyService:message.body];
     }else if ([message.name isEqualToString:@"faceVerifyService"]) {
         [self jsFaceVerifyService:message.body];
+    }else if ([message.name isEqualToString:@"skipAppointTab"]) {
+        [self jsSkipAppointTab:message.body];
+    }else if ([message.name isEqualToString:@"refreshAppointTab"]) {
+        [self jsRefreshAppointTab:message.body];
     }else {
         
     }
@@ -634,7 +640,7 @@ NSString *const new_AesKey_2 = @"mGlAgnIBB8bx2nch";
 }
 // 获取推送id
 -(NSString *)jsGetPushRid:(NSDictionary *)dict{
-    return [LXUserDefaults registrationID];
+    return [LXUserDefaults grpcPushID];
 }
 // 打开新页面 加载新web
 -(void)JsOpenExternalLink:(NSDictionary *)dict{
@@ -1098,10 +1104,32 @@ NSString *const new_AesKey_2 = @"mGlAgnIBB8bx2nch";
  
 
 
+//切换模块
+-(void)jsSkipAppointTab:(NSDictionary *)dict {
+    if(self.tabBarController.selectedIndex == 1) {
+        AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+        JYTabBarController *tab = (JYTabBarController *)delegate.window.rootViewController;
+        NSString *name = [NSString stringWithFormat:@"%@",dict[@"name"]];
+        if ([name isEqualToString:@"search"]) {
+            tab.selectedIndex = 0;//切换底部栏
+        }else if ([name isEqualToString:@"subscribe"]) {
+            tab.selectedIndex = 1;//切换底部栏
+        }else if ([name isEqualToString:@"box"]) {
+            tab.selectedIndex = 2;//切换底部栏
+        }else if ([name isEqualToString:@"me"]) {
+            tab.selectedIndex = 3;//切换底部栏
+        }else {
+            
+        }
+    }
+}
 
-
-
-
+//刷新模块页面
+-(void)jsRefreshAppointTab:(NSDictionary *)dict {
+    if(self.tabBarController.selectedIndex == 1) {
+        [[NSNotificationCenter defaultCenter] postNotificationName:JYRefreshMenusView object:nil userInfo:dict];
+    }
+}
 
 
 #pragma mark   *****其他方法
@@ -1479,6 +1507,16 @@ NSString *const new_AesKey_2 = @"mGlAgnIBB8bx2nch";
         [self isExitCallToJS:textJS withMethodName:@"afterReceivePushMessage"];
     }
 }
+
+-(void)jyRefreshMenusView:(NSNotification *)notificaition {
+    NSDictionary *dict = notificaition.userInfo;
+    NSString *name = [NSString stringWithFormat:@"%@",dict[@"name"]];
+    if ([name isEqualToString:@"subscribe"]) {
+        [self.webView reload];
+    }
+}
+
+
 //刷新页面相关
 -(void)refreshNonCurVC:(NSNotification *)notificaition{
     if(self.tabBarController.selectedIndex != 1) {