NYExaminationViewController.m 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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 (weak, nonatomic) IBOutlet UIView *view01;
  11. @property (weak, nonatomic) IBOutlet UIButton *back_btn;
  12. @property (weak, nonatomic) IBOutlet UIImageView *top_imageView;
  13. @property (weak, nonatomic) IBOutlet UIView *content_view;
  14. @property (weak, nonatomic) IBOutlet UILabel *id_card_label;
  15. @property (weak, nonatomic) IBOutlet UILabel *username_label;
  16. @property (weak, nonatomic) IBOutlet UIButton *submit_btn;
  17. @end
  18. @implementation NYExaminationViewController
  19. - (void)viewDidLoad {
  20. [super viewDidLoad];
  21. // Do any additional setup after loading the view from its nib.
  22. NYExaminationViewModel *model = self.viewModel;
  23. self.top_imageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"examination_km%d",model.km]];
  24. self.id_card_label.text = RQ_USER_MANAGER.currentUser.loginCode;
  25. self.username_label.text = RQ_USER_MANAGER.currentUser.userName;
  26. self.content_view.layer.borderWidth = 1.0f;
  27. self.content_view.layer.borderColor = UIColorHex(0xD9D9D9).CGColor;
  28. self.submit_btn.layer.borderWidth = 1.0f;
  29. self.submit_btn.layer.borderColor = UIColorHex(0xA1A2A4).CGColor;
  30. [self enterLandscapeFullScreen:UIInterfaceOrientationLandscapeLeft animated:YES];
  31. [self.view01 setNeedsLayout];
  32. [self.view01 layoutIfNeeded];
  33. }
  34. - (void)viewWillAppear:(BOOL)animated {
  35. [super viewWillAppear:animated];
  36. [self.navigationController.navigationBar setHidden:YES];
  37. }
  38. - (IBAction)submitActionClickdo:(UIButton *)sender {
  39. NYExaminationRoomViewModel *examinationroomViewModel = [[NYExaminationRoomViewModel alloc] initWithServices:RQ_APPDELEGATE.services params:@{}];
  40. [RQ_APPDELEGATE.services pushViewModel:examinationroomViewModel animated:YES];
  41. }
  42. /*
  43. #pragma mark - Navigation
  44. // In a storyboard-based application, you will often want to do a little preparation before navigation
  45. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  46. // Get the new view controller using [segue destinationViewController].
  47. // Pass the selected object to the new view controller.
  48. }
  49. */
  50. - (IBAction)backAtciondo:(id)sender {
  51. [self.navigationController.navigationBar setHidden:NO];
  52. [self.navigationController popViewControllerAnimated:YES];
  53. }
  54. - (void)enterLandscapeFullScreen:(UIInterfaceOrientation)orientation animated:(BOOL)animated {
  55. [[UIDevice currentDevice] setValue:[NSNumber numberWithInt:UIInterfaceOrientationUnknown] forKey:@"orientation"];
  56. NSNumber *orientationUnknown = [NSNumber numberWithInt:UIInterfaceOrientationLandscapeLeft];
  57. [[UIDevice currentDevice] setValue:orientationUnknown forKey:@"orientation"];
  58. }
  59. //支持的方向
  60. - (UIInterfaceOrientationMask)supportedInterfaceOrientations
  61. {
  62. return UIInterfaceOrientationMaskLandscapeLeft|UIInterfaceOrientationMaskLandscapeRight;
  63. }
  64. - (UIInterfaceOrientation) preferredInterfaceOrientationForPresentation
  65. {
  66. return UIInterfaceOrientationPortrait;
  67. }
  68. @end