// // NYLIVideoDetailSubPageCell.m // jiaPei // // Created by Ning.ge on 2025/2/11. // Copyright © 2025 JCZ. All rights reserved. // #import "NYLIVideoDetailSubPageCell.h" @interface NYLIVideoDetailSubPageCell () @property (nonatomic, readwrite, strong) NYLIVideoDetailSubPageItemViewModel *viewModel; @property (nonatomic, readwrite, strong) RQVideoPermissionStateModel *videoPermissionStateModel; @property (weak, nonatomic) IBOutlet UIImageView *icon_imageview; @property (weak, nonatomic) IBOutlet UILabel *title_label; @property (weak, nonatomic) IBOutlet UIView *tag_view; @property (weak, nonatomic) IBOutlet QMUIButton *call_play_btn; @property (weak, nonatomic) IBOutlet UIButton *tag_bg_btn; @end @implementation NYLIVideoDetailSubPageCell #pragma mark - PublicMethods + (instancetype)cellWithTableView:(UITableView *)tableView { static NSString *ID = @"NYLIVideoDetailSubPageCell"; NYLIVideoDetailSubPageCell *cell = [tableView dequeueReusableCellWithIdentifier:ID]; if (!cell) { cell = [self rq_viewFromXib]; cell.selectionStyle = UITableViewCellSelectionStyleNone; [cell.tag_bg_btn setBackgroundImage:[UIImage imageWithGradualChangingColor:^(QQGradualChangingColor *graColor) { graColor.fromColor = [UIColor qmui_colorWithHexString:@"#FFE7B8"]; graColor.toColor = [UIColor qmui_colorWithHexString:@"##FDC67F"]; graColor.type = QQGradualChangeTypeLeftToRight; } size:cell.tag_bg_btn.bounds.size cornerRadius:QQRadiusMake(5, 5, 5, 5)] forState:UIControlStateNormal]; // [cell.call_play_btn addTarget:cell action:@selector(callPlaydoVideo:) forControlEvents:UIControlEventTouchUpInside]; } return cell; } - (void)bindViewModel:(NYLIVideoDetailSubPageItemViewModel *)viewModel { @weakify(self) _viewModel = viewModel; [self.icon_imageview sd_setImageWithURL:[NSURL URLWithString:viewModel.videosItem.coverFileUrl] placeholderImage:randomPortrait()]; RAC(self.title_label, text) = [[RACObserve(viewModel.videosItem, title) deliverOnMainThread] takeUntil:self.rac_prepareForReuseSignal]; } ////播放通知 //- (void)callPlaydoVideo:(UIButton *)btn { // //// VideosItem *videosItem = self.viewModel.videosItem; //// [RQNotificationCenter postNotificationName:RQPlayVideoUrlNotification object:@{ //// RQPlayVideoItemKey : videosItem, //// RQPlayVideoItemArrKey : @[videosItem], //// }]; //} #pragma mark - SystemMethods - (void)awakeFromNib { [super awakeFromNib]; } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; // Configure the view for the selected state } #pragma mark - LazyLoad - (RQVideoPermissionStateModel *)videoPermissionStateModel { if (!_videoPermissionStateModel) { _videoPermissionStateModel = [[RQVideoPermissionStateModel alloc] init]; } return _videoPermissionStateModel; } @end