ServiceproviderViewController.m 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. //
  2. // ServiceproviderViewController.m
  3. // jitao
  4. //
  5. // Created by 罗云飞 on 2018/8/10.
  6. // Copyright © 2018年 罗云飞. All rights reserved.
  7. //
  8. #import "ServiceproviderViewController.h"
  9. #import "ZJSliderView.h"
  10. #import "QBViewController.h"
  11. #import "ZQViewController.h"
  12. #import "CGViewController.h"
  13. #import "XQViewController.h"
  14. #import "HYViewController.h"
  15. #import "OrderZJViewController.h"
  16. @interface ServiceproviderViewController (){
  17. QBViewController *qbvc;
  18. ZQViewController *zqvc;
  19. CGViewController *cgvc;
  20. XQViewController *xqvc;
  21. HYViewController *hyvc;
  22. OrderZJViewController *zjvc;
  23. }
  24. @end
  25. @implementation ServiceproviderViewController
  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. ZJSliderView *slider = [[ZJSliderView alloc] initWithFrame:CGRectMake(0.0f,NavHeader, SCREEN_WIDTH, SCREEN_HEIGHT-NavHeader)];
  36. __weak typeof(self) weakSelf = self;
  37. [slider setNewZJSlider:^(int index) {
  38. [weakSelf autoDownRefresh:index];
  39. }];
  40. qbvc = [[QBViewController alloc] init];
  41. qbvc.title = @"全部";
  42. zqvc = [[ZQViewController alloc] init];
  43. zqvc.title = @"赚钱订单";
  44. cgvc = [[CGViewController alloc] init];
  45. cgvc.title = @"成果订单";
  46. xqvc = [[XQViewController alloc] init];
  47. xqvc.title = @"需求订单";
  48. hyvc = [[HYViewController alloc] init];
  49. hyvc.title = @"顾问订单";
  50. zjvc = [[OrderZJViewController alloc] init];
  51. zjvc.title = @"专家订单";
  52. self.type = @"全部订单";
  53. int page;
  54. if ([self.type isEqualToString:@"全部订单"]) {
  55. page = 0;
  56. }else if ([self.type isEqualToString:@"赚钱订单"]){
  57. page = 1;
  58. }else if ([self.type isEqualToString:@"成果订单"]){
  59. page = 2;
  60. }else if ([self.type isEqualToString:@"需求订单"]){
  61. page = 3;
  62. }else if ([self.type isEqualToString:@"顾问订单"]){
  63. page = 4;
  64. }else{
  65. page = 5;
  66. }
  67. [slider setViewControllers:@[qbvc,zqvc,cgvc,xqvc,hyvc,zjvc] owner:self page:page];
  68. [self.view addSubview:slider];
  69. UIView *controlView = [slider topControlViewWithFrame:CGRectMake(0, NavHeader, SCREEN_WIDTH, 44) titleLabelWidth:SCREEN_WIDTH/6 page:page];
  70. [self.view addSubview:controlView];
  71. }
  72. - (void)autoDownRefresh:(NSInteger)index
  73. {
  74. if (index == 0) {
  75. // [Purchaseintentionvc networkRequest:nil];
  76. }else if (index == 1) {
  77. // [ordervc networkRequest:nil];
  78. }else if (index == 2) {
  79. // [Demandvc networkRequest:nil];
  80. }else if (index == 3) {
  81. // [expertvc networkRequest:nil];
  82. }else if (index == 4) {
  83. // [policyvc networkRequest:nil];
  84. }else if (index == 5) {
  85. // [policyvc networkRequest:nil];
  86. }
  87. }
  88. - (void)didReceiveMemoryWarning {
  89. [super didReceiveMemoryWarning];
  90. // Dispose of any resources that can be recreated.
  91. }
  92. /*
  93. #pragma mark - Navigation
  94. // In a storyboard-based application, you will often want to do a little preparation before navigation
  95. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  96. // Get the new view controller using [segue destinationViewController].
  97. // Pass the selected object to the new view controller.
  98. }
  99. */
  100. @end