CommonListCell.m 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. //
  2. // CommonListCell.m
  3. // smartRhino
  4. //
  5. // Created by niuzhen on 2020/4/28.
  6. // Copyright © 2020 tederen. All rights reserved.
  7. //
  8. #import "CommonListCell.h"
  9. @implementation CommonListCell
  10. - (void)awakeFromNib {
  11. [super awakeFromNib];
  12. // Initialization code
  13. }
  14. + (CGFloat)configCell0Height{
  15. return 72;
  16. }
  17. + (CommonListCell *)configCell0:(UITableView *)tableView indexPath:(NSIndexPath *)indexPath{
  18. static NSString *cellIdentifer = @"CommonListCell0";
  19. CommonListCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifer];
  20. if (cell == nil) {
  21. cell = [[[NSBundle mainBundle] loadNibNamed:@"CommonListCell" owner:nil options:nil] objectAtIndex:0];
  22. }
  23. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  24. return cell;
  25. }
  26. + (CommonListCell *)configCell1:(UITableView *)tableView indexPath:(NSIndexPath *)indexPath{
  27. static NSString *cellIdentifer = @"CommonListCell1";
  28. CommonListCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifer];
  29. if (cell == nil) {
  30. cell = [[[NSBundle mainBundle] loadNibNamed:@"CommonListCell" owner:nil options:nil] objectAtIndex:1];
  31. }
  32. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  33. return cell;
  34. }
  35. - (void)setCell1Data:(MyFavoriteSubModel *)model
  36. {
  37. switch (model.CollectionType) {
  38. // 文章
  39. case CollectModel_Aritle:{
  40. [self.iconV sd_setImageWithURL:[NSURL URLWithString:model.Data.ArticleImgUrl.firstObject] placeholderImage:IMG(@"文章")];
  41. }break;
  42. // 话题 || 小组
  43. case CollectModel_Toipc:
  44. {
  45. self.iconV.image = IMG(@"话题");
  46. }break;
  47. case CollectModel_NewTopic:
  48. {
  49. self.iconV.image = IMG(@"话题");
  50. }break;
  51. case CollectModel_Group:{
  52. self.iconV.image = IMG(@"笔记小组");
  53. }break;
  54. // 收藏
  55. case CollectModel_Collect:{
  56. self.iconV.image = IMG(@"收藏");
  57. }break;
  58. // 笔记
  59. case CollectModel_NoteBook: {
  60. self.iconV.image = IMG(@"noteBook_icon");
  61. }break;
  62. case CollectModel_CollectFile:{
  63. self.iconV.image = IMG(@"find_1");
  64. }break;
  65. case CollectModel_NoteFile: {
  66. self.iconV.image = IMG(@"find_1");
  67. }break;
  68. // 通知 || 站内信
  69. case CollectModel_Notice:
  70. {
  71. self.iconV.image = IMG(@"通知图标");
  72. }break;
  73. case CollectModel_InterMail:{
  74. self.iconV.image = IMG(@"站内信");
  75. }break;
  76. // 会议
  77. case CollectModel_meetMian:{
  78. self.iconV.image = IMG(@"会议");
  79. }break;
  80. case CollectModel_meetDetail:{
  81. self.iconV.image = IMG(@"会议");
  82. }break;
  83. case CollectModel_file:{
  84. NSString * imageStr = [ZYCTool getFileNameImage:model.Data.FileName];
  85. if (imageStr.length == 0) {
  86. [self.iconV sd_setImageWithURL:[NSURL URLWithString:model.Data.MinFile]];
  87. }else{
  88. self.iconV.image = IMG(imageStr);
  89. }
  90. }break;
  91. case CollectModel_work:
  92. {
  93. self.iconV.image = IMG(@"审批");
  94. }
  95. break;
  96. case CollectModel_financeCount:
  97. {
  98. self.iconV.image = IMG(@"报表");
  99. }
  100. break;
  101. case CollectModel_affairsCount:
  102. {
  103. self.iconV.image = IMG(@"报表");
  104. }
  105. break;
  106. case CollectModel_publishCount:
  107. {
  108. self.iconV.image = IMG(@"报表");
  109. }
  110. break;
  111. default:{
  112. NSString * imageStr = [ZYCTool getFileNameImage:model.Data.FileName];
  113. if (imageStr.length == 0) {
  114. [self.iconV sd_setImageWithURL:[NSURL URLWithString:model.Data.MinFile]];
  115. }else{
  116. self.iconV.image = IMG(imageStr);
  117. }
  118. }break;
  119. }
  120. self.titleL.text = model.Data.Title;
  121. self.nameL.text = model.Data.Author;
  122. self.desL.text = model.FolderName;
  123. }
  124. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  125. [super setSelected:selected animated:animated];
  126. // Configure the view for the selected state
  127. }
  128. @end