123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- //
- // GroupApplyMemberCell.m
- // KulexiuForTeacher
- //
- // Created by Kyle on 2022/3/25.
- //
- #import "GroupApplyMemberCell.h"
- @interface GroupApplyMemberCell ()
- @property (weak, nonatomic) IBOutlet UIImageView *userAvatal;
- @property (weak, nonatomic) IBOutlet UILabel *userName;
- @property (weak, nonatomic) IBOutlet UILabel *descLabel;
- @property (weak, nonatomic) IBOutlet UILabel *timeLabel;
- @end
- @implementation GroupApplyMemberCell
- - (void)awakeFromNib {
- [super awakeFromNib];
- // Initialization code
- self.selectionStyle = UITableViewCellSelectionStyleNone;
- }
- - (void)configWithSource:(ApplyMemberModel *)source {
- if ([NSString isEmptyString:source.avatar]) {
- [self.userAvatal setImage:[UIImage imageNamed:CHAT_USER_DEFAULT_LOGO]];
- }
- else {
- [self.userAvatal sd_setImageWithURL:[NSURL URLWithString:[source.avatar getUrlEndcodeString]] placeholderImage:[UIImage imageNamed:CHAT_USER_DEFAULT_LOGO]];
- }
- if ([NSString isEmptyString:source.username]) {
- self.userName.text = [NSString stringWithFormat:@"用户:%@",source.userId];
- }
- else {
- self.userName.text = source.username;
- }
- if ([NSString isEmptyString:source.updateTime]) {
- self.timeLabel.text = @"";
- }
- else {
- NSDateFormatter *dateFormatter=[[NSDateFormatter alloc] init];
- dateFormatter.timeZone = [NSTimeZone systemTimeZone];
- [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
- NSDate *messageDate = [dateFormatter dateFromString:source.updateTime];
- [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm"];
- NSString *dateStr = [dateFormatter stringFromDate:messageDate];
- self.timeLabel.text = dateStr;
- }
- }
- - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
- [super setSelected:selected animated:animated];
- // Configure the view for the selected state
- }
- @end
|