// // MyTDGroupCell.m // smartRhino // // Created by tederen on 2019/10/31. // Copyright © 2019 tederen. All rights reserved. // #import "MyTDGroupCell.h" @interface MyTDGroupCell() @property (nonatomic, strong) UIImageView *iconImageView; @property (nonatomic, strong) UILabel *groupNameLab; @property (nonatomic, strong) UILabel *shareNumLab; @property (nonatomic, strong) UILabel *myNewTopicLab; @property (nonatomic, strong) UILabel *countNumberLab; @property (nonatomic, strong) UIImageView *rightImage; @property (nonatomic, strong) UIView * lineView; @end @implementation MyTDGroupCell - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{ self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if(self){ //////DRTJFHCGHVGHVGMMVG [self addSubview:self.iconImageView]; [self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) { make.width.height.mas_equalTo(44); make.top.left.equalTo(self.contentView).offset(10); }]; [self addSubview:self.groupNameLab]; [self.groupNameLab mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.iconImageView.mas_right).offset(10); make.top.equalTo(self.iconImageView.mas_top).offset(2); }]; [self addSubview:self.shareNumLab]; [self.shareNumLab mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.iconImageView.mas_right).offset(10); make.top.equalTo(self.groupNameLab.mas_bottom).offset(10); }]; [self addSubview:self.myNewTopicLab]; [self.myNewTopicLab mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.shareNumLab.mas_right).offset(23); make.top.equalTo(self.shareNumLab.mas_top).offset(0); }]; [self addSubview:self.rightImage]; [self.rightImage mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(self.contentView).offset(17); make.left.equalTo(self.contentView).offset(kGXScreenWidth - 20); make.width.mas_equalTo(6.5); make.height.mas_equalTo(11.5); }]; [self addSubview:self.countNumberLab]; [self.countNumberLab mas_makeConstraints:^(MASConstraintMaker *make) { make.right.equalTo(self.rightImage.mas_left).offset(-3); make.centerY.equalTo(self.rightImage); }]; [self addSubview:self.lineView]; [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self).offset(65); make.bottom.equalTo(self).offset(0); make.right.equalTo(self); make.height.mas_equalTo(0.5); }]; } return self; } - (void)loadGroupData:(NoticeModel *)model{ [self.iconImageView sd_setImageWithURL:[NSURL URLWithString:model.AvatarUrl] placeholderImage:kUserDefaultHeadImage]; self.groupNameLab.text = model.GroupName; self.shareNumLab.text = [NSString stringWithFormat:@"共享给%ld人",model.TopicSharingCount]; self.myNewTopicLab.text = [NSString stringWithFormat:@"【%ld条新话题】",model.UReadTopicCount]; self.countNumberLab.text = [NSString stringWithFormat:@"%ld",model.TopicAllCount]; } #pragma mark - setter - (UIImageView *)iconImageView{ if (!_iconImageView) { _iconImageView = [UIImageView new]; } return _iconImageView; } - (UILabel *)groupNameLab{ if (!_groupNameLab) { _groupNameLab = [[UILabel alloc]init]; _groupNameLab.textColor = UIColorHex(333333); _groupNameLab.font = [UIFont systemFontOfSize:15.f]; } return _groupNameLab; } - (UILabel *)shareNumLab{ if (!_shareNumLab) { _shareNumLab = [[UILabel alloc]init ]; _shareNumLab.textColor = UIColorHex(333333); _shareNumLab.font = [UIFont systemFontOfSize:12.f]; } return _shareNumLab; } - (UILabel *)myNewTopicLab{ if (!_myNewTopicLab) { _myNewTopicLab = [UILabel new]; _myNewTopicLab.textColor = UIColorHex(FFAE34); _myNewTopicLab.font = [UIFont systemFontOfSize:12.f]; } return _myNewTopicLab; } - (UILabel *)countNumberLab{ if (!_countNumberLab) { _countNumberLab = [UILabel new]; _countNumberLab.textColor = UIColorHex(333333); _countNumberLab.font = [UIFont systemFontOfSize:12.f]; } return _countNumberLab; } - (UIImageView *)rightImage{ if (!_rightImage) { _rightImage = [UIImageView new]; _rightImage.image = IMG(@"right_img"); } return _rightImage; } - (UIView *)lineView{ if (!_lineView) { _lineView = [[UIView alloc]init]; _lineView.backgroundColor = LINEBGCOLOR; } return _lineView; } @end