NYExaminationViewController.m 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. //
  2. // NYExaminationViewController.m
  3. // jiaPei
  4. //
  5. // Created by Ning.ge on 2024/10/14.
  6. // Copyright © 2024 JCZ. All rights reserved.
  7. //
  8. #import "NYExaminationViewController.h"
  9. @interface NYExaminationViewController ()
  10. @property (nonatomic, readwrite, strong) NYExaminationViewModel *viewModel;
  11. @property (weak, nonatomic) IBOutlet UIView *view01;
  12. @property (weak, nonatomic) IBOutlet UIButton *back_btn;
  13. @property (weak, nonatomic) IBOutlet UIImageView *top_imageView;
  14. @property (weak, nonatomic) IBOutlet UIView *content_view;
  15. @property (weak, nonatomic) IBOutlet UILabel *id_card_label;
  16. @property (weak, nonatomic) IBOutlet UILabel *username_label;
  17. @property (weak, nonatomic) IBOutlet UIButton *submit_btn;
  18. @end
  19. @implementation NYExaminationViewController
  20. @dynamic viewModel;
  21. - (void)viewDidLoad {
  22. [super viewDidLoad];
  23. // Do any additional setup after loading the view from its nib.
  24. NYExaminationViewModel *model = self.viewModel;
  25. self.top_imageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"examination_km%d",model.km]];
  26. self.id_card_label.text = RQ_USER_MANAGER.currentUser.loginCode;
  27. self.username_label.text = RQ_USER_MANAGER.currentUser.userName;
  28. self.content_view.layer.borderWidth = 1.0f;
  29. self.content_view.layer.borderColor = UIColorHex(0xD9D9D9).CGColor;
  30. self.submit_btn.layer.borderWidth = 1.0f;
  31. self.submit_btn.layer.borderColor = UIColorHex(0xA1A2A4).CGColor;
  32. [self enterLandscapeFullScreen:UIInterfaceOrientationLandscapeLeft animated:YES];
  33. [self.view01 setNeedsLayout];
  34. [self.view01 layoutIfNeeded];
  35. }
  36. - (void)viewWillAppear:(BOOL)animated {
  37. [super viewWillAppear:animated];
  38. [self.navigationController.navigationBar setHidden:YES];
  39. }
  40. - (IBAction)submitActionClickdo:(UIButton *)sender {
  41. if(self.viewModel.questionArr!=NULL){
  42. NYExaminationRoomViewModel *examinationroomViewModel = [[NYExaminationRoomViewModel alloc] initWithServices:RQ_APPDELEGATE.services params:@{
  43. RQHomePageCarTypeKey : @(self.viewModel.homePageCarType),
  44. RQHomePageSubjectTypeKey : @(self.viewModel.homePageSubjectType),
  45. RQHomeSubPageTypeKey : @(self.viewModel.homeSubPageType),
  46. RQViewModelIDKey : self.viewModel.titleStr,
  47. RQExerciseTypeKey : @(RQExerciseType_Sequential_LI),
  48. RQViewModelUtilKey : self.viewModel.questionArr,
  49. }];
  50. [RQ_APPDELEGATE.services pushViewModel:examinationroomViewModel animated:YES];
  51. }else{
  52. NYExaminationRoomViewModel *examinationroomViewModel = [[NYExaminationRoomViewModel alloc] initWithServices:RQ_APPDELEGATE.services params:@{}];
  53. [RQ_APPDELEGATE.services pushViewModel:examinationroomViewModel animated:YES];
  54. }
  55. }
  56. /*
  57. #pragma mark - Navigation
  58. // In a storyboard-based application, you will often want to do a little preparation before navigation
  59. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  60. // Get the new view controller using [segue destinationViewController].
  61. // Pass the selected object to the new view controller.
  62. }
  63. */
  64. - (IBAction)backAtciondo:(id)sender {
  65. [self.navigationController.navigationBar setHidden:NO];
  66. [self.navigationController popViewControllerAnimated:YES];
  67. }
  68. - (void)enterLandscapeFullScreen:(UIInterfaceOrientation)orientation animated:(BOOL)animated {
  69. [[UIDevice currentDevice] setValue:[NSNumber numberWithInt:UIInterfaceOrientationUnknown] forKey:@"orientation"];
  70. NSNumber *orientationUnknown = [NSNumber numberWithInt:UIInterfaceOrientationLandscapeLeft];
  71. [[UIDevice currentDevice] setValue:orientationUnknown forKey:@"orientation"];
  72. }
  73. //支持的方向
  74. - (UIInterfaceOrientationMask)supportedInterfaceOrientations
  75. {
  76. return UIInterfaceOrientationMaskLandscapeLeft|UIInterfaceOrientationMaskLandscapeRight;
  77. }
  78. - (UIInterfaceOrientation) preferredInterfaceOrientationForPresentation
  79. {
  80. return UIInterfaceOrientationPortrait;
  81. }
  82. @end