123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- //
- // RQHomeSubPageVideoHeaderCollectionReusableView.m
- // SDJK
- //
- // Created by 张嵘 on 2021/11/10.
- //
- #import "RQHomeSubPageVideoHeaderCollectionReusableView.h"
- @interface RQHomeSubPageVideoHeaderCollectionReusableView ()
- @property (nonatomic, readwrite, strong) RQHomeSubPageVideoHeaderGroupViewModel *viewModel;
- @property (weak, nonatomic) IBOutlet UIView *myContentView;
- @property (weak, nonatomic) IBOutlet UILabel *titleLabel;
- @property (weak, nonatomic) IBOutlet UILabel *moreLabel;
- @property (weak, nonatomic) IBOutlet UIImageView *rightArrow;
- @end
- @implementation RQHomeSubPageVideoHeaderCollectionReusableView
- + (instancetype)reusableViewWithCollectionView:(UICollectionView *)collectionView OfKind:(NSString *)elementKind forIndexPath:(NSIndexPath *)indexPath {
- NSString *ID = [NSString stringWithFormat:@"%@%@", @"RQHomeSubPageVideoHeaderCollectionReusableView",elementKind];
- [collectionView registerNib:[UINib nibWithNibName:@"RQHomeSubPageVideoHeaderCollectionReusableView" bundle:nil] forSupplementaryViewOfKind:elementKind withReuseIdentifier:ID];
- RQHomeSubPageVideoHeaderCollectionReusableView *reusableView = [collectionView dequeueReusableSupplementaryViewOfKind:elementKind withReuseIdentifier:ID forIndexPath:indexPath];
- if (!reusableView) reusableView = [self rq_viewFromXib];
- return reusableView;
- }
- - (void)bindViewModel:(RQHomeSubPageVideoHeaderGroupViewModel *)viewModel {
- self.viewModel = viewModel;
- self.titleLabel.text = viewModel.header;
-
- _moreLabel.hidden = RQStringIsEmpty(viewModel.header);
- _rightArrow.hidden = RQStringIsEmpty(viewModel.header);
- [_myContentView setTapActionWithBlock:^(UITapGestureRecognizer *tap) {
- RQVideoCatalogueViewModel *videoCatalogueViewModel = [[RQVideoCatalogueViewModel alloc] initWithServices:RQ_APPDELEGATE.services params:@{
- RQViewModelUtilKey : self.viewModel.treeListModel? self.viewModel.treeListModel : self.viewModel.currentVideoesArr,
- RQHomePageSubjectTypeKey : @(self.viewModel.homePageSubjectType),
- RQVideoItemIndexPathKey : @(self.viewModel.mySection),
- RQVideoSourceTypeKey : self.viewModel.treeListModel? @(RQVideoSourceType_Zzxcx) : @(RQVideoSourceType_LnJppt),
- }];
- [RQ_APPDELEGATE.services pushViewModel:videoCatalogueViewModel animated:YES];
- }];
- }
- - (void)awakeFromNib {
- [super awakeFromNib];
- // Initialization code
- }
- @end
|