// // NYLIVideoDetailViewModel.m // jiaPei // // Created by Ning.ge on 2025/2/8. // Copyright © 2025 JCZ. All rights reserved. // #import "NYLIVideoDetailViewModel.h" @interface NYLIVideoDetailViewModel () @property (nonatomic, readwrite, strong) RQTreeListModel *treeListModel; @property (nonatomic, readwrite, strong) RQPlaceVideoListModel *placeVideoListModel; @property (nonatomic, readwrite, assign) NSInteger index; @property (nonatomic, readwrite, strong) NSIndexPath *indexPath; @property (nonatomic, readwrite, assign) RQHomePageSubjectType homePageSubjectType; @property (nonatomic, readwrite, strong) VideosItem *videosItem; @end @implementation NYLIVideoDetailViewModel #pragma mark - Public Method - (instancetype)initWithServices:(id)services params:(NSDictionary *)params { if (self = [super initWithServices:services params:params]) { // if ([params[RQViewModelUtilKey] isKindOfClass:[RQPlaceVideoListModel class]]) { self.placeVideoListModel = params[RQViewModelUtilKey]; // } else { // self.treeListModel = params[RQViewModelUtilKey]; // } self.index = [params[RQVideoItemIndexKey] integerValue]; self.indexPath = params[RQVideoItemIndexPathKey]; self.homePageSubjectType = [params[RQHomePageSubjectTypeKey] integerValue]; self.videosItem = params[RQPlayVideoItemKey]; } return self; } - (void)initialize { [super initialize]; self.prefersNavigationBarHidden = YES; // RQ_YDTQuestion_Module.subject = self.homePageSubjectType; //通知 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(getLIFiveReload:) name:NYLI_FIVEDB_CHANGEDO object:nil]; } - (void)dealloc{ [[NSNotificationCenter defaultCenter] removeObserver:self]; } - (void)getLIFiveReload:(NSNotification *)sender { NSString *type = sender.object; self.homePageSubjectType = [type isEqualToString:@"1"]? RQHomePageSubjectType_SubjectOne_LI : RQHomePageSubjectType_SubjectFour_LI; self.placeVideoListModel.examName = [type isEqualToString:@"1"]? @"科一专项精品课" :@"科四专项精品课"; } @end