DispatchRequirementHomeViewController.m 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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 "DispatchRequirementHomeViewController.h"
  9. @interface DispatchRequirementHomeViewController ()
  10. @end
  11. @implementation DispatchRequirementHomeViewController
  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 setBackgroundImage:[UIImage imageNamed:@"icon_back.png"]
  22. forState:UIControlStateNormal];
  23. [button addTarget:self action:@selector(goBack)
  24. forControlEvents:UIControlEventTouchUpInside];
  25. button.frame = CGRectMake(0, 0,15,18);
  26. UIBarButtonItem *menuButton = [[UIBarButtonItem alloc] initWithCustomView:button];
  27. self.navigationItem.leftBarButtonItem = menuButton;
  28. [self initUI];
  29. }
  30. #pragma mark - 私有函数
  31. /*
  32. 初始化UI
  33. */
  34. - (void)initUI{
  35. self.page = [[PageSwitchView alloc] init];
  36. [self.view addSubview:self.page];
  37. [self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[_page]|" options:0 metrics:nil views:NSDictionaryOfVariableBindings(_page)]];
  38. [self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[_page]-marg-|" options:0 metrics:@{@"marg":@(SCREENHEIGHT >= 812 ? 34 : 0)} views:NSDictionaryOfVariableBindings(_page)]];
  39. NSMutableArray *arr = [NSMutableArray array];
  40. _deliveryUnreceiptVC = [[DispatchRequirementNoReceiptController alloc] init];
  41. _deliveryReceiptVC = [[DispatchRequirementReceiptController alloc] init];
  42. _deliveryReceiptVC.refreshDelegate=self;
  43. _deliveryUnreceiptVC.cNav = self.navigationController;
  44. _deliveryReceiptVC.cNav = self.navigationController;
  45. PageSwitchModel *model = [[PageSwitchModel alloc] init];
  46. model.title = @"未回执";
  47. model.controller = _deliveryUnreceiptVC;
  48. [arr addObject:model];
  49. model = [[PageSwitchModel alloc] init];
  50. model.title = @"已回执";
  51. model.controller = _deliveryReceiptVC;
  52. [arr addObject:model];
  53. self.page.datas = arr;
  54. }
  55. -(void)refreshData
  56. {
  57. [ _deliveryUnreceiptVC refreshData];
  58. }
  59. /**
  60. * 返回函数
  61. */
  62. - (void)goBack
  63. {
  64. [self.navigationController popViewControllerAnimated:YES];
  65. }
  66. @end