zjf
2023-03-13 881f0da670f20c401c1e1d08b36253abb28f72d2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//
//  PBSchedulePlanTableViewCell.m
//  IphoneBIMe
//
//  Created by ZhangJF on 2022/8/22.
//  Copyright © 2022 ProBIM. All rights reserved.
//
 
#import "PBSchedulePlanTableViewCell.h"
#import "PBSchedulePlanModel.h"
 
@interface PBSchedulePlanTableViewCell()
@property (nonatomic, weak) UILabel *nameL;
 
@end
@implementation PBSchedulePlanTableViewCell
 
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self setupUI];
    }
    return self;
}
- (void)setupUI {
    self.contentView.backgroundColor = PBColor(243, 243, 244);
    UIView *bgView = [[UIView alloc] init];
    bgView.backgroundColor = [UIColor whiteColor];
    [self.contentView addSubview:bgView];
    [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).offset(16);
        make.left.equalTo(self.contentView).offset(16);
        make.right.equalTo(self.contentView).offset(-16);
        make.height.equalTo(@56);
    }];
    bgView.layer.cornerRadius = 6;
    [bgView.layer setMasksToBounds:YES];
    
    UILabel *nameL = [UILabel z_labelWithText:@"" Color:PBColor(51, 51, 51) isBold:YES Font:16];
    [self.contentView addSubview:nameL];
    [nameL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.equalTo(@16);
        make.left.equalTo(bgView).offset(20);
        make.right.equalTo(bgView).offset(-40);
        make.centerY.equalTo(bgView);
    }];
    UIImageView *nextLevel = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"nextLevel"]];
    [self.contentView addSubview:nextLevel];
    [nextLevel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(bgView);
        make.right.equalTo(bgView).offset(-20);
        make.size.mas_equalTo(CGSizeMake(16, 12));
    }];
  
    self.nameL = nameL;
    
}
-(void)setPlanModel:(PBSchedulePlanModel *)planModel {
    _planModel = planModel;
    self.nameL.text = planModel.Name;
}
 
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
 
    // Configure the view for the selected state
}
 
@end