NYClassRoomPeiPhotoCell.m 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. //
  2. // NYClassRoomPeiPhotoCell.m
  3. // jiaPei
  4. //
  5. // Created by Ning.ge on 2024/2/17.
  6. // Copyright © 2024 JCZ. All rights reserved.
  7. //
  8. #import "NYClassRoomPeiPhotoCell.h"
  9. @implementation NYClassRoomPeiPhotoCell
  10. - (instancetype)initWithFrame:(CGRect)frame{
  11. self = [super initWithFrame:frame];
  12. if (self) {
  13. [self addSubview:self.imagev];
  14. [self addSubview:self.time_label];
  15. [self addSubview:self.title_label];
  16. [self addSubview:self.valid_label];
  17. [self addSubview:self.valid_time_label];
  18. }
  19. return self;
  20. }
  21. - (UIImageView *)imagev{
  22. if (!_imagev) {
  23. _imagev = [[UIImageView alloc] initWithFrame:CGRectMake(12.5, 5, 55, 55)];
  24. // _imagev.backgroundColor = [UIColor blueColor];
  25. }
  26. return _imagev;
  27. }
  28. - (UILabel *)time_label{
  29. if (!_time_label) {
  30. _time_label = [[UILabel alloc]initWithFrame:CGRectMake(0, 65, 80, 40)];
  31. _time_label.font = [UIFont systemFontOfSize:13.f];
  32. _time_label.textAlignment = NSTextAlignmentCenter;
  33. _time_label.numberOfLines = 0;
  34. _time_label.textColor = UIColorGray;
  35. }
  36. return _time_label;
  37. }
  38. - (UILabel *)title_label{
  39. if (!_title_label) {
  40. _title_label = [[UILabel alloc]initWithFrame:CGRectMake(0, 105, 80, 20)];
  41. _title_label.font = [UIFont systemFontOfSize:10.f];
  42. _title_label.textAlignment = NSTextAlignmentCenter;
  43. _title_label.textColor = UIColor.blackColor;
  44. _title_label.text = @"训练过程照片";
  45. }
  46. return _title_label;
  47. }
  48. - (UILabel *)valid_label{
  49. if (!_valid_label) {
  50. _valid_label = [[UILabel alloc]initWithFrame:CGRectMake(0, 125, 55, 20)];
  51. _valid_label.font = [UIFont systemFontOfSize:10.f];
  52. _valid_label.textColor = UIColor.blackColor;
  53. _valid_label.text = @"有效学时:";
  54. }
  55. return _valid_label;
  56. }
  57. - (UILabel *)valid_time_label{
  58. if (!_valid_time_label) {
  59. _valid_time_label = [[UILabel alloc]initWithFrame:CGRectMake(50, 125, 45, 20)];
  60. _valid_time_label.font = [UIFont systemFontOfSize:10.f];
  61. _valid_time_label.textColor = UIColorGray;
  62. }
  63. return _valid_time_label;
  64. }
  65. - (void)setCultivatePhotoModel:(CultivatePhotoModel *)cultivatePhotoModel{
  66. _cultivatePhotoModel = cultivatePhotoModel;
  67. [self.imagev sd_setImageWithURL:[NSURL URLWithString:cultivatePhotoModel.filepath]];
  68. self.time_label.text = cultivatePhotoModel.ptime;
  69. self.valid_time_label.text = [NSString stringWithFormat:@"%zd分钟",cultivatePhotoModel.time];
  70. }
  71. @end