123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- //
- // ContractListCell.m
- // KulexiuForTeacher
- //
- // Created by Kyle on 2022/3/24.
- //
- #import "ContractListCell.h"
- #import "FriendListModel.h"
- @interface ContractListCell ()
- @property (weak, nonatomic) IBOutlet UIImageView *friendAvatar;
- @property (weak, nonatomic) IBOutlet UILabel *friendName;
- @property (weak, nonatomic) IBOutlet UIImageView *roleType;
- @end
- @implementation ContractListCell
- - (void)awakeFromNib {
- [super awakeFromNib];
- // Initialization code
- self.selectionStyle = UITableViewCellSelectionStyleNone;
- }
- - (void)configWithSource:(id)sourceModel {
- if ([sourceModel isKindOfClass:[FriendListModel class]]) {
- FriendListModel *model = sourceModel;
- [self.friendAvatar sd_setImageWithURL:[NSURL URLWithString:[model.friendAvatar getUrlEndcodeString]] placeholderImage:[UIImage imageNamed:CHAT_USER_DEFAULT_LOGO]];
- if ([NSString isEmptyString:model.friendNickname]) {
- self.friendName.text = [NSString stringWithFormat:@"游客%@",model.friendId];
- }
- else {
- self.friendName.text = model.friendNickname;
- }
- self.friendName.text = [NSString returnNoNullStringWithString:model.friendNickname];
-
- if ([model.roleType isEqualToString:@"TEACHER"]) {
- self.roleType.hidden = NO;
- }
- else {
- self.roleType.hidden = YES;
- }
- }
- }
- - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
- [super setSelected:selected animated:animated];
- // Configure the view for the selected state
- }
- @end
|