RQSimulationTestTopicsViewModel.m 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. //
  2. // RQSimulationTestTopicsViewModel.m
  3. // SDJK
  4. //
  5. // Created by 张嵘 on 2021/8/6.
  6. //
  7. #import "RQSimulationTestTopicsViewModel.h"
  8. @interface RQSimulationTestTopicsViewModel ()
  9. @property (nonatomic, readwrite, assign) RQExerciseType exerciseType;
  10. /// homePageCarType
  11. @property (nonatomic, readwrite, assign) RQHomePageCarType homePageCarType;
  12. /// homePageSubjectType
  13. @property (nonatomic, readwrite, assign) RQHomePageSubjectType homePageSubjectType;
  14. /// homeSubPageType
  15. @property (nonatomic, readwrite, assign) RQHomeSubPageType homeSubPageType;
  16. @end
  17. @implementation RQSimulationTestTopicsViewModel
  18. #pragma mark - Public Method
  19. - (instancetype)initWithServices:(id<RQViewModelServices>)services params:(NSDictionary *)params{
  20. if (self = [super initWithServices:services params:params]) {
  21. self.exerciseType = [params[RQExerciseTypeKey] integerValue];
  22. self.homePageCarType = [params[RQHomePageCarTypeKey] integerValue];
  23. self.homePageSubjectType = [params[RQHomePageSubjectTypeKey] integerValue];
  24. self.homeSubPageType = [params[RQHomeSubPageTypeKey] integerValue];
  25. }
  26. return self;
  27. }
  28. - (void)initialize{
  29. [super initialize];
  30. self.prefersNavigationBarHidden = YES;
  31. self.prefersNavigationBarBottomLineHidden = YES;
  32. ///配置数据
  33. [self rq_configureData];
  34. }
  35. #pragma mark - PrivateMethod
  36. - (void)rq_configureData {
  37. /// 第零组
  38. RQCommonGroupViewModel *group0 = [RQCommonGroupViewModel groupViewModel];
  39. group0.headerHeight = CGFLOAT_MIN;
  40. group0.footerHeight = CGFLOAT_MIN;
  41. RQSimulationTestTopicsItemViewModel *simulationTestTopicsItemViewModel = [[RQSimulationTestTopicsItemViewModel alloc] init];
  42. simulationTestTopicsItemViewModel.rowHeight = RQ_FIT_HORIZONTAL(400.f);
  43. simulationTestTopicsItemViewModel.homePageCarType = self.homePageCarType;
  44. simulationTestTopicsItemViewModel.homePageSubjectType = self.homePageSubjectType;
  45. simulationTestTopicsItemViewModel.homeSubPageType = self.homeSubPageType;
  46. simulationTestTopicsItemViewModel.exerciseType = self.exerciseType;
  47. simulationTestTopicsItemViewModel.operation = ^{
  48. };
  49. group0.itemViewModels = @[simulationTestTopicsItemViewModel];
  50. self.dataSource = @[group0];
  51. }
  52. @end