GroupSquareCell.m 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. //
  2. // GroupSquareCell.m
  3. // smartRhino
  4. //
  5. // Created by niuzhen on 2020/5/6.
  6. // Copyright © 2020 tederen. All rights reserved.
  7. //
  8. #import "GroupSquareCell.h"
  9. @implementation GroupSquareCell
  10. - (void)awakeFromNib {
  11. [super awakeFromNib];
  12. self.JoinBtn.layer.cornerRadius = 2.f;
  13. self.JoinBtn.layer.borderWidth = 0.5f;
  14. self.JoinBtn.layer.borderColor = UIColorHex(0x13A3FF).CGColor;
  15. self.JoinBtn.layer.masksToBounds = YES;
  16. }
  17. + (CGFloat)configCell0Height
  18. {
  19. return 60.f;
  20. }
  21. + (CGFloat)configCell1Height
  22. {
  23. return 98.f;
  24. }
  25. + (GroupSquareCell *)configCell0:(UITableView *)tableView indexPath:(NSIndexPath *)indexPath{
  26. static NSString *cellIdentifer = @"GroupSquareCell0";
  27. GroupSquareCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifer];
  28. if (cell == nil) {
  29. cell = [[[NSBundle mainBundle] loadNibNamed:@"GroupSquareCell" owner:nil options:nil] objectAtIndex:0];
  30. }
  31. return cell;
  32. }
  33. + (GroupSquareCell *)configCell1:(UITableView *)tableView indexPath:(NSIndexPath *)indexPath{
  34. static NSString *cellIdentifer = @"GroupSquareCell1";
  35. GroupSquareCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifer];
  36. if (cell == nil) {
  37. cell = [[[NSBundle mainBundle] loadNibNamed:@"GroupSquareCell" owner:nil options:nil] objectAtIndex:1];
  38. }
  39. return cell;
  40. }
  41. - (void)setLeftDataModel:(GroupSquareModel *)model
  42. {
  43. self.BlueView.hidden = !model.isSelect;
  44. if (model.isSelect) {
  45. self.NameL.textColor = UIColorHex(0x262626);
  46. self.contentView.backgroundColor = UIColorHex(0xffffff);
  47. self.NameL.font = [UIFont systemFontOfSize:15];
  48. }else{
  49. self.NameL.textColor = UIColorHex(0x333333);
  50. self.contentView.backgroundColor = UIColorHex(0xF2F2F2);
  51. self.NameL.font = [UIFont systemFontOfSize:13];
  52. }
  53. self.NameL.text = model.Title;
  54. }
  55. - (void)setRightDataModel:(GroupSquareModel *)model
  56. {
  57. self.titleL.text = model.Title;
  58. self.userCountL.text = @"1.8k";
  59. self.TopicCountL.text = @"326";
  60. self.subTitleL.text = model.Des;
  61. }
  62. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  63. [super setSelected:selected animated:animated];
  64. // Configure the view for the selected state
  65. }
  66. @end