Browse Source

推送相关

Steven 2 months ago
parent
commit
d567eee30a

+ 2 - 2
KulexiuForTeacher/KulexiuForTeacher.xcodeproj/xcshareddata/xcschemes/KulexiuForTeacher.xcscheme

@@ -53,7 +53,7 @@
       </Testables>
    </TestAction>
    <LaunchAction
-      buildConfiguration = "DEV"
+      buildConfiguration = "Debug"
       selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
       selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
       launchStyle = "0"
@@ -94,7 +94,7 @@
       buildConfiguration = "Debug">
    </AnalyzeAction>
    <ArchiveAction
-      buildConfiguration = "DEV"
+      buildConfiguration = "TEST"
       revealArchiveInOrganizer = "YES">
    </ArchiveAction>
 </Scheme>

+ 4 - 2
KulexiuForTeacher/KulexiuForTeacher/AppDelegate.m

@@ -858,7 +858,6 @@ didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
             return;
         }
         else {
-            [self.tabBarController tabBarSelectedWithIndex:0];
             EvaluateCourseListViewController *ctrl = [[EvaluateCourseListViewController alloc] init];
             [ctrl scrollPageIndex:EVALUATE_INDEX_RECEIVE];
             [navCtrl pushViewController:ctrl animated:YES];
@@ -874,6 +873,8 @@ didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
         KSTabBarViewController *tabCtrl = (KSTabBarViewController *)vc;
         CustomNavViewController *navCtrl = (CustomNavViewController *)tabCtrl.selectedViewController;
         if ([navCtrl.visibleViewController isKindOfClass:NSClassFromString(@"MyCourseViewController")]) {
+            MyCourseViewController *ctrl = (MyCourseViewController *)navCtrl.visibleViewController;
+            [ctrl selectedPageWithIndex:displayIndex];
             return;
         }
         else {
@@ -956,7 +957,8 @@ didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
             [self.tabBarController tabBarSelectedWithIndex:0];
             CustomNavViewController *navCtrl = self.tabBarController.selectedViewController;
             NotiferMessageViewController *ctrl = [[NotiferMessageViewController alloc] init];
-            [navCtrl pushViewController:ctrl animated:YES];
+            CustomNavViewController *currentNavCtrl = self.tabBarController.selectedViewController;
+            [currentNavCtrl pushViewController:ctrl animated:YES];
         }
     }
 }

+ 2 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Home/MyCourse/Controller/MyCourseViewController.h

@@ -28,6 +28,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 - (void)displayWithIndex:(DISPLAY_INDEX)displayIndex;
 
+- (void)selectedPageWithIndex:(DISPLAY_INDEX)pageIndex;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 6 - 0
KulexiuForTeacher/KulexiuForTeacher/Module/Home/MyCourse/Controller/MyCourseViewController.m

@@ -112,6 +112,12 @@
     self.displayIndex = displayIndex;
 }
 
+- (void)selectedPageWithIndex:(DISPLAY_INDEX)pageIndex {
+    if (pageIndex != self.selectedIndex) {
+        [self.categoryView selectItemAtIndex:pageIndex];
+        self.selectedIndex = pageIndex;
+    }
+}
 
 - (void)viewWillAppear:(BOOL)animated {
     [super viewWillAppear:animated];

+ 11 - 15
KulexiuForTeacher/KulexiuForTeacher/Module/Home/NotiferMessage/Controller/NotiferMessageViewController.m

@@ -277,33 +277,23 @@
                 }
                 else if ([pageType isEqualToString:@"vipClass"]) { // 我的课程 ->vip定制课
                     DISPLAY_INDEX index = DISPLAY_INDEX_VIP;
-                    MyCourseViewController *ctrl = [[MyCourseViewController alloc] init];
-                    [ctrl displayWithIndex:index];
-                    [self.navigationController pushViewController:ctrl animated:YES];
+                    [self toMyCoursePageWithIndex:index];
                 }
                 else if ([pageType isEqualToString:@"practiceClass"]) { // 我的课程 ->趣纠课
                     DISPLAY_INDEX index = DISPLAY_INDEX_FIRST;
-                    MyCourseViewController *ctrl = [[MyCourseViewController alloc] init];
-                    [ctrl displayWithIndex:index];
-                    [self.navigationController pushViewController:ctrl animated:YES];
+                    [self toMyCoursePageWithIndex:index];
                 }
                 else if ([pageType isEqualToString:@"groupClass"]) {  // 我的课程 ->小组课
                     DISPLAY_INDEX index = DISPLAY_INDEX_GROUP;
-                    MyCourseViewController *ctrl = [[MyCourseViewController alloc] init];
-                    [ctrl displayWithIndex:index];
-                    [self.navigationController pushViewController:ctrl animated:YES];
+                    [self toMyCoursePageWithIndex:index];
                 }
                 else if ([pageType isEqualToString:@"liveClass"]) { // 我的课程 ->直播课
                     DISPLAY_INDEX index = DISPLAY_INDEX_LIVE;
-                    MyCourseViewController *ctrl = [[MyCourseViewController alloc] init];
-                    [ctrl displayWithIndex:index];
-                    [self.navigationController pushViewController:ctrl animated:YES];
+                    [self toMyCoursePageWithIndex:index];
                 }
                 else if ([pageType isEqualToString:@"videoClass"]) { // 我的课程 ->视频课
                     DISPLAY_INDEX index = DISPLAY_INDEX_VIDEO;
-                    MyCourseViewController *ctrl = [[MyCourseViewController alloc] init];
-                    [ctrl displayWithIndex:index];
-                    [self.navigationController pushViewController:ctrl animated:YES];
+                    [self toMyCoursePageWithIndex:index];
                 }
                 else if ([pageType isEqualToString:@"groupCourseCancel"]) { // 小组课取消
                     MyGroupCourseViewController *ctrl = [[MyGroupCourseViewController alloc] init];
@@ -328,6 +318,12 @@
     }
 }
 
+- (void)toMyCoursePageWithIndex:(DISPLAY_INDEX)displayIndex {
+    MyCourseViewController *ctrl = [[MyCourseViewController alloc] init];
+    [ctrl displayWithIndex:displayIndex];
+    [self.navigationController pushViewController:ctrl animated:YES];
+}
+
 - (void)toFeedback {
     FeedbackListViewController *ctrl = [[FeedbackListViewController alloc] init];
     [self.navigationController pushViewController:ctrl animated:YES];