HomeHotVideoCell.m 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //
  2. // HomeHotVideoCell.m
  3. // KulexiuForStudent
  4. //
  5. // Created by 王智 on 2022/8/29.
  6. //
  7. #import "HomeHotVideoCell.h"
  8. @interface HomeHotVideoCell ()
  9. @property (weak, nonatomic) IBOutlet UIImageView *coverImage;
  10. @property (weak, nonatomic) IBOutlet UILabel *courseName;
  11. @property (weak, nonatomic) IBOutlet UILabel *teacherName;
  12. @property (weak, nonatomic) IBOutlet UILabel *countLabel;
  13. @property (weak, nonatomic) IBOutlet UILabel *subjectLabel;
  14. @end
  15. @implementation HomeHotVideoCell
  16. - (void)awakeFromNib {
  17. [super awakeFromNib];
  18. // Initialization code
  19. }
  20. - (void)configWithSource:(HomeVideoGroupModel *)source {
  21. [self.coverImage sd_setImageWithURL:[NSURL URLWithString:[source.lessonCoverUrl getUrlEndcodeString]] placeholderImage:[UIImage imageNamed:@"video_placeholder"]];
  22. self.courseName.text = [NSString returnNoNullStringWithString:source.videoGroupName];
  23. if ([NSString isEmptyString:source.teacherName]) {
  24. self.teacherName.text = [NSString stringWithFormat:@"游客%@",source.teacherId];
  25. }
  26. else {
  27. self.teacherName.text = [NSString stringWithFormat:@"%@",source.teacherName];
  28. }
  29. self.countLabel.text = [NSString stringWithFormat:@"%zd人在学",source.buyCount];
  30. self.subjectLabel.text = [NSString returnNoNullStringWithString:source.subjectName];
  31. }
  32. @end