Quellcode durchsuchen

弹窗隐藏逻辑

Steven vor 7 Monaten
Ursprung
Commit
e554552f8d

+ 16 - 3
KulexiuForStudent/KulexiuForStudent/Module/Home/ArrangeCourse/Controller/HomeArrangeCourseController.m

@@ -17,6 +17,8 @@
 #import "HomeArrangeVideoCourseView.h"
 #import "CourseDescAlertView.h"
 
+#define HIDE_COURSETIPS (@"HIDE_COURSETIPS")
+
 #define HEADER_HEIGHT (50)
 
 @interface HomeArrangeCourseController ()<JXPagerViewDelegate, JXPagerMainTableViewGestureDelegate,JXCategoryViewDelegate>
@@ -92,9 +94,11 @@
 
 - (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];
-    });
+    if (UserDefaultBoolForKey(HIDE_COURSETIPS) == NO) {
+        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 {
@@ -301,6 +305,7 @@
 - (void)showTipsAlert:(NSInteger)displayIndex {
     [self.tipsAlert displayCourseTypeIndex:displayIndex];
     [self.tipsAlert showInView:[NSObject getKeyWindow]];
+    
 }
 
 - (CourseDescAlertView *)tipsAlert {
@@ -308,9 +313,17 @@
         _tipsAlert = [CourseDescAlertView sharedInstance];
         _tipsAlert.showType = SHOWTYPE_SKIPMUIC;
         [_tipsAlert refreshView];
+        MJWeakSelf;
+        [_tipsAlert hideCallback:^{
+            [weakSelf skipAlert];
+        }];
     }
     return _tipsAlert;
 }
+
+- (void)skipAlert {
+    UserDefaultSetBoolForKey(YES, HIDE_COURSETIPS);
+}
 /*
 #pragma mark - Navigation
 

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

@@ -7,6 +7,8 @@
 
 #import <UIKit/UIKit.h>
 
+typedef void(^CourseDescHideCallback)(void);
+
 typedef NS_ENUM(NSInteger, SHOWTYPE) {
     SHOWTYPE_ALL = 0,
     SHOWTYPE_SKIPMUIC,
@@ -31,6 +33,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 - (void)refreshView;
 
+- (void)hideCallback:(CourseDescHideCallback)callback;
+
 - (void)displayCourseTypeIndex:(NSInteger)index;
 
 - (void)showInView:(UIView *)displayView;

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

@@ -24,6 +24,8 @@
 
 @property (nonatomic, strong) NSMutableArray *showArray;
 
+@property (nonatomic, copy) CourseDescHideCallback callback;
+
 @end
 
 @implementation CourseDescAlertView
@@ -51,6 +53,11 @@
     [self.baseScroll reloadData];
 }
 
+- (void)hideCallback:(CourseDescHideCallback)callback {
+    if (callback) {
+        self.callback = callback;
+    }
+}
 - (void)displayCourseTypeIndex:(NSInteger)index {
     self.displayIndex = index;
     [self.baseScroll scrollToItemAtIndex:index animate:YES];
@@ -70,6 +77,9 @@
 }
 
 - (IBAction)removeView:(id)sender {
+    if (self.callback) {
+        self.callback();
+    }
     [self removeFromSuperview];
 }
 

+ 1 - 1
KulexiuForStudent/KulexiuForStudent/Module/Home/ArrangeCourse/View/LiveCourseArrangeCell.xib

@@ -129,7 +129,7 @@
                                 </constraints>
                                 <userDefinedRuntimeAttributes>
                                     <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
-                                        <real key="value" value="10"/>
+                                        <real key="value" value="13"/>
                                     </userDefinedRuntimeAttribute>
                                 </userDefinedRuntimeAttributes>
                             </imageView>

+ 1 - 2
KulexiuForStudent/KulexiuForStudent/Module/Mine/Homework/Controller/HomeworkDetailViewController.m

@@ -71,7 +71,6 @@
     [super viewDidLoad];
     // Do any additional setup after loading the view.
     [self allocTitle:@"作业详情"];
-    [self setupUI];
     [self requestCourseMessage];
     _isModify = NO;
 }
@@ -131,7 +130,7 @@
         self.bottomView.sureButton.backgroundColor = THEMECOLOR;
         [self.bottomView.sureButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
     }
-    
+    [self setupUI];
     [self.tableView reloadData];
 }