123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- //
- // SendInfoGroupCell.m
- // smartRhino
- //
- // Created by tederen on 2019/11/4.
- // Copyright © 2019 tederen. All rights reserved.
- //
- #import "SendInfoGroupCell.h"
- #import "DepartmentModel.h"
- @interface SendInfoGroupCell()
- @property (nonatomic, strong)DepartmentModel *model;
- @property (nonatomic, strong) NSIndexPath *index;
- @property (nonatomic, strong)SelectModel *userModel;
- @end
- @implementation SendInfoGroupCell
- - (void)loadDataModel:(DepartmentModel *)model indexWith:(nonnull NSIndexPath *)index{
- self.model = model;
- self.index = index;
- if (model.hadSelected) {
- self.selectbuton.selected = YES;
- }else{
- self.selectbuton.selected = NO;
- }
- self.iconImageView.image = IMG(@"王丽");
- self.nameLab.text = model.Name;
- self.rightImgeView.hidden = (model.hasSon == 1)? NO: YES;
-
- }
- - (void)loadDataDepartUserModel:(SelectModel *)model indexWith:(NSIndexPath *)index{
- self.index = index;
- self.userModel = model;
- self.selectbuton.selected = model.hadSelected;
- [self.iconImageView setImageWithURL:[NSURL URLWithString:model.AvatarUrl] placeholder:IMG(@"王丽")];
- self.nameLab.text = model.UserName;
- }
- //- (IBAction)button:(UIButton *)sender {
- // self.selectbuton.selected = !self.selectbuton.selected;
- // if (self.selectbuton.selected == YES) {
- // if ([self.delegate respondsToSelector:@selector(selectCellback:withIndexRow:)]) {
- // [self.delegate selectCellback:self.model withIndexRow:self.index];
- // }
- // if ([self.delegate respondsToSelector:@selector(selectCellbackDepartUserModel:withIndexRow:)]) {
- // [self.delegate selectCellbackDepartUserModel:self.userModel withIndexRow:self.index];
- // }
- // }else{
- // if ([self.delegate respondsToSelector:@selector(noSelectCellback:withIndexRow:)]) {
- // [self.delegate noSelectCellback:self.model withIndexRow:self.index];
- // }
- // if ([self.delegate respondsToSelector:@selector(noSelectCellbackDepartUserModel:withIndexRow:)]) {
- // [self.delegate noSelectCellbackDepartUserModel:self.userModel withIndexRow:self.index];
- // }
- // }
- //}
- - (void)awakeFromNib {
- [super awakeFromNib];
- [self.selectbuton setCurrentButtonHotSize:CGSizeZero];
- }
- - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
- [super setSelected:selected animated:animated];
- }
- - (DepartmentModel *)model{
- if (!_model) {
- _model = [[DepartmentModel alloc] init];
- }
- return _model;
- }
- - (NSIndexPath *)index{
- if (!_index) {
- _index = [[NSIndexPath alloc] init];
- }
- return _index;
- }
- - (SelectModel *)userModel{
- if (!_userModel) {
- _userModel = [[SelectModel alloc] init];
- }
- return _userModel;
- }
- @end
|