公司电脑
2 years ago
24 changed files with 413 additions and 327 deletions
Binary file not shown.
@ -1,19 +0,0 @@
@@ -1,19 +0,0 @@
|
||||
//
|
||||
// FamilyTableViewCell.h
|
||||
// LekangGuard
|
||||
//
|
||||
// Created by ecell on 2022/11/28.
|
||||
//
|
||||
|
||||
#import "ZZTableViewCell.h" |
||||
|
||||
NS_ASSUME_NONNULL_BEGIN |
||||
|
||||
@class ContactsModel; |
||||
@interface FamilyTableViewCell : ZZTableViewCell |
||||
|
||||
@property (nonatomic ,strong) ContactsModel *contactsModel; |
||||
|
||||
@end |
||||
|
||||
NS_ASSUME_NONNULL_END |
@ -1,116 +0,0 @@
@@ -1,116 +0,0 @@
|
||||
// |
||||
// FamilyTableViewCell.m |
||||
// LekangGuard |
||||
// |
||||
// Created by ecell on 2022/11/28. |
||||
// |
||||
|
||||
#import "FamilyTableViewCell.h" |
||||
|
||||
@interface FamilyTableViewCell () |
||||
|
||||
/// 头像 |
||||
@property (nonatomic ,weak) UIImageView *iconImg; |
||||
|
||||
|
||||
@property (nonatomic ,weak) UILabel *typeLabel; |
||||
|
||||
/// 姓名 |
||||
@property (nonatomic ,weak) UILabel *nameLabel; |
||||
|
||||
/// 手机号 |
||||
@property (nonatomic ,weak) UILabel *phoneLabel; |
||||
|
||||
@end |
||||
|
||||
@implementation FamilyTableViewCell |
||||
|
||||
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier |
||||
{ |
||||
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; |
||||
if (self) |
||||
{ |
||||
self.selectionStyle = UITableViewCellSelectionStyleNone; |
||||
self.backgroundColor = KKWhiteColorColor; |
||||
[self subCellView]; |
||||
} |
||||
|
||||
return self; |
||||
} |
||||
|
||||
- (void)setContactsModel:(ContactsModel *)contactsModel |
||||
{ |
||||
_contactsModel = contactsModel; |
||||
self.iconImg.image = [UICommon getClickRelationshipImageWithCodeID:contactsModel.image deviceType:APIManager.sharedManager.deviceModel.deviceType]; |
||||
self.nameLabel.text = GJText(contactsModel.name); |
||||
self.phoneLabel.text = contactsModel.phone; |
||||
NSString *str; |
||||
if ([contactsModel.openId isEqualToString:APIManager.sharedManager.loginModel.openid] ) |
||||
{ |
||||
str = contactsModel.identity == 2 ? GJText(@"(我) 管理员") : GJText(@"(我)"); |
||||
} |
||||
else |
||||
{ |
||||
str = contactsModel.identity == 2 ? GJText(@"管理员") : @""; |
||||
} |
||||
self.typeLabel.text = str; |
||||
} |
||||
|
||||
- (void)subCellView |
||||
{ |
||||
UIImageView *iconImg = [UICommon ui_imageView:CGRectZero fileName:@""]; |
||||
self.iconImg = iconImg; |
||||
[self.contentView addSubview:iconImg]; |
||||
[iconImg mas_makeConstraints:^(MASConstraintMaker *make) { |
||||
make.left.equalTo(self.contentView).offset(15); |
||||
make.centerY.equalTo(self.contentView); |
||||
make.size.mas_equalTo(CGSizeMake(Adapted(40), Adapted(40))); |
||||
}]; |
||||
|
||||
|
||||
UILabel *nameLabel = [UICommon ui_label:CGRectZero lines:0 align:NSTextAlignmentCenter font:FontADA_(15) textColor:KKTextBlackColor text:@"" Radius:0]; |
||||
self.nameLabel = nameLabel; |
||||
[self.contentView addSubview:nameLabel]; |
||||
[nameLabel mas_makeConstraints:^(MASConstraintMaker *make) { |
||||
make.left.equalTo(iconImg.mas_right).offset(10); |
||||
make.top.equalTo(iconImg); |
||||
}]; |
||||
|
||||
UILabel *phoneLabel = [UICommon ui_label:CGRectZero lines:0 align:NSTextAlignmentCenter font:FontADA_(13) textColor:KKGrey102 text:@"" Radius:0]; |
||||
self.phoneLabel = phoneLabel; |
||||
[self.contentView addSubview:phoneLabel]; |
||||
[phoneLabel mas_makeConstraints:^(MASConstraintMaker *make) { |
||||
make.left.equalTo(nameLabel); |
||||
make.bottom.equalTo(iconImg.mas_bottom); |
||||
}]; |
||||
|
||||
|
||||
UILabel *typeLabel = [UICommon ui_label:CGRectZero lines:0 align:NSTextAlignmentCenter font:FontADA_(15) textColor:KKMainColor text:@"" Radius:0]; |
||||
self.typeLabel = typeLabel; |
||||
[self.contentView addSubview:typeLabel]; |
||||
[typeLabel mas_makeConstraints:^(MASConstraintMaker *make) { |
||||
make.left.equalTo(nameLabel.mas_right).offset(5); |
||||
make.centerY.equalTo(nameLabel); |
||||
}]; |
||||
|
||||
UIImageView *rightImg = [UICommon ui_imageView:CGRectZero fileName:@"icon_enter_gray"]; |
||||
[self.contentView addSubview:rightImg]; |
||||
[rightImg mas_makeConstraints:^(MASConstraintMaker *make) { |
||||
make.right.equalTo(self.contentView.mas_right).inset(15); |
||||
make.centerY.equalTo(self.contentView); |
||||
make.size.mas_equalTo(rightImg.image.size); |
||||
}]; |
||||
} |
||||
|
||||
- (void)awakeFromNib { |
||||
[super awakeFromNib]; |
||||
// Initialization code |
||||
} |
||||
|
||||
- (void)setSelected:(BOOL)selected animated:(BOOL)animated { |
||||
[super setSelected:selected animated:animated]; |
||||
|
||||
// Configure the view for the selected state |
||||
} |
||||
|
||||
@end |
Loading…
Reference in new issue