managerFriendTableViewCell.m 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. //
  2. // managerFriendTableViewCell.m
  3. // BuguLive
  4. //
  5. // Created by fanwe2014 on 16/6/30.
  6. // Copyright © 2016年 xfg. All rights reserved.
  7. //
  8. #import "managerFriendTableViewCell.h"
  9. #import "SenderModel.h"
  10. @implementation managerFriendTableViewCell
  11. - (void)awakeFromNib
  12. {
  13. [super awakeFromNib];
  14. self.headImgView.layer.cornerRadius = 25*kAppRowHScale;
  15. self.headImgView.layer.masksToBounds = YES;
  16. self.rightImgView.layer.cornerRadius = 15*kAppRowHScale;
  17. self.rightImgView.layer.masksToBounds = YES;
  18. self.nameLabel.textColor = kAppGrayColor1;
  19. self.commentLabel.textColor = kAppGrayColor3;
  20. self.lineView.backgroundColor = kAppSpaceColor4;
  21. }
  22. - (void)creatCellWithModel:(SenderModel *)model
  23. {
  24. [self.headImgView sd_setImageWithURL:[NSURL URLWithString:model.head_image] placeholderImage:kDefaultPreloadHeadImg];
  25. if (model.nick_name.length < 1)
  26. {
  27. model.nick_name = ASLocalizedString(@"暂时还未命名");
  28. }
  29. self.nameLabel.textColor = kAppGrayColor1;
  30. NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:model.nick_name];
  31. self.nameLabel.attributedText = attr;
  32. if ([model.sex isEqualToString:@"1"])
  33. {
  34. self.sexImgView.image = [UIImage imageNamed:@"com_male_selected"];
  35. }else
  36. {
  37. self.sexImgView.image = [UIImage imageNamed:@"com_female_selected"];
  38. }
  39. self.rankImgView.image = [UIImage imageNamed:[NSString stringWithFormat:@"level%d",(int)model.user_level]];
  40. self.commentLabel.textColor = [UIColor blackColor];
  41. if (model.signature.length < 1)
  42. {
  43. self.commentLabel.text = @"";
  44. }else
  45. {
  46. NSMutableAttributedString *attr1 = [[NSMutableAttributedString alloc] initWithString:model.signature];
  47. self.commentLabel.attributedText = attr1;
  48. }
  49. }
  50. @end