// // VideoMemberCollectionViewCell.m // LekangGuard // // Created by ecell on 2023/1/13. // #import "VideoMemberCollectionViewCell.h" @interface VideoMemberCollectionViewCell () @property (nonatomic ,weak) UIImageView *iconImg; @property (nonatomic ,weak) UILabel *titleLabel; @end @implementation VideoMemberCollectionViewCell - (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { self.backgroundColor = KKClearColor; [self subMemberCell]; } return self; } - (void)setModel:(MemberModel *)model { _model = model; if (model.phone.length <= 0 || model.relationShip.length <= 0) { self.iconImg.image = ImageName_(model.imgName); } else { self.iconImg.image = [UICommon getClickRelationshipImageWithCodeID:model.relationShipImageId deviceType:APIManager.sharedManager.deviceModel.deviceType]; self.titleLabel.text = GJText(model.relationShip); } } - (void)subMemberCell { UIImage *img = ImageName_(@"icon_add_members"); UIImageView *iconImg = [UICommon ui_imageView:CGRectZero fileName:@""]; self.iconImg = iconImg; [self.contentView addSubview:iconImg]; [iconImg mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(self.contentView).offset(Adapted(10)); make.centerX.equalTo(self.contentView); make.size.mas_equalTo(CGSizeMake(Adapted(img.size.width), Adapted(img.size.height))); }]; UILabel *titleLabel = [UICommon ui_label:CGRectZero lines:0 align:NSTextAlignmentCenter font:FontADA_(12) textColor:KKTextBlackColor text:@"" Radius:0]; self.titleLabel = titleLabel; [self.contentView addSubview:titleLabel]; [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(iconImg.mas_bottom).offset(5); make.centerX.equalTo(self.contentView); }]; } @end