SendInfoGroupCell.m 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. //
  2. // SendInfoGroupCell.m
  3. // smartRhino
  4. //
  5. // Created by tederen on 2019/11/4.
  6. // Copyright © 2019 tederen. All rights reserved.
  7. //
  8. #import "SendInfoGroupCell.h"
  9. #import "DepartmentModel.h"
  10. @interface SendInfoGroupCell()
  11. @property (nonatomic, strong)DepartmentModel *model;
  12. @property (nonatomic, strong) NSIndexPath *index;
  13. @property (nonatomic, strong)SelectModel *userModel;
  14. @end
  15. @implementation SendInfoGroupCell
  16. - (void)loadDataModel:(DepartmentModel *)model indexWith:(nonnull NSIndexPath *)index{
  17. self.model = model;
  18. self.index = index;
  19. if (model.hadSelected) {
  20. self.selectbuton.selected = YES;
  21. }else{
  22. self.selectbuton.selected = NO;
  23. }
  24. self.iconImageView.image = IMG(@"王丽");
  25. self.nameLab.text = model.Name;
  26. self.rightImgeView.hidden = (model.hasSon == 1)? NO: YES;
  27. }
  28. - (void)loadDataDepartUserModel:(SelectModel *)model indexWith:(NSIndexPath *)index{
  29. self.index = index;
  30. self.userModel = model;
  31. self.selectbuton.selected = model.hadSelected;
  32. [self.iconImageView setImageWithURL:[NSURL URLWithString:model.AvatarUrl] placeholder:IMG(@"王丽")];
  33. self.nameLab.text = model.UserName;
  34. }
  35. //- (IBAction)button:(UIButton *)sender {
  36. // self.selectbuton.selected = !self.selectbuton.selected;
  37. // if (self.selectbuton.selected == YES) {
  38. // if ([self.delegate respondsToSelector:@selector(selectCellback:withIndexRow:)]) {
  39. // [self.delegate selectCellback:self.model withIndexRow:self.index];
  40. // }
  41. // if ([self.delegate respondsToSelector:@selector(selectCellbackDepartUserModel:withIndexRow:)]) {
  42. // [self.delegate selectCellbackDepartUserModel:self.userModel withIndexRow:self.index];
  43. // }
  44. // }else{
  45. // if ([self.delegate respondsToSelector:@selector(noSelectCellback:withIndexRow:)]) {
  46. // [self.delegate noSelectCellback:self.model withIndexRow:self.index];
  47. // }
  48. // if ([self.delegate respondsToSelector:@selector(noSelectCellbackDepartUserModel:withIndexRow:)]) {
  49. // [self.delegate noSelectCellbackDepartUserModel:self.userModel withIndexRow:self.index];
  50. // }
  51. // }
  52. //}
  53. - (void)awakeFromNib {
  54. [super awakeFromNib];
  55. [self.selectbuton setCurrentButtonHotSize:CGSizeZero];
  56. }
  57. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  58. [super setSelected:selected animated:animated];
  59. }
  60. - (DepartmentModel *)model{
  61. if (!_model) {
  62. _model = [[DepartmentModel alloc] init];
  63. }
  64. return _model;
  65. }
  66. - (NSIndexPath *)index{
  67. if (!_index) {
  68. _index = [[NSIndexPath alloc] init];
  69. }
  70. return _index;
  71. }
  72. - (SelectModel *)userModel{
  73. if (!_userModel) {
  74. _userModel = [[SelectModel alloc] init];
  75. }
  76. return _userModel;
  77. }
  78. @end