ConsumerViewController.m 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. //
  2. // ConsumerViewController.m
  3. // jitao
  4. //
  5. // Created by 罗云飞 on 2018/8/10.
  6. // Copyright © 2018年 罗云飞. All rights reserved.
  7. //
  8. #import "ConsumerViewController.h"
  9. #import "XFQBViewController.h"
  10. #import "XFZQViewController.h"
  11. #import "XFCGViewController.h"
  12. #import "XFXQViewController.h"
  13. #import "XFGWViewController.h"
  14. #import "XFZJViewController.h"
  15. #import "ZJSliderView.h"
  16. @interface ConsumerViewController (){
  17. XFQBViewController *vc1;
  18. XFZQViewController *vc2;
  19. XFCGViewController *vc3;
  20. XFXQViewController *vc4;
  21. XFGWViewController *vc5;
  22. XFZJViewController *vc6;
  23. }
  24. @end
  25. @implementation ConsumerViewController
  26. - (void)viewDidLoad {
  27. [super viewDidLoad];
  28. [self setNavTitle:@"咨询单列表"];
  29. // 创建分段控制器
  30. [self createSliderView];
  31. // Do any additional setup after loading the view.
  32. }
  33. #pragma mark - 创建分段控制器
  34. - (void)createSliderView {
  35. self.automaticallyAdjustsScrollViewInsets = NO;
  36. // UILabel *line = [[UILabel alloc] initWithFrame:CGRectMake(0.0, 44, SCREEN_WIDTH, 0.8)];
  37. // line.backgroundColor = NewLineGrayColor;
  38. // [self.view addSubview:line];
  39. ZJSliderView *slider = [[ZJSliderView alloc] initWithFrame:CGRectMake(0.0f,NavHeader, SCREEN_WIDTH, SCREEN_HEIGHT-NavHeader)];
  40. __weak typeof(self) weakSelf = self;
  41. [slider setNewZJSlider:^(int index) {
  42. [weakSelf autoDownRefresh:index];
  43. }];
  44. vc1 = [[XFQBViewController alloc] init];
  45. vc1.title = @"全部";
  46. vc2 = [[XFZQViewController alloc] init];
  47. vc2.title = @"赚钱订单";
  48. vc3 = [[XFCGViewController alloc] init];
  49. vc3.title = @"成果订单";
  50. vc4 = [[XFXQViewController alloc] init];
  51. vc4.title = @"需求订单";
  52. vc5 = [[XFGWViewController alloc] init];
  53. vc5.title = @"顾问订单";
  54. vc6 = [[XFZJViewController alloc] init];
  55. vc6.title = @"专家订单";
  56. int page;
  57. self.type = @"全部订单";
  58. if ([self.type isEqualToString:@"全部订单"]) {
  59. page = 0;
  60. }else if ([self.type isEqualToString:@"赚钱订单"]){
  61. page = 1;
  62. }else if ([self.type isEqualToString:@"成果订单"]){
  63. page = 2;
  64. }else if ([self.type isEqualToString:@"需求订单"]){
  65. page = 3;
  66. }else if ([self.type isEqualToString:@"顾问订单"]){
  67. page = 4;
  68. }else{
  69. page = 5;
  70. }
  71. [slider setViewControllers:@[vc1,vc2,vc3,vc4,vc5,vc6] owner:self page:page];
  72. [self.view addSubview:slider];
  73. UIView *controlView = [slider topControlViewWithFrame:CGRectMake(0, NavHeader, SCREEN_WIDTH, 44) titleLabelWidth:SCREEN_WIDTH/6 page:page];
  74. [self.view addSubview:controlView];
  75. }
  76. - (void)autoDownRefresh:(NSInteger)index
  77. {
  78. if (index == 0) {
  79. // [Purchaseintentionvc networkRequest:nil];
  80. }else if (index == 1) {
  81. // [ordervc networkRequest:nil];
  82. }else if (index == 2) {
  83. // [Demandvc networkRequest:nil];
  84. }else if (index == 3) {
  85. // [expertvc networkRequest:nil];
  86. }else if (index == 4) {
  87. // [policyvc networkRequest:nil];
  88. }else if (index == 5) {
  89. // [policyvc networkRequest:nil];
  90. }
  91. }
  92. - (void)didReceiveMemoryWarning {
  93. [super didReceiveMemoryWarning];
  94. // Dispose of any resources that can be recreated.
  95. }
  96. /*
  97. #pragma mark - Navigation
  98. // In a storyboard-based application, you will often want to do a little preparation before navigation
  99. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  100. // Get the new view controller using [segue destinationViewController].
  101. // Pass the selected object to the new view controller.
  102. }
  103. */
  104. @end