12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- //
- // 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 getUrlEndcodeString]] placeholderImage:[UIImage imageNamed:@"video_placeholder"]];
- self.courseTitle.text = [NSString returnNoNullStringWithString:model.lessonName];
- [self.teacherAvatar sd_setImageWithURL:[NSURL URLWithString:[model.avatar getUrlEndcodeString]] placeholderImage:[UIImage imageNamed:USERDEFAULT_LOGO]];
- if ([NSString isEmptyString:model.username]) {
- self.teacherName.text = [NSString stringWithFormat:@"游客%.0f",model.teacherId];
- }
- else {
- self.teacherName.text = model.username;
- }
- if (model.lessonPrice > 0) {
- self.courseMessage.text = [NSString stringWithFormat:@"¥%.2f/%.0f课时",model.lessonPrice,model.lessonCount];
- }
- else {
- self.courseMessage.text = [NSString stringWithFormat:@"免费/%.0f课时",model.lessonCount];
- }
-
-
- if (isCheck) {
- self.descView.hidden = YES;
- self.descLabel.text = @"";
- }
- else {
- self.descView.hidden = NO;
- if (model.lessonPrice > 0) {
- self.descLabel.text = [NSString stringWithFormat:@"%.0f人已购买",model.countStudent];
- }
- else {
- self.descLabel.text = [NSString stringWithFormat:@"%.0f人已领取",model.countStudent];
- }
- }
- self.subjectLabel.text = [NSString returnNoNullStringWithString:model.lessonSubjectName];
- }
- @end
|