123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157 |
- //
- // ZBMonthOrderVC.m
- // ZBProject
- //
- // Created by 学丽 on 2019/4/9.
- // Copyright © 2019 ZB. All rights reserved.
- //
- #import "ZBMonthOrderVC.h"
- #import "ZBEstimatedViewController.h"
- @interface ZBMonthOrderVC ()<UIScrollViewDelegate,MLMSegmentHeadDelegate,MLMSegmentScrollDelegate>
- {
- NSString *typs;
- }
- @property (nonatomic, strong) UIScrollView *scrollView;
- @property (nonatomic, strong)MLMSegmentHead *titleView;
- @property (nonatomic, strong) MLMSegmentScroll *segScroll;
- @property (nonatomic, assign) NSInteger currentIndex;
- @property (nonatomic, strong) NSArray *childVCArr;
- @property(nonatomic,strong)UIButton *dateSeleteBtn;
- @property (nonatomic, strong) LDCalendarView *calendarView ;
- @property (nonatomic, strong) CCAlertShowView *alertShowView;
- @end
- @implementation ZBMonthOrderVC
- - (void)viewDidLoad {
- [super viewDidLoad];
- [self.view bringSubviewToFront:self.navBar];
- typs = @"1";
- [self initNavs];
-
- }
- -(void)initNavs
- {
- [self configChildViewController];
- self.view.backgroundColor=[UIColor lineColor];
- [self.navBar setCustomRightButtons:@[self.dateSeleteBtn]];
- UIButton *returnBtn =[[UIButton alloc]initWithFrame:CGRectMake(0, 0, 30, 20)];
- [returnBtn addTarget:self action:@selector(returnClickBtn) forControlEvents:UIControlEventTouchUpInside];
- [returnBtn setImage:[UIImage imageNamed:@"return_white"] forState:UIControlStateNormal];
- returnBtn.adjustsImageWhenHighlighted = NO;
- [self.navBar setCustomLeftButtons:@[returnBtn]];
-
- [self creatSwitchView];
- }
- - (void)creatSwitchView {
- self.view.backgroundColor = [UIColor backgroudColor];
-
-
- self.titleView = [[MLMSegmentHead alloc] initWithFrame:CGRectMake(50, KStatusBarHeight, SCREEN_WIDTH-100, NavBarHeight-KStatusBarHeight) titles:@[@"预估收益",@"结算收益"] headStyle:SegmentHeadStyleLine layoutStyle:MLMSegmentLayoutCenter];
- self.titleView.headColor = [UIColor clearColor];
- self.titleView.bottomLineHeight = 1;
- self.titleView.bottomLineColor = [UIColor whiteColor];
- self.titleView.fontScale = 1;
- self.titleView.lineScale = .4;
- self.titleView.fontSize = 14;
- self.titleView.fontScale=1.1;
- self.titleView.bottomLineHeight=0;
- self.titleView.equalSize = YES;
- // self.titleView.delegate=self;
- self.titleView.showIndex = 0;
- self.titleView.selectColor = [UIColor whiteColor];
- self.titleView.deSelectColor = [UIColor whiteColor];
- self.titleView.lineColor = [UIColor whiteColor];
- self.segScroll = [[MLMSegmentScroll alloc] initWithFrame:CGRectMake(0, NavBarHeight, SCREEN_WIDTH, SCREEN_HEIGHT-NavBarHeight) vcOrViews:self.childVCArr];
- self.segScroll.segDelegate=self;
- self.segScroll.loadAll = YES;
- [MLMSegmentManager associateHead:self.titleView withScroll:self.segScroll completion:^{
-
- [self.view addSubview:self.segScroll];
- }];
- [self.navBar addSubview:self.titleView];
- self.titleView.centerX = self.navBar.centerX;
-
- }
- -(void)scrollEndIndex:(NSInteger)index
- {
- self.currentIndex = index;
- }
- - (void)configChildViewController {
-
- ZBEstimatedViewController *ticket = [[ZBEstimatedViewController alloc] init];
- ticket.types=@"1";
- ticket.view.y = NavBarHeight;
-
- ZBEstimatedViewController *goods = [[ZBEstimatedViewController alloc] init];
- goods.types=@"2";
- goods.view.y = NavBarHeight;
- self.currentIndex = 0;
- self.childVCArr = @[ticket,goods];
-
- }
- -(void)viewWillAppear:(BOOL)animated
- {
- [super viewWillAppear:animated];
- self.navBar.navTitleLabel.text=@"";
- }
- -(void)returnClickBtn
- {
- [self.navigationController popViewControllerAnimated:YES];
- }
- #pragma mark --------------------- MLMSegmentHeadDelegate ---------
- - (void)didSelectedIndex:(NSInteger)index {
- self.currentIndex = index;
- // [self transitionFromViewController:self.childVCArr[self.currentIndex] toViewController:self.childVCArr[index] duration:0.3 options:UIViewAnimationOptionCurveEaseOut animations:nil completion:^(BOOL finished) {
- //
- // }];
- }
- - (UIButton *)dateSeleteBtn {
- if (!_dateSeleteBtn) {
- _dateSeleteBtn = [UIButton buttonWithType:UIButtonTypeCustom];
- _dateSeleteBtn.frame=CGRectMake(0, 0, 40, 50);
- [_dateSeleteBtn setImage:[UIImage imageNamed:@"calendar"] forState:UIControlStateNormal];
- [_dateSeleteBtn addTarget:self action:@selector(clickAction) forControlEvents:UIControlEventTouchUpInside];
- _dateSeleteBtn.adjustsImageWhenHighlighted=NO;
- }
- return _dateSeleteBtn;
- }
- -(void)clickAction
- {
- ZBIncomeViewController *incomV =[[ZBIncomeViewController alloc]init];
-
-
- incomV.isDay =1;//按天
- incomV.yearMonthDay=[PublicFunction getCurrentDay];
- if (self.currentIndex == 0) {
- incomV.type=@"1";//1:预估收入 2:结算收入
- }else{
- incomV.type=@"2";//1:预估收入 2:结算收入
- }
- incomV.isShow=@"1";
- [self.navigationController pushViewController:incomV animated:YES];
-
- }
- #pragma mark - ITDatePickerControllerDelegate
- - (void)datePickerController:(ITDatePickerController *)datePickerController didSelectedDate:(NSDate *)date dateString:(NSString *)dateString {
- NSLog(@"%@",dateString);
-
- }
- @end
|