Skip to content

Commit 718151c

Browse files
committed
优化一些bug
1 parent ad40a6a commit 718151c

File tree

12 files changed

+33
-17
lines changed

12 files changed

+33
-17
lines changed

Coding_iOS/Controllers/RootControllers/MyTask_RootViewController.m

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ - (void)viewDidLoad
8181
});
8282

8383
UIBarButtonItem *addBar = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"addBtn_Nav"] style:UIBarButtonItemStylePlain target:self action:@selector(addItemClicked:)];
84-
// UIBarButtonItem *screenBar = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"a1-筛选"] style:UIBarButtonItemStylePlain target:self action:@selector(screenItemClicked:)];
85-
UIBarButtonItem *screenBar = [self HDCustomNavButtonWithTitle:nil imageName:@"a1-筛选" target:self action:@selector(screenItemClicked:)];
84+
UIBarButtonItem *screenBar = [self HDCustomNavButtonWithTitle:nil imageName:@"a1-screen" target:self action:@selector(screenItemClicked:)];
8685
self.navigationItem.rightBarButtonItems = @[addBar, screenBar];
8786

8887

@@ -99,17 +98,20 @@ - (void)viewDidLoad
9998

10099
_screenView = [ScreenView creat];
101100
_screenView.selectBlock = ^(NSString *keyword, NSString *status, NSString *label) {
102-
// screenBar.image = [UIImage imageNamed:@"a1-已筛"];
103-
[((UIButton *)screenBar.customView) setImage:[UIImage imageNamed:@"a1-已筛"] forState:UIControlStateNormal];
101+
[((UIButton *)screenBar.customView) setImage:[UIImage imageNamed:@"a1-hasScreen"] forState:UIControlStateNormal];
104102
weakSelf.keyword = keyword;
105103
weakSelf.status = status;
106104
weakSelf.label = label;
107105
if (keyword == nil && status == nil && label == nil) {
108-
// screenBar.image = [UIImage imageNamed:@"a1-筛选"];
109-
[((UIButton *)screenBar.customView) setImage:[UIImage imageNamed:@"a1-筛选"] forState:UIControlStateNormal];
106+
[((UIButton *)screenBar.customView) setImage:[UIImage imageNamed:@"a1-screen"] forState:UIControlStateNormal];
110107

111108
}
112-
[weakSelf resetCurView];
109+
ProjectTaskListView *listView = (ProjectTaskListView *)weakSelf.myCarousel.currentItemView;
110+
listView.keyword = keyword;
111+
listView.status = status;
112+
listView.label = label;
113+
[listView refresh];
114+
113115
};
114116

115117

@@ -154,8 +156,6 @@ - (void)resetCurView{
154156
}
155157

156158
- (void)configSegmentControlWithData:(Projects *)freshProjects {
157-
[_myProTksDict removeAllObjects];
158-
[self.myProjectList removeAllObjects];
159159

160160
BOOL dataHasChanged = NO;
161161
for (Project *freshPro in freshProjects.list) {
@@ -224,6 +224,10 @@ - (UIView *)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSUInteger)index
224224
};
225225
[weakSelf.navigationController pushViewController:vc animated:YES];
226226
} tabBarHeight:CGRectGetHeight(self.rdv_tabBarController.tabBar.frame)];
227+
listView.taskcountBlock = ^(NSInteger processingCount, NSInteger doneListCount) {
228+
weakSelf.screenView.processingCount = processingCount;
229+
weakSelf.screenView.doneListCount = doneListCount;
230+
};
227231
}
228232
[listView setSubScrollsToTop:(index == carousel.currentItemIndex)];
229233
return listView;

Coding_iOS/Images.xcassets/A1-任务/a1-已筛.imageset/Contents.json renamed to Coding_iOS/Images.xcassets/A1-任务/a1-hasScreen.imageset/Contents.json

File renamed without changes.
File renamed without changes.
File renamed without changes.

Coding_iOS/Images.xcassets/A1-任务/a1-筛选.imageset/Contents.json renamed to Coding_iOS/Images.xcassets/A1-任务/a1-screen.imageset/Contents.json

File renamed without changes.
File renamed without changes.
File renamed without changes.

