|
@@ -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.
|