Przeglądaj źródła

跳转到页面指定page 打开弹窗

Steven 7 miesięcy temu
rodzic
commit
a6566efb53

+ 7 - 6
KulexiuForStudent/KulexiuForStudent/Module/Home/ArrangeCourse/Controller/HomeArrangeCourseController.m

@@ -31,8 +31,6 @@
 
 @property (nonatomic, strong) CourseDescAlertView *tipsAlert;
 
-//@property (no)
-
 @end
 
 @implementation HomeArrangeCourseController
@@ -95,6 +93,9 @@
 
 - (void)displayWithIndex:(DISPLAY_INDEX)displayIndex {
     self.displayIndex = displayIndex;
+    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3f * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+        [self showTipsAlert:self.displayIndex];
+    });
 }
 
 - (void)viewWillAppear:(BOOL)animated {
@@ -150,7 +151,6 @@
 - (void)viewDidAppear:(BOOL)animated {
     [super viewDidAppear:animated];
     self.navigationController.interactivePopGestureRecognizer.enabled = (self.categoryView.selectedIndex == 0);
-    [self showTipsAlert];
 }
 
 - (JXPagerView *)preferredPagingView {
@@ -283,18 +283,19 @@
         [self backAction];
     }
     else {
-        [self showTipsAlert];
+        [self showTipsAlert:self.categoryView.selectedIndex];
     }
 }
 
-- (void)showTipsAlert {
-    [self.tipsAlert displayCourseTypeIndex:self.categoryView.selectedIndex];
+- (void)showTipsAlert:(NSInteger)displayIndex {
+    [self.tipsAlert displayCourseTypeIndex:displayIndex];
     [self.tipsAlert showInView:[NSObject getKeyWindow]];
 }
 
 - (CourseDescAlertView *)tipsAlert {
     if (!_tipsAlert) {
         _tipsAlert = [CourseDescAlertView sharedInstance];
+        [_tipsAlert refreshView];
     }
     return _tipsAlert;
 }

+ 2 - 0
KulexiuForStudent/KulexiuForStudent/Module/Home/ArrangeCourse/View/CourseDescAlertView.h

@@ -20,6 +20,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 + (instancetype)sharedInstance;
 
+- (void)refreshView;
+
 - (void)displayCourseTypeIndex:(NSInteger)index;
 
 - (void)showInView:(UIView *)displayView;

+ 4 - 0
KulexiuForStudent/KulexiuForStudent/Module/Home/ArrangeCourse/View/CourseDescAlertView.m

@@ -45,6 +45,10 @@
     return view;
 }
 
+- (void)refreshView {
+    [self.baseScroll reloadData];
+}
+
 - (void)displayCourseTypeIndex:(NSInteger)index {
     self.displayIndex = index;
     [self.baseScroll scrollToItemAtIndex:index animate:YES];

+ 1 - 0
KulexiuForStudent/KulexiuForStudent/Module/Home/Controller/HomeViewController.m

@@ -1589,6 +1589,7 @@
         case HOMENAV_TAG_SEARCH: // 搜索
         {
             HomeArrangeCourseController *ctrl = [[HomeArrangeCourseController alloc] init];
+            [ctrl displayWithIndex:DISPLAY_INDEX_LIVE];
             [self.navigationController pushViewController:ctrl animated:YES];
             return;
             KSBaseWKWebViewController *webCtrl = [[KSBaseWKWebViewController alloc] init];