zjf
2023-03-06 392b76515f40376b6d36f40a114850ef63650384
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
//
//  PBPersonCollectionViewCell.m
//  IphoneBIMe
//
//  Created by zjf on 2018/8/16.
//  Copyright © 2018年 ProBIM. All rights reserved.
//
 
#import "PBPersonCollectionViewCell.h"
@interface PBPersonCollectionViewCell()
@property (nonatomic, weak) UILabel *personNameL;
@end
@implementation PBPersonCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self setupUI];
    }
    return self;
}
- (void)setupUI {
    UILabel *personNameL = [UILabel z_labelWithText:@"" Color:WarningColor isBold:NO Font:12];
    personNameL.textAlignment = NSTextAlignmentCenter;
    [self.contentView addSubview:personNameL];
    [personNameL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).offset(8);
        make.bottom.equalTo(self.contentView).offset(-8);
        make.left.equalTo(self.contentView).offset(2);
        make.right.equalTo(self.contentView).offset(-2);
    }];
    self.personNameL = personNameL;
}
-(void)setName:(NSString *)name {
    _name = name;
    self.personNameL.text = name;
}
- (void)setRoleType:(RoleType)roleType {
    _roleType = roleType;
    if (roleType == CREATOR) {
        self.contentView.backgroundColor = [UIColor z_colorWithR:255 G:170 B:0 alpha:0.12];
        self.personNameL.textColor = WarningColor;
    }else {
        self.contentView.backgroundColor = [UIColor whiteColor];
        self.personNameL.textColor = PromptColor;
    }
}
@end