// // NYClassRoomPeiPhotoCell.m // jiaPei // // Created by Ning.ge on 2024/2/17. // Copyright © 2024 JCZ. All rights reserved. // #import "NYClassRoomPeiPhotoCell.h" @implementation NYClassRoomPeiPhotoCell - (instancetype)initWithFrame:(CGRect)frame{ self = [super initWithFrame:frame]; if (self) { [self addSubview:self.imagev]; [self addSubview:self.time_label]; [self addSubview:self.title_label]; [self addSubview:self.valid_label]; [self addSubview:self.valid_time_label]; } return self; } - (UIImageView *)imagev{ if (!_imagev) { _imagev = [[UIImageView alloc] initWithFrame:CGRectMake(12.5, 5, 55, 55)]; // _imagev.backgroundColor = [UIColor blueColor]; } return _imagev; } - (UILabel *)time_label{ if (!_time_label) { _time_label = [[UILabel alloc]initWithFrame:CGRectMake(0, 65, 80, 40)]; _time_label.font = [UIFont systemFontOfSize:13.f]; _time_label.textAlignment = NSTextAlignmentCenter; _time_label.numberOfLines = 0; _time_label.textColor = UIColorGray; } return _time_label; } - (UILabel *)title_label{ if (!_title_label) { _title_label = [[UILabel alloc]initWithFrame:CGRectMake(0, 105, 80, 20)]; _title_label.font = [UIFont systemFontOfSize:10.f]; _title_label.textAlignment = NSTextAlignmentCenter; _title_label.textColor = UIColor.blackColor; _title_label.text = @"训练过程照片"; } return _title_label; } - (UILabel *)valid_label{ if (!_valid_label) { _valid_label = [[UILabel alloc]initWithFrame:CGRectMake(0, 125, 55, 20)]; _valid_label.font = [UIFont systemFontOfSize:10.f]; _valid_label.textColor = UIColor.blackColor; _valid_label.text = @"有效学时:"; } return _valid_label; } - (UILabel *)valid_time_label{ if (!_valid_time_label) { _valid_time_label = [[UILabel alloc]initWithFrame:CGRectMake(50, 125, 45, 20)]; _valid_time_label.font = [UIFont systemFontOfSize:10.f]; _valid_time_label.textColor = UIColorGray; } return _valid_time_label; } - (void)setCultivatePhotoModel:(CultivatePhotoModel *)cultivatePhotoModel{ _cultivatePhotoModel = cultivatePhotoModel; [self.imagev sd_setImageWithURL:[NSURL URLWithString:cultivatePhotoModel.filepath]]; self.time_label.text = cultivatePhotoModel.ptime; self.valid_time_label.text = [NSString stringWithFormat:@"%zd分钟",cultivatePhotoModel.time]; NSString *titleStr = @"训练过程照片"; switch (cultivatePhotoModel.event) { case 17: titleStr = @"签到照片"; break; case 18: titleStr = @"签退照片"; break; case 19: titleStr = @"训练过程照片"; break; default: titleStr = @"未知"; break; } self.title_label.text = titleStr; } @end