MessageCell.m 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //
  2. // MessageCell.m
  3. // iphoneLive
  4. //
  5. // Created by YunBao on 2018/7/13.
  6. // Copyright © 2018年 cat. All rights reserved.
  7. //
  8. #import "MessageListCell.h"
  9. #import "MessageListModel.h"
  10. @implementation MessageListCell
  11. - (void)awakeFromNib {
  12. [super awakeFromNib];
  13. // Initialization code
  14. }
  15. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  16. [super setSelected:selected animated:animated];
  17. // Configure the view for the selected state
  18. }
  19. +(MessageListCell*)cellWithTab:(UITableView *)tableView andIndexPath:(NSIndexPath*)indexPath {
  20. MessageListCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MessageCell"];
  21. if (!cell) {
  22. cell = [[[NSBundle mainBundle]loadNibNamed:@"MessageCell" owner:nil options:nil]objectAtIndex:0];
  23. cell.backgroundColor = CellRow_Cor;
  24. }
  25. return cell;
  26. }
  27. -(void)setModel:(MessageModel *)model {
  28. _model = model;
  29. [_iconIV sd_setImageWithURL:[NSURL URLWithString:_model.iconStr]];
  30. //官方标识
  31. if ([_model.uidStr isEqual:@""]) {
  32. _iconTag.hidden = NO;
  33. }else{
  34. _iconTag.hidden = YES;
  35. }
  36. _nameL.text = _model.unameStr;
  37. _detailL.text = _model.contentStr;
  38. _timeL.text = _model.timeStr;
  39. int num = [_model.unReadStr intValue];
  40. if (num > 0) {
  41. _redPoint.hidden = NO;
  42. }else{
  43. _redPoint.hidden = YES;
  44. }
  45. }
  46. @end