| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- //
- // ConsumerViewController.m
- // jitao
- //
- // Created by 罗云飞 on 2018/8/10.
- // Copyright © 2018年 罗云飞. All rights reserved.
- //
- #import "ConsumerViewController.h"
- #import "XFQBViewController.h"
- #import "XFZQViewController.h"
- #import "XFCGViewController.h"
- #import "XFXQViewController.h"
- #import "XFGWViewController.h"
- #import "XFZJViewController.h"
- #import "ZJSliderView.h"
- @interface ConsumerViewController (){
- XFQBViewController *vc1;
- XFZQViewController *vc2;
- XFCGViewController *vc3;
- XFXQViewController *vc4;
- XFGWViewController *vc5;
- XFZJViewController *vc6;
- }
- @end
- @implementation ConsumerViewController
- - (void)viewDidLoad {
- [super viewDidLoad];
- [self setNavTitle:@"咨询单列表"];
- // 创建分段控制器
- [self createSliderView];
- // Do any additional setup after loading the view.
- }
- #pragma mark - 创建分段控制器
- - (void)createSliderView {
- self.automaticallyAdjustsScrollViewInsets = NO;
- // UILabel *line = [[UILabel alloc] initWithFrame:CGRectMake(0.0, 44, SCREEN_WIDTH, 0.8)];
- // line.backgroundColor = NewLineGrayColor;
- // [self.view addSubview:line];
-
- ZJSliderView *slider = [[ZJSliderView alloc] initWithFrame:CGRectMake(0.0f,NavHeader, SCREEN_WIDTH, SCREEN_HEIGHT-NavHeader)];
- __weak typeof(self) weakSelf = self;
- [slider setNewZJSlider:^(int index) {
- [weakSelf autoDownRefresh:index];
- }];
- vc1 = [[XFQBViewController alloc] init];
- vc1.title = @"全部";
-
- vc2 = [[XFZQViewController alloc] init];
- vc2.title = @"赚钱订单";
-
- vc3 = [[XFCGViewController alloc] init];
- vc3.title = @"成果订单";
-
- vc4 = [[XFXQViewController alloc] init];
- vc4.title = @"需求订单";
-
- vc5 = [[XFGWViewController alloc] init];
- vc5.title = @"顾问订单";
-
- vc6 = [[XFZJViewController alloc] init];
- vc6.title = @"专家订单";
- int page;
- self.type = @"全部订单";
- if ([self.type isEqualToString:@"全部订单"]) {
- page = 0;
- }else if ([self.type isEqualToString:@"赚钱订单"]){
- page = 1;
- }else if ([self.type isEqualToString:@"成果订单"]){
- page = 2;
- }else if ([self.type isEqualToString:@"需求订单"]){
- page = 3;
- }else if ([self.type isEqualToString:@"顾问订单"]){
- page = 4;
- }else{
- page = 5;
- }
- [slider setViewControllers:@[vc1,vc2,vc3,vc4,vc5,vc6] owner:self page:page];
- [self.view addSubview:slider];
- UIView *controlView = [slider topControlViewWithFrame:CGRectMake(0, NavHeader, SCREEN_WIDTH, 44) titleLabelWidth:SCREEN_WIDTH/6 page:page];
- [self.view addSubview:controlView];
- }
- - (void)autoDownRefresh:(NSInteger)index
- {
- if (index == 0) {
- // [Purchaseintentionvc networkRequest:nil];
- }else if (index == 1) {
- // [ordervc networkRequest:nil];
- }else if (index == 2) {
- // [Demandvc networkRequest:nil];
- }else if (index == 3) {
- // [expertvc networkRequest:nil];
- }else if (index == 4) {
- // [policyvc networkRequest:nil];
- }else if (index == 5) {
- // [policyvc networkRequest:nil];
- }
-
- }
- - (void)didReceiveMemoryWarning {
- [super didReceiveMemoryWarning];
- // Dispose of any resources that can be recreated.
- }
- /*
- #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.
- }
- */
- @end
|