Commit 52a40820 authored by admin's avatar admin

修改筛选框问题

parent d9b53d05
...@@ -13,9 +13,26 @@ ...@@ -13,9 +13,26 @@
#import "PictureStoryViewController.h" #import "PictureStoryViewController.h"
#import "AddPictureViewController.h" #import "AddPictureViewController.h"
#import "TaxisView.h"
#import "ScreenView.h"
#import "MenuView.h"
#define kPictureTableViewCell @"pictureTabelViewCell" #define kPictureTableViewCell @"pictureTabelViewCell"
@interface PictureViewController () <UITableViewDelegate, UITableViewDataSource> @interface PictureViewController () <UITableViewDelegate, UITableViewDataSource, ScreenTableDelegate, TaxisViewDelegate, InspectTableViewDelegate>
@property (nonatomic, strong) MenuView *menuView;
@property (nonatomic, strong) TaxisView *taxisView;
@property (nonatomic, strong) ScreenView *screenView;
@property (nonatomic, strong) MenuButton *selctedButton;
@property (nonatomic, strong) UIView *bgView;
@property (nonatomic, assign) NSInteger selectRow;
@property (nonatomic, assign) NSInteger timeSelectNum;
@property (nonatomic, strong) UITableView *tableView; @property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) NSArray *test1Array; @property (nonatomic, strong) NSArray *test1Array;
@property (nonatomic, strong) NSArray *test2Array; @property (nonatomic, strong) NSArray *test2Array;
...@@ -33,6 +50,14 @@ ...@@ -33,6 +50,14 @@
[self setupTableView]; [self setupTableView];
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) {
self.edgesForExtendedLayout = UIRectEdgeNone;
self.extendedLayoutIncludesOpaqueBars = NO;
self.modalPresentationCapturesStatusBarAppearance = NO;
self.navigationController.navigationBar.translucent = NO;
}
// 初始化 // 初始化
self.test1Array = [NSArray arrayWithObjects:@"【服务口碑现场】第二期",@"讲述红星人自己的故事",@"【服务口碑现场】第一期", nil]; self.test1Array = [NSArray arrayWithObjects:@"【服务口碑现场】第二期",@"讲述红星人自己的故事",@"【服务口碑现场】第一期", nil];
self.test2Array = [NSArray arrayWithObjects:@"把第一次客户投诉变成商场服务提升的契机,变成商场服务提升的契机。",@"变成商场服务提升的契机,变成商场服务提升的契机。",@"把第一次客户投诉变成商场服务提升的契机,变成商场服务提升的契机。", nil]; self.test2Array = [NSArray arrayWithObjects:@"把第一次客户投诉变成商场服务提升的契机,变成商场服务提升的契机。",@"变成商场服务提升的契机,变成商场服务提升的契机。",@"把第一次客户投诉变成商场服务提升的契机,变成商场服务提升的契机。", nil];
...@@ -84,6 +109,162 @@ ...@@ -84,6 +109,162 @@
[self.navigationController pushViewController:addPic animated:YES]; [self.navigationController pushViewController:addPic animated:YES];
} }
- (void)dropCilck:(MenuButton *)sender
{
sender.isDrop = !sender.isDrop;
if (_selctedButton.tag == sender.tag) {
if (sender.isDrop) {
if (sender.tag == 4001) {
[self showRedView];
} else {
[self showGreenView];
}
sender.selected = YES;
} else {
if (sender.tag == 4001) {
[self closeRedView];
} else {
[self closeGreenView];
}
sender.selected = NO;
}
} else {
// 前一次选中的按钮 选中状态置为NO
_selctedButton.selected = NO;
_selctedButton.isDrop = NO;
// 进行选中状态为NO 的操作
// 2.判断当前是否有bgView 有->移除, 没有->跳过
if (_bgView) {
// _bgView存在
[_bgView removeFromSuperview];
_bgView = nil;
}
if (_taxisView) {
[_taxisView removeFromSuperview];
_taxisView = nil;
}
if (_screenView) {
[_screenView removeFromSuperview];
_screenView = nil;
}
// 将当前选中的按钮设置 选中状态为YES;
sender.selected = YES;
// 对选中按钮 进行相关操作
_selctedButton = (MenuButton *)sender;
if (sender.tag == 4001) {
[self showRedView];
} else {
[self showGreenView];
}
}
}
- (void)showRedView
{
if (!_bgView) {
_bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 45, kScreenWidth, kScreenHeight - 45)];
UITapGestureRecognizer *tapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(closeRedView)];
[_bgView addGestureRecognizer:tapGR];
}
if (!_taxisView) {
_taxisView = [[TaxisView alloc] init];
_taxisView.backgroundColor = [UIColor whiteColor];
}
_taxisView.delegate = self;
[self.view addSubview:_bgView];
[self.view insertSubview:_taxisView aboveSubview:_bgView];
_bgView.alpha = 0;
_bgView.backgroundColor = [UIColor blackColor];
CGRect toFrame = CGRectMake(0, 45, kScreenWidth, kTaxisViewHeight);
CGRect fromFrame = CGRectMake(0, -kTaxisViewHeight, kScreenWidth, kTaxisViewHeight);
_taxisView.alpha = 0.0;
_taxisView.frame = toFrame;
[UIView animateWithDuration:0.3 animations:^{
_bgView.alpha = 0.6;
_taxisView.alpha = 1.0;
// _taxisView.frame = toFrame;
}];
}
- (void)closeRedView
{
_selctedButton.isDrop = NO;
_selctedButton.selected = NO;
[_selctedButton setTitleColor:kInspectSectionButtonTextColor forState:UIControlStateNormal];
CGRect fromFrame = CGRectMake(0, -kTaxisViewHeight, kScreenWidth, kTaxisViewHeight);
[UIView animateWithDuration:0.3 animations:^{
_bgView.alpha = .0f;
//_taxisView.frame = fromFrame;
_taxisView.alpha = 0.0;
} completion:^(BOOL finished) {
[_bgView removeFromSuperview];
[_taxisView removeFromSuperview];
}];
}
- (void)showGreenView
{
if (!_bgView) {
_bgView = [[UIView alloc] initWithFrame:CGRectMake(0,64 + 45, kScreenWidth, kScreenHeight - 64 - 45)];
UITapGestureRecognizer *tapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(closeGreenView)];
[_bgView addGestureRecognizer:tapGR];
}
if (!_screenView) {
_screenView = [[ScreenView alloc] initWithTitleArray:[NSArray arrayWithObjects:@"待解决", @"已解决",@"已作废",nil]];
_screenView.delegate = self;
_screenView.inspectTableView.inspectDelegate = self;
_screenView.backgroundColor = [UIColor whiteColor];
}
[self.view addSubview:_bgView];
[self.view insertSubview:_screenView aboveSubview:_bgView];
_bgView.alpha = 0;
_bgView.backgroundColor = [UIColor blackColor];
CGRect toFrame = CGRectMake(0, 45, kScreenWidth, kScreenViewHeight);
CGRect fromFrame = CGRectMake(0, -kScreenViewHeight, kScreenWidth, kScreenViewHeight);
_screenView.frame = fromFrame;
[UIView animateWithDuration:0.3 animations:^{
_bgView.alpha = 0.6;
_screenView.frame = toFrame;
}];
}
- (void)closeGreenView
{
_selctedButton.isDrop = NO;
_selctedButton.selected = NO;
[_selctedButton setTitleColor:kInspectSectionButtonTextColor forState:UIControlStateNormal];
CGRect fromFrame = CGRectMake(0, -kScreenViewHeight, kScreenWidth, kScreenViewHeight);
[UIView animateWithDuration:0.3 animations:^{
_bgView.alpha = .0f;
_screenView.frame = fromFrame;
} completion:^(BOOL finished) {
[_bgView removeFromSuperview];
[_screenView removeFromSuperview];
}];
}
#pragma mark - UITableView Delegate/DataSource #pragma mark - UITableView Delegate/DataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
...@@ -172,6 +353,10 @@ ...@@ -172,6 +353,10 @@
[screenButton setTitle:@"筛选" forState:UIControlStateNormal]; [screenButton setTitle:@"筛选" forState:UIControlStateNormal];
[sectionView addSubview:screenButton]; [sectionView addSubview:screenButton];
taxiButton.tag = 4001;
[taxiButton addTarget:self action:@selector(dropCilck:) forControlEvents:UIControlEventTouchUpInside];
[screenButton addTarget:self action:@selector(dropCilck:) forControlEvents:UIControlEventTouchUpInside];
// taxiButton布局 // taxiButton布局
NSLayoutConstraint *taxiButtonTop = [NSLayoutConstraint constraintWithItem:taxiButton attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0]; NSLayoutConstraint *taxiButtonTop = [NSLayoutConstraint constraintWithItem:taxiButton attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[sectionView addConstraint:taxiButtonTop]; [sectionView addConstraint:taxiButtonTop];
......
...@@ -88,20 +88,12 @@ ...@@ -88,20 +88,12 @@
- (void)viewWillAppear:(BOOL)animated - (void)viewWillAppear:(BOOL)animated
{ {
[super viewWillAppear:animated]; [super viewWillAppear:animated];
[self.menuView.taxiButton addTarget:self action:@selector(dropCilck:) forControlEvents:UIControlEventTouchUpInside];
[self.menuView.screenButton addTarget:self action:@selector(dropCilck:) forControlEvents:UIControlEventTouchUpInside];
self.tabBarController.tabBar.hidden = YES; self.tabBarController.tabBar.hidden = YES;
[self requestQuestionList]; [self requestQuestionList];
} }
- (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
[self.menuView removeFromSuperview];
self.menuView = nil;
}
...@@ -155,6 +147,8 @@ ...@@ -155,6 +147,8 @@
[self.tableView reloadData]; [self.tableView reloadData];
[MBProgressHUD hideHUDForView:self.view animated:YES]; [MBProgressHUD hideHUDForView:self.view animated:YES];
} }
self.menuView.backgroundColor = kInspectSectionBackGroundColor;
}]; }];
} }
...@@ -193,7 +187,8 @@ ...@@ -193,7 +187,8 @@
} else { } else {
[self.tableView.footer endRefreshing]; [self.tableView.footer endRefreshing];
} }
self.menuView.backgroundColor = kInspectSectionBackGroundColor;
[self.tableView reloadData]; [self.tableView reloadData];
}]; }];
...@@ -316,7 +311,7 @@ ...@@ -316,7 +311,7 @@
- (void)showRedView - (void)showRedView
{ {
if (!_bgView) { if (!_bgView) {
_bgView = [[UIView alloc] initWithFrame:self.view.bounds]; _bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 45, kScreenWidth, kScreenHeight)];
UITapGestureRecognizer *tapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(closeRedView)]; UITapGestureRecognizer *tapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(closeRedView)];
[_bgView addGestureRecognizer:tapGR]; [_bgView addGestureRecognizer:tapGR];
} }
...@@ -333,12 +328,11 @@ ...@@ -333,12 +328,11 @@
_bgView.backgroundColor = [UIColor blackColor]; _bgView.backgroundColor = [UIColor blackColor];
CGRect toFrame = CGRectMake(0, 45, kScreenWidth, kTaxisViewHeight); CGRect toFrame = CGRectMake(0, 45, kScreenWidth, kTaxisViewHeight);
CGRect fromFrame = CGRectMake(0, -kTaxisViewHeight, kScreenWidth, kTaxisViewHeight); _taxisView.frame = toFrame;
_taxisView.alpha = 0.0;
_taxisView.frame = fromFrame; [UIView animateWithDuration:0.2 animations:^{
[UIView animateWithDuration:0.3 animations:^{
_bgView.alpha = 0.6; _bgView.alpha = 0.6;
_taxisView.frame = toFrame; _taxisView.alpha = 1.0;
}]; }];
} }
...@@ -348,10 +342,9 @@ ...@@ -348,10 +342,9 @@
_selctedButton.isDrop = NO; _selctedButton.isDrop = NO;
_selctedButton.selected = NO; _selctedButton.selected = NO;
[_selctedButton setTitleColor:kInspectSectionButtonTextColor forState:UIControlStateNormal]; [_selctedButton setTitleColor:kInspectSectionButtonTextColor forState:UIControlStateNormal];
CGRect fromFrame = CGRectMake(0, -kTaxisViewHeight, kScreenWidth, kTaxisViewHeight); [UIView animateWithDuration:0.2 animations:^{
[UIView animateWithDuration:0.3 animations:^{
_bgView.alpha = .0f; _bgView.alpha = .0f;
_taxisView.frame = fromFrame; _taxisView.alpha = 0.0;
} completion:^(BOOL finished) { } completion:^(BOOL finished) {
[_bgView removeFromSuperview]; [_bgView removeFromSuperview];
[_taxisView removeFromSuperview]; [_taxisView removeFromSuperview];
...@@ -362,7 +355,7 @@ ...@@ -362,7 +355,7 @@
- (void)showGreenView - (void)showGreenView
{ {
if (!_bgView) { if (!_bgView) {
_bgView = [[UIView alloc] initWithFrame:self.view.bounds]; _bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 45, kScreenWidth, kScreenHeight)];
UITapGestureRecognizer *tapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(closeGreenView)]; UITapGestureRecognizer *tapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(closeGreenView)];
[_bgView addGestureRecognizer:tapGR]; [_bgView addGestureRecognizer:tapGR];
} }
...@@ -385,12 +378,12 @@ ...@@ -385,12 +378,12 @@
_bgView.backgroundColor = [UIColor blackColor]; _bgView.backgroundColor = [UIColor blackColor];
CGRect toFrame = CGRectMake(0, 45, kScreenWidth, kMoreScreenViewHeight); CGRect toFrame = CGRectMake(0, 45, kScreenWidth, kMoreScreenViewHeight);
CGRect fromFrame = CGRectMake(0, -kMoreScreenViewHeight, kScreenWidth, kMoreScreenViewHeight); _screenView.frame = toFrame;
_screenView.alpha = 0.0;
_screenView.frame = fromFrame;
[UIView animateWithDuration:0.3 animations:^{ [UIView animateWithDuration:0.3 animations:^{
_bgView.alpha = 0.6; _bgView.alpha = 0.6;
_screenView.frame = toFrame; _screenView.alpha = 1.0;
}]; }];
} }
...@@ -400,10 +393,9 @@ ...@@ -400,10 +393,9 @@
_selctedButton.isDrop = NO; _selctedButton.isDrop = NO;
_selctedButton.selected = NO; _selctedButton.selected = NO;
[_selctedButton setTitleColor:kInspectSectionButtonTextColor forState:UIControlStateNormal]; [_selctedButton setTitleColor:kInspectSectionButtonTextColor forState:UIControlStateNormal];
CGRect fromFrame = CGRectMake(0, -kMoreScreenViewHeight, kScreenWidth, kMoreScreenViewHeight);
[UIView animateWithDuration:0.3 animations:^{ [UIView animateWithDuration:0.3 animations:^{
_bgView.alpha = .0f; _bgView.alpha = .0f;
_screenView.frame = fromFrame; _screenView.alpha = 0.0;
} completion:^(BOOL finished) { } completion:^(BOOL finished) {
[_bgView removeFromSuperview]; [_bgView removeFromSuperview];
[_screenView removeFromSuperview]; [_screenView removeFromSuperview];
...@@ -593,6 +585,8 @@ ...@@ -593,6 +585,8 @@
[MBProgressHUD hideHUDForView:weakSelf.view animated:YES]; [MBProgressHUD hideHUDForView:weakSelf.view animated:YES];
[weakSelf closeGreenView]; [weakSelf closeGreenView];
} }
self.menuView.backgroundColor = kInspectSectionBackGroundColor;
}]; }];
} }
...@@ -699,6 +693,8 @@ ...@@ -699,6 +693,8 @@
[MBProgressHUD hideHUDForView:weakSelf.view animated:YES]; [MBProgressHUD hideHUDForView:weakSelf.view animated:YES];
[weakSelf closeGreenView]; [weakSelf closeGreenView];
} }
self.menuView.backgroundColor = kInspectSectionBackGroundColor;
}]; }];
...@@ -752,21 +748,21 @@ ...@@ -752,21 +748,21 @@
if (!_menuView) { if (!_menuView) {
_menuView = [[MenuView alloc] init]; _menuView = [[MenuView alloc] init];
_menuView.translatesAutoresizingMaskIntoConstraints = NO; _menuView.translatesAutoresizingMaskIntoConstraints = NO;
_menuView.backgroundColor = kInspectSectionBackGroundColor; [_menuView.taxiButton addTarget:self action:@selector(dropCilck:) forControlEvents:UIControlEventTouchUpInside];
UIWindow *window = [[UIApplication sharedApplication].windows lastObject]; [_menuView.screenButton addTarget:self action:@selector(dropCilck:) forControlEvents:UIControlEventTouchUpInside];
[window addSubview:_menuView]; [self.view addSubview:_menuView];
NSLayoutConstraint *menuTop = [NSLayoutConstraint constraintWithItem:_menuView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:window attribute:NSLayoutAttributeTop multiplier:1.0 constant:64]; NSLayoutConstraint *menuTop = [NSLayoutConstraint constraintWithItem:_menuView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[window addConstraint:menuTop]; [self.view addConstraint:menuTop];
NSLayoutConstraint *menuLeft = [NSLayoutConstraint constraintWithItem:_menuView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:window attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0]; NSLayoutConstraint *menuLeft = [NSLayoutConstraint constraintWithItem:_menuView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[window addConstraint:menuLeft]; [self.view addConstraint:menuLeft];
NSLayoutConstraint *menuRight = [NSLayoutConstraint constraintWithItem:_menuView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:window attribute:NSLayoutAttributeRight multiplier:1.0 constant:0]; NSLayoutConstraint *menuRight = [NSLayoutConstraint constraintWithItem:_menuView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[window addConstraint:menuRight]; [self.view addConstraint:menuRight];
NSLayoutConstraint *menuHeight = [NSLayoutConstraint constraintWithItem:_menuView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:45]; NSLayoutConstraint *menuHeight = [NSLayoutConstraint constraintWithItem:_menuView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:45];
[window addConstraint:menuHeight]; [self.view addConstraint:menuHeight];
} }
return _menuView; return _menuView;
} }
...@@ -805,8 +801,9 @@ ...@@ -805,8 +801,9 @@
_searchBar = [[SearchToolBar alloc] init]; _searchBar = [[SearchToolBar alloc] init];
_searchBar.translatesAutoresizingMaskIntoConstraints = NO; _searchBar.translatesAutoresizingMaskIntoConstraints = NO;
[_searchBar.queryButton addTarget:self action:@selector(searchBarClick:) forControlEvents:UIControlEventTouchUpInside]; [_searchBar.queryButton addTarget:self action:@selector(searchBarClick:) forControlEvents:UIControlEventTouchUpInside];
[self.view insertSubview:_searchBar atIndex:999];
[self.view insertSubview:_searchBar aboveSubview:_tableView]; [self.view insertSubview:_searchBar aboveSubview:_tableView];
[self.view insertSubview:_searchBar aboveSubview:_noDataView];
NSLayoutConstraint *tableHeight = [NSLayoutConstraint constraintWithItem:_searchBar attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:50]; NSLayoutConstraint *tableHeight = [NSLayoutConstraint constraintWithItem:_searchBar attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:50];
[self.view addConstraint:tableHeight]; [self.view addConstraint:tableHeight];
...@@ -830,7 +827,7 @@ ...@@ -830,7 +827,7 @@
_noDataView.translatesAutoresizingMaskIntoConstraints = NO; _noDataView.translatesAutoresizingMaskIntoConstraints = NO;
[self.view addSubview:_noDataView]; [self.view addSubview:_noDataView];
NSLayoutConstraint *tableTop = [NSLayoutConstraint constraintWithItem:_noDataView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:0]; NSLayoutConstraint *tableTop = [NSLayoutConstraint constraintWithItem:_noDataView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:45];
[self.view addConstraint:tableTop]; [self.view addConstraint:tableTop];
NSLayoutConstraint *tableLeft = [NSLayoutConstraint constraintWithItem:_noDataView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0]; NSLayoutConstraint *tableLeft = [NSLayoutConstraint constraintWithItem:_noDataView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
...@@ -839,7 +836,7 @@ ...@@ -839,7 +836,7 @@
NSLayoutConstraint *tableRight = [NSLayoutConstraint constraintWithItem:_noDataView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeRight multiplier:1.0 constant:0]; NSLayoutConstraint *tableRight = [NSLayoutConstraint constraintWithItem:_noDataView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[self.view addConstraint:tableRight]; [self.view addConstraint:tableRight];
NSLayoutConstraint *tableBottom = [NSLayoutConstraint constraintWithItem:_noDataView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-40]; NSLayoutConstraint *tableBottom = [NSLayoutConstraint constraintWithItem:_noDataView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.view addConstraint:tableBottom]; [self.view addConstraint:tableBottom];
} }
return _noDataView; return _noDataView;
......
...@@ -102,8 +102,7 @@ ...@@ -102,8 +102,7 @@
[super viewWillAppear:animated]; [super viewWillAppear:animated];
self.tabBarController.tabBar.hidden = YES; self.tabBarController.tabBar.hidden = YES;
[self.menuView.taxiButton addTarget:self action:@selector(dropCilck:) forControlEvents:UIControlEventTouchUpInside];
[self.menuView.screenButton addTarget:self action:@selector(dropCilck:) forControlEvents:UIControlEventTouchUpInside];
} }
- (void)viewWillDisappear:(BOOL)animated - (void)viewWillDisappear:(BOOL)animated
...@@ -150,7 +149,8 @@ ...@@ -150,7 +149,8 @@
} else { } else {
[self.tableView.footer endRefreshing]; [self.tableView.footer endRefreshing];
} }
self.menuView.backgroundColor = kInspectSectionBackGroundColor;
[self.tableView reloadData]; [self.tableView reloadData];
}]; }];
...@@ -186,13 +186,14 @@ ...@@ -186,13 +186,14 @@
if (_taskListDataArray.count == 0) { if (_taskListDataArray.count == 0) {
self.noDataView.backgroundColor = [UIColor whiteColor]; self.noDataView.backgroundColor = [UIColor whiteColor];
[MBProgressHUD hideHUDForView:self.view animated:YES]; [MBProgressHUD hideHUDForView:self.view animated:YES];
} else { } else {
self.tableView.delegate = self; self.tableView.delegate = self;
self.tableView.dataSource = self; self.tableView.dataSource = self;
[MBProgressHUD hideHUDForView:self.view animated:YES]; [MBProgressHUD hideHUDForView:self.view animated:YES];
} }
self.menuView.backgroundColor = kInspectSectionBackGroundColor;
[self.tableView reloadData]; [self.tableView reloadData];
}]; }];
...@@ -241,6 +242,7 @@ ...@@ -241,6 +242,7 @@
if (_taskListDataArray.count == 0) { if (_taskListDataArray.count == 0) {
self.noDataView.backgroundColor = [UIColor whiteColor]; self.noDataView.backgroundColor = [UIColor whiteColor];
[MBProgressHUD hideHUDForView:self.view animated:YES]; [MBProgressHUD hideHUDForView:self.view animated:YES];
self.menuView.backgroundColor = kInspectSectionBackGroundColor;
} else { } else {
self.tableView.delegate = self; self.tableView.delegate = self;
...@@ -248,6 +250,8 @@ ...@@ -248,6 +250,8 @@
self.tableView.footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{ self.tableView.footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
[self requestMoreList]; [self requestMoreList];
}]; }];
self.menuView.backgroundColor = kInspectSectionBackGroundColor;
[MBProgressHUD hideHUDForView:self.view animated:YES]; [MBProgressHUD hideHUDForView:self.view animated:YES];
} }
...@@ -319,7 +323,7 @@ ...@@ -319,7 +323,7 @@
- (void)showRedView - (void)showRedView
{ {
if (!_bgView) { if (!_bgView) {
_bgView = [[UIView alloc] initWithFrame:self.view.bounds]; _bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 45, kScreenWidth, kScreenHeight - 45)];
UITapGestureRecognizer *tapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(closeRedView)]; UITapGestureRecognizer *tapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(closeRedView)];
[_bgView addGestureRecognizer:tapGR]; [_bgView addGestureRecognizer:tapGR];
} }
...@@ -336,12 +340,11 @@ ...@@ -336,12 +340,11 @@
_bgView.backgroundColor = [UIColor blackColor]; _bgView.backgroundColor = [UIColor blackColor];
CGRect toFrame = CGRectMake(0, 45, kScreenWidth, kTaxisViewHeight); CGRect toFrame = CGRectMake(0, 45, kScreenWidth, kTaxisViewHeight);
CGRect fromFrame = CGRectMake(0, -kTaxisViewHeight, kScreenWidth, kTaxisViewHeight); _taxisView.alpha = 0.0;
_taxisView.frame = toFrame;
_taxisView.frame = fromFrame;
[UIView animateWithDuration:0.3 animations:^{ [UIView animateWithDuration:0.3 animations:^{
_bgView.alpha = 0.6; _bgView.alpha = 0.6;
_taxisView.frame = toFrame; _taxisView.alpha = 1.0;
}]; }];
} }
...@@ -350,10 +353,9 @@ ...@@ -350,10 +353,9 @@
{ {
_selctedButton.isDrop = NO; _selctedButton.isDrop = NO;
_selctedButton.selected = NO; _selctedButton.selected = NO;
CGRect fromFrame = CGRectMake(0, -kTaxisViewHeight, kScreenWidth, kTaxisViewHeight);
[UIView animateWithDuration:0.3 animations:^{ [UIView animateWithDuration:0.3 animations:^{
_bgView.alpha = .0f; _bgView.alpha = .0f;
_taxisView.frame = fromFrame; _taxisView.alpha = 0.0;
} completion:^(BOOL finished) { } completion:^(BOOL finished) {
[_bgView removeFromSuperview]; [_bgView removeFromSuperview];
[_taxisView removeFromSuperview]; [_taxisView removeFromSuperview];
...@@ -364,7 +366,7 @@ ...@@ -364,7 +366,7 @@
- (void)showGreenView - (void)showGreenView
{ {
if (!_bgView) { if (!_bgView) {
_bgView = [[UIView alloc] initWithFrame:self.view.bounds]; _bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 45, kScreenWidth, kScreenHeight - 45)];
UITapGestureRecognizer *tapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(closeGreenView)]; UITapGestureRecognizer *tapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(closeGreenView)];
[_bgView addGestureRecognizer:tapGR]; [_bgView addGestureRecognizer:tapGR];
} }
...@@ -385,12 +387,11 @@ ...@@ -385,12 +387,11 @@
_bgView.backgroundColor = [UIColor blackColor]; _bgView.backgroundColor = [UIColor blackColor];
CGRect toFrame = CGRectMake(0, 45, kScreenWidth, kScreenViewHeight); CGRect toFrame = CGRectMake(0, 45, kScreenWidth, kScreenViewHeight);
CGRect fromFrame = CGRectMake(0, -kScreenViewHeight, kScreenWidth, kScreenViewHeight); _screenView.alpha = 0.0;
_screenView.frame = toFrame;
_screenView.frame = fromFrame;
[UIView animateWithDuration:0.3 animations:^{ [UIView animateWithDuration:0.3 animations:^{
_bgView.alpha = 0.6; _bgView.alpha = 0.6;
_screenView.frame = toFrame; _screenView.alpha = 1.0;
}]; }];
} }
...@@ -400,10 +401,9 @@ ...@@ -400,10 +401,9 @@
_selctedButton.isDrop = NO; _selctedButton.isDrop = NO;
_selctedButton.selected = NO; _selctedButton.selected = NO;
[_selctedButton setTitleColor:kInspectSectionButtonTextColor forState:UIControlStateNormal]; [_selctedButton setTitleColor:kInspectSectionButtonTextColor forState:UIControlStateNormal];
CGRect fromFrame = CGRectMake(0, -kScreenViewHeight, kScreenWidth, kScreenViewHeight);
[UIView animateWithDuration:0.3 animations:^{ [UIView animateWithDuration:0.3 animations:^{
_bgView.alpha = .0f; _bgView.alpha = .0f;
_screenView.frame = fromFrame; _screenView.alpha = 0.0;
} completion:^(BOOL finished) { } completion:^(BOOL finished) {
[_bgView removeFromSuperview]; [_bgView removeFromSuperview];
[_screenView removeFromSuperview]; [_screenView removeFromSuperview];
...@@ -548,6 +548,8 @@ ...@@ -548,6 +548,8 @@
[_tableView removeFromSuperview]; [_tableView removeFromSuperview];
_tableView = nil; _tableView = nil;
} }
self.menuView.backgroundColor = kInspectSectionBackGroundColor;
self.noDataView.backgroundColor = [UIColor whiteColor]; self.noDataView.backgroundColor = [UIColor whiteColor];
[MBProgressHUD hideHUDForView:self.view animated:YES]; [MBProgressHUD hideHUDForView:self.view animated:YES];
[self closeGreenView]; [self closeGreenView];
...@@ -557,6 +559,8 @@ ...@@ -557,6 +559,8 @@
[_noDataView removeFromSuperview]; [_noDataView removeFromSuperview];
_noDataView = nil; _noDataView = nil;
} }
self.menuView.backgroundColor = kInspectSectionBackGroundColor;
self.tableView.delegate = self; self.tableView.delegate = self;
self.tableView.dataSource = self; self.tableView.dataSource = self;
[self.tableView reloadData]; [self.tableView reloadData];
...@@ -635,6 +639,8 @@ ...@@ -635,6 +639,8 @@
[_tableView removeFromSuperview]; [_tableView removeFromSuperview];
_tableView = nil; _tableView = nil;
} }
self.menuView.backgroundColor = kInspectSectionBackGroundColor;
self.noDataView.backgroundColor = [UIColor whiteColor]; self.noDataView.backgroundColor = [UIColor whiteColor];
[MBProgressHUD hideHUDForView:self.view animated:YES]; [MBProgressHUD hideHUDForView:self.view animated:YES];
...@@ -643,6 +649,7 @@ ...@@ -643,6 +649,7 @@
[_noDataView removeFromSuperview]; [_noDataView removeFromSuperview];
_noDataView = nil; _noDataView = nil;
} }
self.menuView.backgroundColor = kInspectSectionBackGroundColor;
self.tableView.delegate = self; self.tableView.delegate = self;
self.tableView.dataSource = self; self.tableView.dataSource = self;
[self.tableView reloadData]; [self.tableView reloadData];
...@@ -691,12 +698,6 @@ ...@@ -691,12 +698,6 @@
[self.navigationController pushViewController:inspectTaskVC animated:YES]; [self.navigationController pushViewController:inspectTaskVC animated:YES];
} }
//// cell的高度
//- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
//{
// return 145;
//}
// section高度 // section高度
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{ {
...@@ -716,21 +717,21 @@ ...@@ -716,21 +717,21 @@
if (!_menuView) { if (!_menuView) {
_menuView = [[MenuView alloc] init]; _menuView = [[MenuView alloc] init];
_menuView.translatesAutoresizingMaskIntoConstraints = NO; _menuView.translatesAutoresizingMaskIntoConstraints = NO;
_menuView.backgroundColor = kInspectSectionBackGroundColor; [_menuView.taxiButton addTarget:self action:@selector(dropCilck:) forControlEvents:UIControlEventTouchUpInside];
UIWindow *window = [[UIApplication sharedApplication].windows lastObject]; [_menuView.screenButton addTarget:self action:@selector(dropCilck:) forControlEvents:UIControlEventTouchUpInside];
[window addSubview:_menuView]; [self.view addSubview:_menuView];
NSLayoutConstraint *menuTop = [NSLayoutConstraint constraintWithItem:_menuView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:window attribute:NSLayoutAttributeTop multiplier:1.0 constant:64]; NSLayoutConstraint *menuTop = [NSLayoutConstraint constraintWithItem:_menuView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[window addConstraint:menuTop]; [self.view addConstraint:menuTop];
NSLayoutConstraint *menuLeft = [NSLayoutConstraint constraintWithItem:_menuView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:window attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0]; NSLayoutConstraint *menuLeft = [NSLayoutConstraint constraintWithItem:_menuView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[window addConstraint:menuLeft]; [self.view addConstraint:menuLeft];
NSLayoutConstraint *menuRight = [NSLayoutConstraint constraintWithItem:_menuView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:window attribute:NSLayoutAttributeRight multiplier:1.0 constant:0]; NSLayoutConstraint *menuRight = [NSLayoutConstraint constraintWithItem:_menuView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[window addConstraint:menuRight]; [self.view addConstraint:menuRight];
NSLayoutConstraint *menuHeight = [NSLayoutConstraint constraintWithItem:_menuView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:45]; NSLayoutConstraint *menuHeight = [NSLayoutConstraint constraintWithItem:_menuView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:45];
[window addConstraint:menuHeight]; [self.view addConstraint:menuHeight];
} }
return _menuView; return _menuView;
} }
...@@ -769,7 +770,7 @@ ...@@ -769,7 +770,7 @@
_noDataView.translatesAutoresizingMaskIntoConstraints = NO; _noDataView.translatesAutoresizingMaskIntoConstraints = NO;
[self.view addSubview:_noDataView]; [self.view addSubview:_noDataView];
NSLayoutConstraint *tableTop = [NSLayoutConstraint constraintWithItem:_noDataView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:0]; NSLayoutConstraint *tableTop = [NSLayoutConstraint constraintWithItem:_noDataView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:45];
[self.view addConstraint:tableTop]; [self.view addConstraint:tableTop];
NSLayoutConstraint *tableLeft = [NSLayoutConstraint constraintWithItem:_noDataView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0]; NSLayoutConstraint *tableLeft = [NSLayoutConstraint constraintWithItem:_noDataView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment