소스 검색

课程规划不存在时隐藏

Steven 4 달 전
부모
커밋
e2aa905106

+ 3 - 32
KulexiuForStudent/KulexiuForStudent/Module/Course/MusicRoom/View/MusicRoomGroupHeadView.m

@@ -27,8 +27,6 @@
 
 @property (weak, nonatomic) IBOutlet UIView *planContainer;
 
-@property (nonatomic, strong) CourseGroupPlanAddView *addView;
-
 @property (nonatomic, strong) CourseGroupPlanDescView *planDescView;
 
 @property (nonatomic, copy) ProgramPlanAction callback;
@@ -46,16 +44,7 @@
 
 - (void)configWithSource:(StudentCourseGroupDetailModel *)model {
     [self.planContainer removeAllSubViews];
-    if ([NSString isEmptyString:model.coursePlan]) {
-        [self.planContainer addSubview:self.addView];
-        CGFloat addViewHeight = [CourseGroupPlanAddView getViewHeight];
-        [self.addView mas_makeConstraints:^(MASConstraintMaker *make) {
-            make.top.bottom.right.left.mas_equalTo(self.planContainer);
-            make.height.mas_equalTo(addViewHeight);
-        }];
-        self.bgView.backgroundColor = [UIColor whiteColor];
-    }
-    else {
+    if (![NSString isEmptyString:model.coursePlan]) {
         CGFloat planHeight = [CourseGroupPlanDescView getViewHeight:model.coursePlan];
         self.bgView.backgroundColor = [UIColor clearColor];
         [self.planContainer addSubview:self.planDescView];
@@ -65,6 +54,7 @@
         }];
         [self.planDescView configWithPlanDesc:model.coursePlan];
     }
+    
     self.courseGroupTitle.text = [NSString returnNoNullStringWithString:model.courseGroupName];
     /// 状态
     [self evaluateGroupStatus:model.status];
@@ -118,40 +108,21 @@
 
 + (CGFloat)getViewHeightWithPlanString:(NSString *)planString {
     if ([NSString isEmptyString:planString]) {
-        return 106.0f + [CourseGroupPlanAddView getViewHeight];
+        return 106.0f;
     }
     else {
         return 106.0f + [CourseGroupPlanDescView getViewHeight:planString];
     }
 }
 
-- (CourseGroupPlanAddView *)addView {
-    if (!_addView) {
-        _addView = [CourseGroupPlanAddView sharedInstance];
-        MJWeakSelf;
-        [_addView addPlanAction:^{
-            [weakSelf showPlanView];
-        }];
-    }
-    return _addView;
-}
 
 - (CourseGroupPlanDescView *)planDescView {
     if (!_planDescView) {
         _planDescView = [CourseGroupPlanDescView sharedInstance];
-        MJWeakSelf;
-        [_planDescView modifyPlanAction:^{
-            [weakSelf showPlanView];
-        }];
     }
     return _planDescView;
 }
 
-- (void)showPlanView {
-    if (self.callback) {
-        self.callback();
-    }
-}
 /*
 // Only override drawRect: if you perform custom drawing.
 // An empty implementation adversely affects performance during animation.

+ 4 - 33
KulexiuForStudent/KulexiuForStudent/Module/Course/VipCourse/View/ProgramCourseInfoView.m

@@ -29,8 +29,6 @@
 
 @property (weak, nonatomic) IBOutlet UIView *planContainer;
 
-@property (nonatomic, strong) CourseGroupPlanAddView *addView;
-
 @property (nonatomic, strong) CourseGroupPlanDescView *planDescView;
 
 @property (nonatomic, copy) ProgramPlanAction callback;
@@ -47,18 +45,9 @@
 
 - (void)configWithSource:(StudentCourseGroupDetailModel *)model {
     [self.planContainer removeAllSubViews];
-    if ([NSString isEmptyString:model.coursePlan]) {
-        [self.planContainer addSubview:self.addView];
-        CGFloat addViewHeight = [CourseGroupPlanAddView getViewHeight];
-        [self.addView mas_makeConstraints:^(MASConstraintMaker *make) {
-            make.top.bottom.right.left.mas_equalTo(self.planContainer);
-            make.height.mas_equalTo(addViewHeight);
-        }];
-        self.bgView.backgroundColor = [UIColor whiteColor];
-    }
-    else {
+    if (![NSString isEmptyString:model.coursePlan]) {
         CGFloat planHeight = [CourseGroupPlanDescView getViewHeight:model.coursePlan];
-        self.bgView.backgroundColor = [UIColor clearColor];
+
         [self.planContainer addSubview:self.planDescView];
         [self.planDescView mas_makeConstraints:^(MASConstraintMaker *make) {
             make.left.right.top.bottom.mas_equalTo(self.planContainer);
@@ -66,6 +55,7 @@
         }];
         [self.planDescView configWithPlanDesc:model.coursePlan];
     }
+    
     self.courseGroupTitle.text = [NSString returnNoNullStringWithString:model.courseGroupName];
     /// 状态
     [self evaluateGroupStatus:model.status];
@@ -120,40 +110,21 @@
 
 + (CGFloat)getViewHeightWithPlanString:(NSString *)planString {
     if ([NSString isEmptyString:planString]) {
-        return 106.0f + [CourseGroupPlanAddView getViewHeight];
+        return 106.0f;
     }
     else {
         return 106.0f + [CourseGroupPlanDescView getViewHeight:planString];
     }
 }
 
-- (CourseGroupPlanAddView *)addView {
-    if (!_addView) {
-        _addView = [CourseGroupPlanAddView sharedInstance];
-        MJWeakSelf;
-        [_addView addPlanAction:^{
-            [weakSelf showPlanView];
-        }];
-    }
-    return _addView;
-}
 
 - (CourseGroupPlanDescView *)planDescView {
     if (!_planDescView) {
         _planDescView = [CourseGroupPlanDescView sharedInstance];
-        MJWeakSelf;
-        [_planDescView modifyPlanAction:^{
-            [weakSelf showPlanView];
-        }];
     }
     return _planDescView;
 }
 
-- (void)showPlanView {
-    if (self.callback) {
-        self.callback();
-    }
-}
 
 /*
 // Only override drawRect: if you perform custom drawing.