12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- //
- // RQHomeSubPageVideoCell.m
- // SDJK
- //
- // Created by 张嵘 on 2021/11/9.
- //
- #import "RQHomeSubPageVideoCell.h"
- @interface RQHomeSubPageVideoCell ()
- @property (nonatomic, readwrite, strong) RQHomeSubPageVideoItemViewModel *viewModel;
- @property (weak, nonatomic) IBOutlet UIImageView *videoImageView;
- @property (weak, nonatomic) IBOutlet UILabel *videoDurationLabel;
- @property (weak, nonatomic) IBOutlet UILabel *myTtitleLabel;
- @end
- @implementation RQHomeSubPageVideoCell
- #pragma mark - PublicMethods
- + (instancetype)cellWithCollectionView:(UICollectionView *)collectionView forIndexPath:(NSIndexPath *)indexPath {
- static NSString *ID = @"RQHomeSubPageVideoCell";
- [collectionView registerNib:[UINib nibWithNibName:ID bundle:nil] forCellWithReuseIdentifier:ID];
- RQHomeSubPageVideoCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:ID forIndexPath:indexPath];
- if (!cell) cell = [self rq_viewFromXib];
- return cell;
- }
- - (void)bindViewModel:(RQHomeSubPageVideoItemViewModel *)viewModel {
- _viewModel = viewModel;
- [_videoImageView yy_setImageWithURL:[NSURL URLWithString:viewModel.videosItem.coverFileUrl] placeholder:RQWebVideoImagePlaceholder()];
- _videoDurationLabel.text = [NSString getMMSSFromSS:viewModel.videosItem.videoDuration];
- _myTtitleLabel.text = viewModel.videosItem.title;
- }
- #pragma mark - SystemMethods
- - (void)awakeFromNib {
- [super awakeFromNib];
- // Initialization code
- }
- @end
|