AnchorCell.m 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. //
  2. // AnchorCell.m
  3. // BuguLive
  4. //
  5. // Created by 杨仁伟 on 2017/8/7.
  6. // Copyright © 2017年 xfg. All rights reserved.
  7. //
  8. #import "AnchorCell.h"
  9. @implementation AnchorCell
  10. - (void)awakeFromNib {
  11. [super awakeFromNib];
  12. self.anchorNameLbl.textColor = kAppGrayColor1;
  13. self.livingLbl.layer.cornerRadius = 8.5;
  14. self.livingLbl.clipsToBounds = YES;
  15. self.livingLbl.layer.borderWidth = 1;
  16. self.livingLbl.backgroundColor = RGBA(141, 153, 166, 0.5);
  17. self.livingLbl.layer.borderColor = [kWhiteColor colorWithAlphaComponent:0.8].CGColor;
  18. self.livingLbl.textColor = [kWhiteColor colorWithAlphaComponent:0.85];
  19. self.anchorImgH.constant = (kScreenW - kAppMargin2 * 4) / 3.0;
  20. self.predisentLbl.layer.cornerRadius = 8.5;
  21. self.predisentLbl.clipsToBounds = YES;
  22. self.predisentLbl.layer.borderWidth = 1;
  23. self.predisentLbl.layer.borderColor = [kWhiteColor colorWithAlphaComponent:0.8].CGColor;
  24. self.predisentLbl.textColor = [kWhiteColor colorWithAlphaComponent:0.85];
  25. self.predisentLbl.backgroundColor = RGBA(141, 153, 166, 0.5);
  26. }
  27. - (void)configCellMsg:(SociatyDetailModel *)model {
  28. [self.anchorImg sd_setImageWithURL:[NSURL URLWithString:model.user_image] placeholderImage:kDefaultPreloadHeadImg];
  29. self.gradeImg.image = [UIImage imageNamed:[NSString stringWithFormat:@"level%@",model.user_lv]];
  30. self.anchorNameLbl.text = model.user_name;
  31. if (model.user_position.intValue == 1)
  32. {
  33. self.livingLbl.text = ASLocalizedString(@"会长");
  34. self.livingLbl.hidden = NO;
  35. self.predisentLbl.hidden = model.live_in.intValue == 0 ? YES : NO;
  36. }
  37. else
  38. {
  39. self.livingLbl.text = ASLocalizedString(@"直播中");
  40. self.livingLbl.hidden = model.live_in.intValue == 0 ? YES : NO;
  41. self.predisentLbl.hidden = YES;
  42. }
  43. if ([model.user_sex intValue] == 1)
  44. {
  45. self.sexImg.image = [UIImage imageNamed:@"com_male_selected"];
  46. }
  47. else if ([model.user_sex intValue] == 2)
  48. {
  49. self.sexImg.image = [UIImage imageNamed:@"com_female_selected"];
  50. }
  51. }
  52. @end