123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- //
- // VideoCourseCell.m
- // KulexiuForTeacher
- //
- // Created by Kyle on 2022/3/29.
- //
- #import "VideoCourseCell.h"
- @interface VideoCourseCell ()
- @property (weak, nonatomic) IBOutlet UIImageView *coverImage;
- @property (weak, nonatomic) IBOutlet UILabel *courseTitle;
- @property (weak, nonatomic) IBOutlet UIImageView *teacherAvatar;
- @property (weak, nonatomic) IBOutlet UILabel *teacherName;
- @property (weak, nonatomic) IBOutlet UILabel *courseMessage;
- @property (weak, nonatomic) IBOutlet UIView *descView;
- @property (weak, nonatomic) IBOutlet UILabel *descLabel;
- @property (weak, nonatomic) IBOutlet UILabel *subjectLabel;
- @end
- @implementation VideoCourseCell
- - (void)awakeFromNib {
- [super awakeFromNib];
- // Initialization code
- }
- - (void)configSourceModel:(VideoCourseModel *)model isInCheck:(BOOL)isCheck {
- [self.coverImage sd_setImageWithURL:[NSURL URLWithString:model.lessonCoverUrl] placeholderImage:[UIImage imageNamed:@"video_placeholder"]];
- self.courseTitle.text = [NSString returnNoNullStringWithString:model.lessonName];
- [self.teacherAvatar sd_setImageWithURL:[NSURL URLWithString:model.avatar] placeholderImage:[UIImage imageNamed:USERDEFAULT_LOGO]];
- if ([NSString isEmptyString:model.username]) {
- self.teacherName.text = [NSString stringWithFormat:@"游客%.0f",model.teacherId];
- }
- else {
- self.teacherName.text = model.username;
- }
- self.courseMessage.text = [NSString stringWithFormat:@"¥%.2f/%.0f课时",model.lessonPrice,model.lessonCount];
- if (isCheck) {
- self.descView.hidden = YES;
- self.descLabel.text = @"";
- }
- else {
- self.descView.hidden = NO;
- self.descLabel.text = [NSString stringWithFormat:@"%.0f人已购买",model.countStudent];
- }
- self.subjectLabel.text = [NSString returnNoNullStringWithString:model.lessonSubjectName];
- }
- @end
|