// // RQFreeTryItemViewModel.m // SDJK // // Created by 张嵘 on 2022/6/27. // #import "RQFreeTryItemViewModel.h" @implementation RQFreeTryItemViewModel - (instancetype)initWithTitle:(NSString *)title icon:(NSString *)icon { if (self = [super init]) { self.title = title; self.icon = icon; CGFloat imageWidth = (RQ_SCREEN_WIDTH - 32 - 11.f) / 2.f; CGFloat imageHeight = imageWidth * (70 / 167.f); self.itemSize = CGSizeMake(imageWidth, imageHeight); if ([self.title isEqualToString:@"免费试用"]) { self.operation = ^{ RQExerciseViewModel *exerciseViewModel = [[RQExerciseViewModel alloc] initWithServices:RQ_APPDELEGATE.services params:@{ RQHomePageCarTypeKey : @(RQ_COMMON_MANAGER.carType), RQHomePageSubjectTypeKey : @(RQ_COMMON_MANAGER.subject), RQHomeSubPageTypeKey : @(RQHomeSubPageType_FreeTry), RQExerciseTypeKey : @(RQExerciseType_Sequential), RQViewCommonValueKey : @(0), }]; [RQ_APPDELEGATE.services pushViewModel:exerciseViewModel animated:YES]; }; } else if ([self.title isEqualToString:@"新规秘卷"]) { self.operation = ^{ RQHoursBeforeExamHomeViewModel *hoursBeforeExamHomeViewModel = [[RQHoursBeforeExamHomeViewModel alloc] initWithServices:RQ_APPDELEGATE.services params:nil]; [RQ_APPDELEGATE.services pushViewModel:hoursBeforeExamHomeViewModel animated:YES]; }; } } return self; } - (NSString *)itemClassName { return @"RQFreeTryCell"; } @end