123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- //
- // NYExaminationViewController.m
- // jiaPei
- //
- // Created by Ning.ge on 2024/10/14.
- // Copyright © 2024 JCZ. All rights reserved.
- //
- #import "NYExaminationViewController.h"
- @interface NYExaminationViewController ()
- @property (nonatomic, readwrite, strong) NYExaminationViewModel *viewModel;
- @property (weak, nonatomic) IBOutlet UIView *view01;
- @property (weak, nonatomic) IBOutlet UIButton *back_btn;
- @property (weak, nonatomic) IBOutlet UIImageView *top_imageView;
- @property (weak, nonatomic) IBOutlet UIView *content_view;
- @property (weak, nonatomic) IBOutlet UILabel *id_card_label;
- @property (weak, nonatomic) IBOutlet UILabel *username_label;
- @property (weak, nonatomic) IBOutlet UIButton *submit_btn;
- @end
- @implementation NYExaminationViewController
- @dynamic viewModel;
- - (void)viewDidLoad {
- [super viewDidLoad];
- // Do any additional setup after loading the view from its nib.
-
- NYExaminationViewModel *model = self.viewModel;
- self.top_imageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"examination_km%d",model.km]];
- self.id_card_label.text = RQ_USER_MANAGER.currentUser.loginCode;
- self.username_label.text = RQ_USER_MANAGER.currentUser.userName;
- self.content_view.layer.borderWidth = 1.0f;
- self.content_view.layer.borderColor = UIColorHex(0xD9D9D9).CGColor;
- self.submit_btn.layer.borderWidth = 1.0f;
- self.submit_btn.layer.borderColor = UIColorHex(0xA1A2A4).CGColor;
- [self enterLandscapeFullScreen:UIInterfaceOrientationLandscapeLeft animated:YES];
- [self.view01 setNeedsLayout];
- [self.view01 layoutIfNeeded];
-
- }
- - (void)viewWillAppear:(BOOL)animated {
- [super viewWillAppear:animated];
- [self.navigationController.navigationBar setHidden:YES];
- }
- - (IBAction)submitActionClickdo:(UIButton *)sender {
- if(self.viewModel.questionArr!=NULL){
- NYExaminationRoomViewModel *examinationroomViewModel = [[NYExaminationRoomViewModel alloc] initWithServices:RQ_APPDELEGATE.services params:@{
- RQHomePageCarTypeKey : @(self.viewModel.homePageCarType),
- RQHomePageSubjectTypeKey : @(self.viewModel.homePageSubjectType),
- RQHomeSubPageTypeKey : @(self.viewModel.homeSubPageType),
- RQViewModelIDKey : self.viewModel.titleStr,
- RQExerciseTypeKey : @(RQExerciseType_Sequential_LI),
- RQViewModelUtilKey : self.viewModel.questionArr,
- }];
- [RQ_APPDELEGATE.services pushViewModel:examinationroomViewModel animated:YES];
- }else{
- NYExaminationRoomViewModel *examinationroomViewModel = [[NYExaminationRoomViewModel alloc] initWithServices:RQ_APPDELEGATE.services params:@{}];
- [RQ_APPDELEGATE.services pushViewModel:examinationroomViewModel animated:YES];
- }
- }
- /*
- #pragma mark - Navigation
- // In a storyboard-based application, you will often want to do a little preparation before navigation
- - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
- // Get the new view controller using [segue destinationViewController].
- // Pass the selected object to the new view controller.
- }
- */
- - (IBAction)backAtciondo:(id)sender {
- [self.navigationController.navigationBar setHidden:NO];
- [self.navigationController popViewControllerAnimated:YES];
- }
- - (void)enterLandscapeFullScreen:(UIInterfaceOrientation)orientation animated:(BOOL)animated {
- [[UIDevice currentDevice] setValue:[NSNumber numberWithInt:UIInterfaceOrientationUnknown] forKey:@"orientation"];
- NSNumber *orientationUnknown = [NSNumber numberWithInt:UIInterfaceOrientationLandscapeLeft];
- [[UIDevice currentDevice] setValue:orientationUnknown forKey:@"orientation"];
- }
- //支持的方向
- - (UIInterfaceOrientationMask)supportedInterfaceOrientations
- {
- return UIInterfaceOrientationMaskLandscapeLeft|UIInterfaceOrientationMaskLandscapeRight;
- }
- - (UIInterfaceOrientation) preferredInterfaceOrientationForPresentation
- {
- return UIInterfaceOrientationPortrait;
- }
- @end
|