Commit fea1f537 authored by Sandy's avatar Sandy

筛选列表回收逻辑修改

parent ce7d5509
...@@ -16,5 +16,5 @@ typedef void (^selectedRow)(NSInteger); ...@@ -16,5 +16,5 @@ typedef void (^selectedRow)(NSInteger);
@property (nonatomic, copy) selectedRow selecedBlock; @property (nonatomic, copy) selectedRow selecedBlock;
- (instancetype)customNew; - (instancetype)customNew;
- (void)hide;
@end @end
...@@ -111,7 +111,6 @@ ...@@ -111,7 +111,6 @@
- (void)showTableView { - (void)showTableView {
[self.coverView show]; [self.coverView show];
//self.leftSortAction(YES); //self.leftSortAction(YES);
[self viewController].navigationItem.leftBarButtonItem.enabled = NO;
WS(weakSelf) WS(weakSelf)
self.isTableOpen = YES; self.isTableOpen = YES;
...@@ -123,7 +122,6 @@ ...@@ -123,7 +122,6 @@
- (void)hideTableView { - (void)hideTableView {
[self.coverView hide]; [self.coverView hide];
// self.leftSortAction(NO); // self.leftSortAction(NO);
[self viewController].navigationItem.leftBarButtonItem.enabled = YES;
self.isTableOpen = NO; self.isTableOpen = NO;
WS(weakSelf) WS(weakSelf)
[UIView animateWithDuration:0.3 animations:^{ [UIView animateWithDuration:0.3 animations:^{
...@@ -224,6 +222,13 @@ ...@@ -224,6 +222,13 @@
return nil; return nil;
} }
- (void)hide {
if (self.isTableOpen == YES) {
[self leftAction:nil];
}
}
/* /*
// Only override drawRect: if you perform custom drawing. // Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation. // An empty implementation adversely affects performance during animation.
......
...@@ -17,4 +17,5 @@ typedef void (^selectedRow)(NSInteger); ...@@ -17,4 +17,5 @@ typedef void (^selectedRow)(NSInteger);
- (instancetype)sortView; - (instancetype)sortView;
- (void)hide;;
@end @end
...@@ -72,11 +72,7 @@ ...@@ -72,11 +72,7 @@
[self.window addSubview:_coverView]; [self.window addSubview:_coverView];
WS(weakSelf) WS(weakSelf)
_coverView.tapAction = ^{ _coverView.tapAction = ^{
if (weakSelf.arrTitles == weakSelf.arrLeft) { [weakSelf hide];
[weakSelf leftAction:nil];
}else{
[weakSelf rightBtnAction];
}
}; };
...@@ -127,9 +123,9 @@ ...@@ -127,9 +123,9 @@
//设置界面上其它的按钮是否可以点击 //设置界面上其它的按钮是否可以点击
- (void)setOtherUserInteraction:(BOOL)state { - (void)setOtherUserInteraction:(BOOL)state {
[self viewController].navigationItem.leftBarButtonItem.enabled = state; // [self viewController].navigationItem.leftBarButtonItem.enabled = state;
[self viewController].navigationItem.rightBarButtonItem.enabled = state; // [self viewController].navigationItem.rightBarButtonItem.enabled = state;
[self viewController].view.userInteractionEnabled = state; //[self viewController].view.userInteractionEnabled = state;
} }
...@@ -269,6 +265,17 @@ ...@@ -269,6 +265,17 @@
return nil; return nil;
} }
- (void)hide {
if (self.isTableOpen == YES) {
if (_arrTitles == _arrLeft) {
[self leftAction:nil];
}else{
[self rightBtnAction];
}
}
}
/* /*
// Only override drawRect: if you perform custom drawing. // Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation. // An empty implementation adversely affects performance during animation.
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#import "CommodityManagementTopView.h" #import "CommodityManagementTopView.h"
#import "UIView+Category.h" #import "UIView+Category.h"
#import "ManagementViewController.h" #import "ManagementViewController.h"
#import "CommodityManagementViewController.h"
@interface CommodityManagementTopView () @interface CommodityManagementTopView ()
@property (weak, nonatomic) IBOutlet UIButton *buttonAdd; @property (weak, nonatomic) IBOutlet UIButton *buttonAdd;
@property (weak, nonatomic) IBOutlet UIButton *buttonManagement; @property (weak, nonatomic) IBOutlet UIButton *buttonManagement;
...@@ -25,13 +26,20 @@ ...@@ -25,13 +26,20 @@
- (IBAction)managementAct:(id)sender { - (IBAction)managementAct:(id)sender {
ManagementViewController *manageVC = [[ManagementViewController alloc] init]; ManagementViewController *manageVC = [[ManagementViewController alloc] init];
[self hideSortView];
[[self viewController] PushViewController:manageVC animated:YES]; [[self viewController] PushViewController:manageVC animated:YES];
CLog(@"m"); CLog(@"m");
} }
- (IBAction)addAct:(id)sender { - (IBAction)addAct:(id)sender {
[self hideSortView];
CLog(@"a"); CLog(@"a");
} }
- (void)hideSortView {
CommodityManagementViewController *commodityVC = (CommodityManagementViewController *)[self viewController];
[commodityVC.sorView hide];
}
/* /*
// Only override drawRect: if you perform custom drawing. // Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation. // An empty implementation adversely affects performance during animation.
......
...@@ -47,6 +47,12 @@ ...@@ -47,6 +47,12 @@
} }
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
[self.sortView hide];
}
- (void)setUpCollectionView { - (void)setUpCollectionView {
UICollectionViewFlowLayout *layOut = [[UICollectionViewFlowLayout alloc] init]; UICollectionViewFlowLayout *layOut = [[UICollectionViewFlowLayout alloc] init];
layOut.minimumLineSpacing = 10; layOut.minimumLineSpacing = 10;
......
...@@ -7,7 +7,9 @@ ...@@ -7,7 +7,9 @@
// //
#import "IBTUIViewController.h" #import "IBTUIViewController.h"
#import "CommodityManagementSortView.h"
@interface CommodityManagementViewController : IBTUIViewController @interface CommodityManagementViewController : IBTUIViewController
@property (nonatomic, strong) CommodityManagementSortView *sorView;
@end @end
...@@ -8,14 +8,12 @@ ...@@ -8,14 +8,12 @@
#import "CommodityManagementViewController.h" #import "CommodityManagementViewController.h"
#import "CommodityManagementTopView.h" #import "CommodityManagementTopView.h"
#import "CommodityManagementSortView.h"
#import "UITableView+Category.h" #import "UITableView+Category.h"
#import "CommodityTableViewCell.h" #import "CommodityTableViewCell.h"
#define kCellId @"CommodityTableViewCell.h" #define kCellId @"CommodityTableViewCell.h"
@interface CommodityManagementViewController ()<UITableViewDelegate, UITableViewDataSource> @interface CommodityManagementViewController ()<UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) CommodityManagementTopView *topView; @property (nonatomic, strong) CommodityManagementTopView *topView;
@property (nonatomic, strong) CommodityManagementSortView *sorView;
@property (nonatomic, strong) UITableView *tableView; @property (nonatomic, strong) UITableView *tableView;
@end @end
...@@ -47,12 +45,20 @@ ...@@ -47,12 +45,20 @@
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
} }
#pragma mark =========== action =========== #pragma mark =========== action ===========
- (void)searchAct { - (void)searchAct {
[self.sorView hide];
CLog(@"search"); CLog(@"search");
} }
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
[self.sorView hide];
}
#pragma mark =========== tableview delegate =========== #pragma mark =========== tableview delegate ===========
......
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
// //
#import "IBTUIViewController.h" #import "IBTUIViewController.h"
#import "CommodityManagementSortView.h"
@interface ManagementViewController : IBTUIViewController @interface ManagementViewController : IBTUIViewController
@property (nonatomic, strong) CommodityManagementSortView *sorView;
@end @end
...@@ -7,14 +7,12 @@ ...@@ -7,14 +7,12 @@
// //
#import "ManagementViewController.h" #import "ManagementViewController.h"
#import "CommodityManagementSortView.h"
#import "CommodityTableViewCell.h" #import "CommodityTableViewCell.h"
#import "UITableView+Category.h" #import "UITableView+Category.h"
#import "CommodityMutipleSelectBottomView.h" #import "CommodityMutipleSelectBottomView.h"
#define kCellId @"CommodityTableViewCell.h" #define kCellId @"CommodityTableViewCell.h"
@interface ManagementViewController ()<UITableViewDelegate, UITableViewDataSource> @interface ManagementViewController ()<UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) CommodityManagementSortView *sorView;
@property (nonatomic, strong) UITableView *tableView; @property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) CommodityMutipleSelectBottomView *bottomView; @property (nonatomic, strong) CommodityMutipleSelectBottomView *bottomView;
......
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