Coding_iOS/Util/Manager/Coding_NetAPIManager.m

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1502,13 +1502,11 @@ - (void)request_tasks_searchWithOwner:(NSString *)owner project_id:(NSString *)p
15021502
}
15031503
[[CodingNetAPIClient sharedJsonClient] requestJsonDataWithPath:@"api/tasks/search" withParams:param withMethodType:Get andBlock:^(id data, NSError *error) {
15041504

1505-
// Projects *pros = [NSObject objectOfClass:@"Projects" fromJSON:data[@"data"]];
1506-
// pros.list = [NSObject arrayFromJSON:data[@"data"][@"list"] ofObjects:@"Project"];
15071505
Tasks *pros = [NSObject objectOfClass:@"Tasks" fromJSON:data[@"data"]];
15081506
pros.list = [NSObject arrayFromJSON:data[@"data"][@"list"] ofObjects:@"Task"];
15091507
if (status.integerValue == 1) {
15101508
pros.processingList = pros.list;
1511-
} else {
1509+
} else if (status.integerValue == 2) {
15121510
pros.doneList = pros.list;
15131511
}
15141512

Coding_iOS/Views/ScreenView.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
@property (nonatomic, strong) NSString *keyword;
1515
@property (nonatomic, strong) NSString *status; //任务状态,进行中的为1,已完成的为2
1616
@property (nonatomic, strong) NSString *label; //任务标签
17-
17+
@property (nonatomic, assign) NSInteger processingCount, doneListCount;
1818

1919
+ (instancetype)creat;
2020

Coding_iOS/Views/ScreenView.m

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ - (instancetype)initWithFrame:(CGRect)frame {
3737
#pragma mark - 外部方法
3838

3939
+ (instancetype)creat {
40-
ScreenView *screenView = [[ScreenView alloc] initWithFrame:CGRectMake(0, 20, kScreen_Width, kScreen_Height - 20)];
40+
ScreenView *screenView = [[ScreenView alloc] initWithFrame:CGRectMake(0, 0, kScreen_Width, kScreen_Height)];
4141
screenView.hidden = YES;
4242
[kKeyWindow addSubview:screenView];
4343

@@ -117,7 +117,7 @@ - (void)creatView {
117117
UIView *mainView = [[UIView alloc] init];
118118
mainView.backgroundColor = [UIColor whiteColor];
119119
[self addSubview:mainView];
120-
mainView.sd_layout.leftSpaceToView(self, 80).topSpaceToView(self, 0).bottomEqualToView(self).rightEqualToView(self);
120+
mainView.sd_layout.leftSpaceToView(self, 120).topSpaceToView(self, 0).bottomEqualToView(self).rightEqualToView(self);
121121

122122
UISearchBar *searchBar = [[UISearchBar alloc] init];
123123
UITextField *searchField = [searchBar valueForKey:@"searchField"];
@@ -128,7 +128,7 @@ - (void)creatView {
128128
searchBar.cornerRadius = 4;
129129
searchBar.masksToBounds = YES;
130130
[mainView addSubview:searchBar];
131-
searchBar.sd_layout.leftSpaceToView(mainView, 15).topSpaceToView(mainView, 15).rightSpaceToView(mainView, 15).heightIs(31);
131+
searchBar.sd_layout.leftSpaceToView(mainView, 15).topSpaceToView(mainView, 35).rightSpaceToView(mainView, 15).heightIs(31);
132132
_searchBar = searchBar;
133133

134134
UIButton *resetButton = [[UIButton alloc] init];
@@ -187,5 +187,15 @@ - (void)resetButtonClick {
187187

188188
#pragma mark - get/set方法
189189

190+
- (void)setProcessingCount:(NSInteger)processingCount {
191+
_processingCount = processingCount;
192+
_tastArray = @[[NSString stringWithFormat:@"进行中的(%ld", processingCount], _tastArray[1]];
193+
}
194+
195+
- (void)setDoneListCount:(NSInteger)doneListCount {
196+
_doneListCount = doneListCount;
197+
_tastArray = @[_tastArray[0], [NSString stringWithFormat:@"已完成的(%ld", doneListCount]];
198+
[self.tableView reloadData];
199+
}
190200

191201
@end

0 commit comments

Comments
 (0)