// // RQVideoListCell.m // SDJK // // Created by 张嵘 on 2021/11/3. // #import "RQVideoListCell.h" @interface RQVideoListCell () @property (nonatomic , strong) CGXVerticalMenuMoreListSectionItemModel *model; @property (weak, nonatomic) IBOutlet UIImageView *videoImageView; @property (weak, nonatomic) IBOutlet UILabel *videoTitleLabel; @property (weak, nonatomic) IBOutlet UILabel *videoDurationLabel; @end @implementation RQVideoListCell #pragma mark - Public Method + (instancetype)cellWithCollectionView:(UICollectionView *)collectionView forIndexPath:(NSIndexPath *)indexPath { static NSString *ID = @"RQVideoListCell"; [collectionView registerNib:[UINib nibWithNibName:ID bundle:nil] forCellWithReuseIdentifier:ID]; RQVideoListCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:ID forIndexPath:indexPath]; if (!cell) cell = [self rq_viewFromXib]; return cell; } - (void)awakeFromNib { [super awakeFromNib]; // Initialization code } - (void)reloadData:(CGXVerticalMenuMoreListSectionItemModel *)model { self.model = model; VideosItem *videosItem = (VideosItem *)model.dataModel; self.videoTitleLabel.text = videosItem.title; [self.videoImageView yy_setImageWithURL:[NSURL URLWithString:videosItem.coverFileUrl] placeholder:[UIImage imageNamed:@"videoPlaceholder"]]; self.videoDurationLabel.text = [NSString getMMSSFromSS:videosItem.videoDuration]; } @end