MinePageVideoCell.m 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //
  2. // MinePageVideoCell.m
  3. // KulexiuForTeacher
  4. //
  5. // Created by 王智 on 2022/4/2.
  6. //
  7. #import "MinePageVideoCell.h"
  8. @interface MinePageVideoCell ()
  9. @property (weak, nonatomic) IBOutlet UIImageView *coverImage;
  10. @property (weak, nonatomic) IBOutlet UILabel *courseTitle;
  11. @property (weak, nonatomic) IBOutlet UILabel *courseMessage;
  12. @property (weak, nonatomic) IBOutlet UILabel *courseCount;
  13. @property (weak, nonatomic) IBOutlet UILabel *descLabel;
  14. @property (weak, nonatomic) IBOutlet UILabel *subjectLabel;
  15. @end
  16. @implementation MinePageVideoCell
  17. - (void)awakeFromNib {
  18. [super awakeFromNib];
  19. // Initialization code
  20. }
  21. - (void)configSourceModel:(VideoCourseModel *)model {
  22. [self.coverImage sd_setImageWithURL:[NSURL URLWithString:[model.lessonCoverUrl getUrlEndcodeString]] placeholderImage:[UIImage imageNamed:@"video_placeholder"]];
  23. self.courseTitle.text = [NSString returnNoNullStringWithString:model.lessonName];
  24. if (model.lessonPrice > 0) {
  25. self.courseMessage.text = [NSString stringWithFormat:@"¥%.2f",model.lessonPrice];
  26. }
  27. else {
  28. self.courseMessage.text = @"免费";
  29. }
  30. self.courseCount.text = [NSString stringWithFormat:@"/%.0f课时",model.lessonCount];
  31. if (model.lessonPrice > 0) {
  32. self.descLabel.text = [NSString stringWithFormat:@"%.0f人已购买",model.countStudent];
  33. }
  34. else {
  35. self.descLabel.text = [NSString stringWithFormat:@"%.0f人已领取",model.countStudent];
  36. }
  37. self.subjectLabel.text = [NSString returnNoNullStringWithString:model.lessonSubjectName];
  38. }
  39. @end