DeliveryRequirementHomeViewController.m 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. //
  2. // DeliveryRequirementHomeViewController.m
  3. // IBOSSHSH
  4. //
  5. // Created by ssl on 2018/1/12.
  6. // Copyright © 2018年 elongtian. All rights reserved.
  7. //
  8. #import "DeliveryRequirementHomeViewController.h"
  9. @interface DeliveryRequirementHomeViewController ()
  10. @end
  11. @implementation DeliveryRequirementHomeViewController
  12. static int navcount = 2; //导航数
  13. #pragma mark - 公共函数
  14. /**
  15. 视图加载完成函数
  16. */
  17. - (void)viewDidLoad {
  18. [super viewDidLoad];
  19. self.navigationItem.title = @"送安回执一览";
  20. UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
  21. [button setImage:[UIImage imageNamed:@"icon_back.png"] forState:UIControlStateNormal];
  22. [button addTarget:self action:@selector(goBack)
  23. forControlEvents:UIControlEventTouchUpInside];
  24. button.frame = CGRectMake(0, 0,45,22);
  25. UIBarButtonItem *menuButton = [[UIBarButtonItem alloc] initWithCustomView:button];
  26. self.navigationItem.leftBarButtonItem = menuButton;
  27. [self initUI];
  28. }
  29. #pragma mark - 私有函数
  30. /*
  31. 初始化UI
  32. */
  33. - (void)initUI{
  34. self.page = [[PageSwitchView alloc] init];
  35. [self.view addSubview:self.page];
  36. [self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[_page]|" options:0 metrics:nil views:NSDictionaryOfVariableBindings(_page)]];
  37. [self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[_page]-marg-|" options:0 metrics:@{@"marg":@(SCREENHEIGHT >= 812 ? 34 : 0)} views:NSDictionaryOfVariableBindings(_page)]];
  38. NSMutableArray *arr = [NSMutableArray array];
  39. _deliveryUnreceiptVC = [[DeliveryRequirementNoReceiptController alloc] init];
  40. _deliveryReceiptVC = [[DeliveryRequirementReceiptController alloc] init];
  41. _deliveryUnreceiptVC.cNav = self.navigationController;
  42. _deliveryReceiptVC.cNav = self.navigationController;
  43. PageSwitchModel *model = [[PageSwitchModel alloc] init];
  44. model.title = @"未回执";
  45. model.controller = _deliveryUnreceiptVC;
  46. [arr addObject:model];
  47. model = [[PageSwitchModel alloc] init];
  48. model.title = @"已回执";
  49. model.controller = _deliveryReceiptVC;
  50. [arr addObject:model];
  51. self.page.datas = arr;
  52. }
  53. /**
  54. * 返回函数
  55. */
  56. - (void)goBack
  57. {
  58. [self.navigationController popViewControllerAnimated:YES];
  59. }
  60. @end