GameDistributionCell.m 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. //
  2. // GameDistributionCell.m
  3. // BuguLive
  4. //
  5. // Created by 王珂 on 17/4/5.
  6. // Copyright © 2017年 xfg. All rights reserved.
  7. //
  8. #import "GameDistributionCell.h"
  9. @implementation GameDistributionCell
  10. - (void)awakeFromNib
  11. {
  12. [super awakeFromNib];
  13. self.headImageView.layer.cornerRadius =20;
  14. self.headImageView.layer.masksToBounds = YES;
  15. self.nameLabel.textColor = kAppGrayColor1;
  16. self.incomeLabel.textColor = kAppGrayColor1;
  17. self.lineView.backgroundColor = kAppSpaceColor3;
  18. }
  19. + (instancetype)cellWithTableView:(UITableView *)tableView
  20. {
  21. static NSString *ID = @"gameDistrCell";
  22. GameDistributionCell * cell = [tableView dequeueReusableCellWithIdentifier:ID];
  23. if (cell == nil) {
  24. cell = [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self) owner:nil options:nil] lastObject];
  25. }
  26. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  27. return cell;
  28. }
  29. - (void)setModel:(GameUserModel *)model
  30. {
  31. _model = model;
  32. //如果是上级则隐藏其收益相关的信息
  33. //self.icomeStyleImg.hidden = model.isParent;
  34. self.icomeStyleImg.hidden = YES;
  35. self.incomeLabel.hidden = model.isParent;
  36. [self.headImageView sd_setImageWithURL:[NSURL URLWithString:model.head_image] placeholderImage:kDefaultPreloadHeadImg];
  37. NSString *nameString;
  38. if (model.nick_name.length < 1)
  39. {
  40. nameString = ASLocalizedString(@"暂时还未命名");
  41. }else
  42. {
  43. nameString = model.nick_name;
  44. }
  45. self.nameLabel.text = nameString;
  46. self.incomeLabel.text = model.sum;
  47. }
  48. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  49. [super setSelected:selected animated:animated];
  50. // Configure the view for the selected state
  51. }
  52. @end