123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- //
- // RQHoursBeforeExamHomeViewController.m
- // jiaPei
- //
- // Created by 张嵘 on 2022/6/21.
- // Copyright © 2022 JCZ. All rights reserved.
- //
- #import "RQHoursBeforeExamHomeViewController.h"
- @interface RQHoursBeforeExamHomeViewController ()
- /// viewModel
- @property (nonatomic, readonly, strong) RQHoursBeforeExamHomeViewModel *viewModel;
- @property (weak, nonatomic) IBOutlet UIButton *miJuanOneBtn;
- @property (weak, nonatomic) IBOutlet UIButton *miJuanTwoBtn;
- @property (weak, nonatomic) IBOutlet NSLayoutConstraint *stackViewTopToImageView;
- @property (weak, nonatomic) IBOutlet NSLayoutConstraint *backBtnTopToSuperView;
- @end
- @implementation RQHoursBeforeExamHomeViewController
- @dynamic viewModel;
- - (void)viewDidLoad {
- [super viewDidLoad];
- _stackViewTopToImageView.constant = RQ_FIT_HORIZONTAL(414.5f) ;
- _backBtnTopToSuperView.constant = RQ_APPLICATION_STATUS_BAR_HEIGHT;
- }
- - (IBAction)backBtnAction:(id)sender {
- [self.viewModel.services popViewModelAnimated:YES];
- }
- - (IBAction)mijuanOneBtnAction:(id)sender {
- RQ_COMMON_MANAGER.miExamType = RQMiExamType_One;
- NSArray *questionArr = [RQ_QUESTION_DB_MANAGER getQuestionWithCarType:RQ_COMMON_MANAGER.carType subject:RQ_COMMON_MANAGER.subject pageType:RQHomeSubPageType_MockExamination name:@"" exerciseType:RQExerciseType_MiExam];
- [RQ_USER_MANAGER isShouldVipWithComplete:^(NSInteger isVip) {
- if (isVip > 0) {
- if (questionArr.count > 0) {
- RQExerciseViewModel *exerciseViewModel = [[RQExerciseViewModel alloc] initWithServices:RQ_APPDELEGATE.services params:@{
- RQHomePageCarTypeKey : @(RQ_COMMON_MANAGER.carType),
- RQHomePageSubjectTypeKey : @(RQ_COMMON_MANAGER.subject),
- RQHomeSubPageTypeKey : @(RQHomeSubPageType_MockExamination),
- RQExerciseTypeKey : @(RQExerciseType_Test),
- RQViewModelUtilKey : questionArr,
- RQViewCommonValueKey : @(0),
- RQViewModelIDKey : @"秘卷一",
- }];
- [RQ_APPDELEGATE.services pushViewModel:exerciseViewModel animated:YES];
- } else {
- [MBProgressHUD rq_showTips:@"秘卷题库为空!"];
- }
- }
- }];
-
- return;
- [RQ_USER_MANAGER isShouldVipWithComplete:^(NSInteger isVip) {
- if (isVip > 0) {
- if (self.viewModel.itemsOne.count > 0) {
- RQExerciseViewModel *exerciseViewModel = [[RQExerciseViewModel alloc] initWithServices:RQ_APPDELEGATE.services params:@{
- RQHomePageCarTypeKey : @(RQ_COMMON_MANAGER.carType),
- RQHomePageSubjectTypeKey : @(RQ_COMMON_MANAGER.subject),
- RQHomeSubPageTypeKey : @(RQHomeSubPageType_MockExamination),
- RQExerciseTypeKey : @(RQExerciseType_Test),
- RQViewModelUtilKey : self.viewModel.itemsOne,
- RQViewCommonValueKey : @(0),
- RQViewModelIDKey : @"秘卷一",
- }];
- [RQ_APPDELEGATE.services pushViewModel:exerciseViewModel animated:YES];
- } else {
- [MBProgressHUD rq_showTips:@"秘卷题库更新中!"];
- }
- }
- }];
- }
- - (IBAction)mijuanTwoBtnAction:(id)sender {
- RQ_COMMON_MANAGER.miExamType = RQMiExamType_Two;
- NSArray *questionArr = [RQ_QUESTION_DB_MANAGER getQuestionWithCarType:RQ_COMMON_MANAGER.carType subject:RQ_COMMON_MANAGER.subject pageType:RQHomeSubPageType_MockExamination name:@"" exerciseType:RQExerciseType_MiExam];
- [RQ_USER_MANAGER isShouldVipWithComplete:^(NSInteger isVip) {
- if (isVip > 0) {
- if (questionArr.count > 0) {
- RQExerciseViewModel *exerciseViewModel = [[RQExerciseViewModel alloc] initWithServices:RQ_APPDELEGATE.services params:@{
- RQHomePageCarTypeKey : @(RQ_COMMON_MANAGER.carType),
- RQHomePageSubjectTypeKey : @(RQ_COMMON_MANAGER.subject),
- RQHomeSubPageTypeKey : @(RQHomeSubPageType_MockExamination),
- RQExerciseTypeKey : @(RQExerciseType_Test),
- RQViewModelUtilKey : questionArr,
- RQViewCommonValueKey : @(0),
- RQViewModelIDKey : @"秘卷二",
- }];
- [RQ_APPDELEGATE.services pushViewModel:exerciseViewModel animated:YES];
- } else {
- [MBProgressHUD rq_showTips:@"秘卷题库为空!"];
- }
- }
- }];
- return;
- [RQ_USER_MANAGER isShouldVipWithComplete:^(NSInteger isVip) {
- if (isVip > 0) {
- if (self.viewModel.itemsOne.count > 0) {
- RQExerciseViewModel *exerciseViewModel = [[RQExerciseViewModel alloc] initWithServices:RQ_APPDELEGATE.services params:@{
- RQHomePageCarTypeKey : @(RQ_COMMON_MANAGER.carType),
- RQHomePageSubjectTypeKey : @(RQ_COMMON_MANAGER.subject),
- RQHomeSubPageTypeKey : @(RQHomeSubPageType_MockExamination),
- RQExerciseTypeKey : @(RQExerciseType_Test),
- RQViewModelUtilKey : self.viewModel.itemsTwo,
- RQViewCommonValueKey : @(0),
- RQViewModelIDKey : @"秘卷二",
- }];
- [RQ_APPDELEGATE.services pushViewModel:exerciseViewModel animated:YES];
- } else {
- [MBProgressHUD rq_showTips:@"秘卷题库更新中!"];
- }
- }
- }];
- }
- @end
|