// // YOUPAIHRChatRoomWindowCell.m // VQU // // Created by xiaohaoran on 2021/11/6. // Copyright © 2021 MS. All rights reserved. // #import "YOUPAIHRChatRoomWindowCell.h" @interface YOUPAIHRChatRoomWindowCell () @property(nonatomic,strong)UIImageView *youpaipiconImage; @property(nonatomic,strong)UILabel *youpaiproomNameLabel; @property(nonatomic,strong)UILabel *youpaipIDLabel; @end @implementation YOUPAIHRChatRoomWindowCell -(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{ if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { [self youpaifsetSubView]; } return self; } -(void)youpaifsetSubView{ //头像 UIImageView *youpaipiconImage = [UIImageView new]; self.youpaipiconImage =youpaipiconImage; [self.contentView addSubview:youpaipiconImage]; [youpaipiconImage mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(14); make.centerY.mas_equalTo(0); make.size.mas_equalTo(CGSizeMake(40, 40)); }]; // youpaipiconImage.image = [UIImage imageNamed:@"AppIcon"]; youpaipiconImage.layer.cornerRadius = 20; youpaipiconImage.clipsToBounds = YES; youpaipiconImage.contentMode = UIViewContentModeScaleAspectFill; //房间名 UILabel *youpaiproomNameLabel = [UILabel new]; self.youpaiproomNameLabel =youpaiproomNameLabel; [self.contentView addSubview:youpaiproomNameLabel]; [youpaiproomNameLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(youpaipiconImage.mas_right).offset(8); make.centerY.mas_equalTo(0); }]; // youpaiproomNameLabel.text = @"湖南吴彦祖"; youpaiproomNameLabel.textColor = [UIColor whiteColor]; youpaiproomNameLabel.font = LCBoldFont(14); //房间id UILabel *youpaipIDLabel = [UILabel new]; self.youpaipIDLabel =youpaipIDLabel; [self.contentView addSubview:youpaipIDLabel]; [youpaipIDLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.right.mas_equalTo(-14); make.centerY.mas_equalTo(0); }]; // youpaipIDLabel.text = @"ID:54332"; youpaipIDLabel.textColor = HexColorFromRGB(0x9F9DA5); youpaipIDLabel.font = [UIFont systemFontOfSize:12]; //分割线 UIView *lineView = [UIView new]; [self.contentView addSubview:lineView]; [lineView mas_makeConstraints:^(MASConstraintMaker *make) { make.bottom.mas_equalTo(0); make.left.mas_equalTo(14); make.right.mas_equalTo(-14); make.height.mas_equalTo(0.5); }]; lineView.backgroundColor = HexColorFromRGBA(0x4F4B5B, 0.3); } -(void)setYoupaipmodel:(YOUPAIHRChatRoomWindowModel *)youpaipmodel{ _youpaipmodel = youpaipmodel; [self.youpaipiconImage sd_setImageWithURL:[LCTools getImageUrlWithAddress:youpaipmodel.youpaipcover_img] placeholderImage:nil]; self.youpaiproomNameLabel.text = youpaipmodel.youpaiptitle; self.youpaipIDLabel.text = [NSString stringWithFormat:@"ID:%ld",youpaipmodel.youpaiproom_id]; } @end