YOUPAIHRChatRoomWindowCell.m 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. //
  2. // YOUPAIHRChatRoomWindowCell.m
  3. // VQU
  4. //
  5. // Created by xiaohaoran on 2021/11/6.
  6. // Copyright © 2021 MS. All rights reserved.
  7. //
  8. #import "YOUPAIHRChatRoomWindowCell.h"
  9. @interface YOUPAIHRChatRoomWindowCell ()
  10. @property(nonatomic,strong)UIImageView *youpaipiconImage;
  11. @property(nonatomic,strong)UILabel *youpaiproomNameLabel;
  12. @property(nonatomic,strong)UILabel *youpaipIDLabel;
  13. @end
  14. @implementation YOUPAIHRChatRoomWindowCell
  15. -(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
  16. if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
  17. [self youpaifsetSubView];
  18. }
  19. return self;
  20. }
  21. -(void)youpaifsetSubView{
  22. //头像
  23. UIImageView *youpaipiconImage = [UIImageView new];
  24. self.youpaipiconImage =youpaipiconImage;
  25. [self.contentView addSubview:youpaipiconImage];
  26. [youpaipiconImage mas_makeConstraints:^(MASConstraintMaker *make) {
  27. make.left.mas_equalTo(14);
  28. make.centerY.mas_equalTo(0);
  29. make.size.mas_equalTo(CGSizeMake(40, 40));
  30. }];
  31. // youpaipiconImage.image = [UIImage imageNamed:@"AppIcon"];
  32. youpaipiconImage.layer.cornerRadius = 20;
  33. youpaipiconImage.clipsToBounds = YES;
  34. youpaipiconImage.contentMode = UIViewContentModeScaleAspectFill;
  35. //房间名
  36. UILabel *youpaiproomNameLabel = [UILabel new];
  37. self.youpaiproomNameLabel =youpaiproomNameLabel;
  38. [self.contentView addSubview:youpaiproomNameLabel];
  39. [youpaiproomNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  40. make.left.mas_equalTo(youpaipiconImage.mas_right).offset(8);
  41. make.centerY.mas_equalTo(0);
  42. }];
  43. // youpaiproomNameLabel.text = @"湖南吴彦祖";
  44. youpaiproomNameLabel.textColor = [UIColor whiteColor];
  45. youpaiproomNameLabel.font = LCBoldFont(14);
  46. //房间id
  47. UILabel *youpaipIDLabel = [UILabel new];
  48. self.youpaipIDLabel =youpaipIDLabel;
  49. [self.contentView addSubview:youpaipIDLabel];
  50. [youpaipIDLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  51. make.right.mas_equalTo(-14);
  52. make.centerY.mas_equalTo(0);
  53. }];
  54. // youpaipIDLabel.text = @"ID:54332";
  55. youpaipIDLabel.textColor = HexColorFromRGB(0x9F9DA5);
  56. youpaipIDLabel.font = [UIFont systemFontOfSize:12];
  57. //分割线
  58. UIView *lineView = [UIView new];
  59. [self.contentView addSubview:lineView];
  60. [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
  61. make.bottom.mas_equalTo(0);
  62. make.left.mas_equalTo(14);
  63. make.right.mas_equalTo(-14);
  64. make.height.mas_equalTo(0.5);
  65. }];
  66. lineView.backgroundColor = HexColorFromRGBA(0x4F4B5B, 0.3);
  67. }
  68. -(void)setYoupaipmodel:(YOUPAIHRChatRoomWindowModel *)youpaipmodel{
  69. _youpaipmodel = youpaipmodel;
  70. [self.youpaipiconImage sd_setImageWithURL:[LCTools getImageUrlWithAddress:youpaipmodel.youpaipcover_img] placeholderImage:nil];
  71. self.youpaiproomNameLabel.text = youpaipmodel.youpaiptitle;
  72. self.youpaipIDLabel.text = [NSString stringWithFormat:@"ID:%ld",youpaipmodel.youpaiproom_id];
  73. }
  74. @end