AddWorkSheetViewController.m 3.31 KB
Newer Older
陈俊俊's avatar
陈俊俊 committed
1 2 3 4 5 6 7 8 9 10
//
//  AddWorkSheetViewController.m
//  XFFruit
//
//  Created by 陈俊俊 on 15/8/12.
//  Copyright (c) 2015年 Xummer. All rights reserved.
//

#import "AddWorkSheetViewController.h"
#import "TopSheetView.h"
n22's avatar
n22 committed
11
#import "BottomSheetView.h"
n22's avatar
n22 committed
12 13 14
#define TopHeight 284
#define BottomHeight 300
#define SpaceHeight 20
n22's avatar
n22 committed
15 16 17 18 19 20 21 22 23
#define BottomViewHeight 60



typedef enum : NSUInteger {
    SaveTag = 7000,
    CommitTag,
} BtnTag;

n22's avatar
n22 committed
24
@interface AddWorkSheetViewController ()<TopSheetViewDelegate,UIScrollViewDelegate>
陈俊俊's avatar
陈俊俊 committed
25
{
n22's avatar
n22 committed
26
    UIScrollView *_scrollView;
陈俊俊's avatar
陈俊俊 committed
27
    TopSheetView *_sheetView;
n22's avatar
n22 committed
28
    BottomSheetView *_bottomView;
陈俊俊's avatar
陈俊俊 committed
29 30 31 32 33 34 35
}
@end

@implementation AddWorkSheetViewController

- (void)viewDidLoad {
    [super viewDidLoad];
n22's avatar
n22 committed
36
    self.title = @"加工单";
陈俊俊's avatar
陈俊俊 committed
37 38 39 40
    //布局
    [self bulidLayout];
}
- (void)bulidLayout{
n22's avatar
n22 committed
41
    self.view.backgroundColor  = XXFBgColor;
n22's avatar
n22 committed
42
    _scrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(0,0, ScreenSize.width, ScreenSize.height- 64 - BottomViewHeight )];
n22's avatar
n22 committed
43 44 45 46 47
    _scrollView.showsHorizontalScrollIndicator  = NO;
    _scrollView.showsVerticalScrollIndicator = NO;
    _scrollView.contentSize = CGSizeMake(ScreenSize.width, TopHeight+ BottomHeight + SpaceHeight*2);
    [self.view addSubview:_scrollView];
    
n22's avatar
n22 committed
48 49
    
    UIView *footView = [[UIView alloc]initWithFrame:CGRectMake(0, ScreenSize.height - BottomViewHeight - 64, ScreenSize.width, BottomViewHeight)];
陈俊俊's avatar
陈俊俊 committed
50
    UIButton *saveBtn =  [IBTCustomButtom creatButtonWithFrame:CGRectMake(15, 8, (ScreenSize.width - 15*3)/2, 44) target:self sel:@selector(btnClick:) tag:SaveTag image:nil title:@"保存" titleColor: [UIColor whiteColor] isCorner:YES corner:5 bgColor:GXF_SAVE_COLOR];
n22's avatar
n22 committed
51 52
    [footView addSubview:saveBtn];
    
陈俊俊's avatar
陈俊俊 committed
53
    UIButton *commitBtn = [IBTCustomButtom creatButtonWithFrame:CGRectMake(CGRectGetMaxX(saveBtn.frame) + 15, 8, (ScreenSize.width - 15*3)/2, 44) target:self sel:@selector(btnClick:) tag:CommitTag image:nil title:@"提交" titleColor: [UIColor whiteColor] isCorner:YES corner:5 bgColor:GXF_COMMIT_COLOR];
n22's avatar
n22 committed
54 55 56 57
    [footView addSubview:commitBtn];
    
    [self.view addSubview:footView];
    
陈俊俊's avatar
陈俊俊 committed
58 59
    _sheetView = [[TopSheetView alloc]initWithFrame:CGRectMake(0, 0, ScreenSize.width, TopHeight)];
    _sheetView.delegate = self;
n22's avatar
n22 committed
60 61
    [_scrollView addSubview:_sheetView];
    
n22's avatar
n22 committed
62
    _bottomView = [[BottomSheetView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(_sheetView.frame) + 20, ScreenSize.width,BottomHeight)];
n22's avatar
n22 committed
63 64 65 66 67
    _bottomView.backgroundColor = [UIColor whiteColor];
    [_scrollView addSubview:_bottomView];
}

- (void)btnClick:(UIButton *)btn{
n22's avatar
n22 committed
68
    
n22's avatar
n22 committed
69

陈俊俊's avatar
陈俊俊 committed
70 71
}

n22's avatar
n22 committed
72 73


陈俊俊's avatar
陈俊俊 committed
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
#pragma mark - 协议方法
- (void)hiddenKeyBoard{
    [self keyboardHidden];
}
- (void)keyboardHidden{
    [_sheetView.titleTextFiled resignFirstResponder];
    [_sheetView.peopleTextFiled resignFirstResponder];
    [_sheetView.peopleTextFiled resignFirstResponder];
    [_sheetView.phoneTextFiled resignFirstResponder];
    [_sheetView.remarkTextView resignFirstResponder];
}


- (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