@@ -31,6 +31,7 @@ @interface MyTask_RootViewController ()
3131@property (nonatomic , strong ) NSString *status; // 任务状态,进行中的为1,已完成的为2
3232@property (nonatomic , strong ) NSString *label; // 任务标签
3333@property (nonatomic , strong ) NSString *project_id;
34+ @property (nonatomic , strong ) NSString *owner, *watcher, *creator;
3435@end
3536
3637@implementation MyTask_RootViewController
@@ -87,10 +88,24 @@ - (void)viewDidLoad
8788
8889
8990 // 初始化过滤目录
90- _myFliterMenu = [[TaskSelectionView alloc ] initWithFrame: CGRectMake (0 , 64 , kScreen_Width , kScreen_Height - 64 ) items: nil ];
91+ _myFliterMenu = [[TaskSelectionView alloc ] initWithFrame: CGRectMake (0 , 64 , kScreen_Width , kScreen_Height - 64 ) items: @[ @" 我的任务 " , @" 我关注的 " , @" 我创建的 " ] ];
9192 __weak typeof (self) weakSelf = self;
9293 _myFliterMenu.clickBlock = ^(NSInteger pageIndex){
9394 [weakSelf.titleBtn setTitle: weakSelf.myFliterMenu.items[pageIndex] forState: UIControlStateNormal];
95+ weakSelf.owner = weakSelf.watcher = weakSelf.creator = nil ;
96+ if (pageIndex == 0 ) {
97+ weakSelf.owner = [Login curLoginUser ].id .stringValue ;
98+ }
99+ if (pageIndex == 1 ) {
100+ weakSelf.watcher = [Login curLoginUser ].id .stringValue ;
101+ }
102+ if (pageIndex == 2 ) {
103+ weakSelf.creator = [Login curLoginUser ].id .stringValue ;
104+ }
105+ ProjectTaskListView *listView = (ProjectTaskListView *)weakSelf.myCarousel .currentItemView ;
106+ [weakSelf assignmentWithlistView: listView];
107+ [listView refresh ];
108+
94109 };
95110 _myFliterMenu.closeBlock =^(){
96111 [weakSelf.myFliterMenu dismissMenu ];
@@ -107,9 +122,7 @@ - (void)viewDidLoad
107122
108123 }
109124 ProjectTaskListView *listView = (ProjectTaskListView *)weakSelf.myCarousel .currentItemView ;
110- listView.keyword = keyword;
111- listView.status = status;
112- listView.label = label;
125+ [weakSelf assignmentWithlistView: listView];
113126 [listView refresh ];
114127
115128 };
@@ -210,13 +223,11 @@ - (UIView *)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSUInteger)index
210223
211224 ProjectTaskListView *listView = (ProjectTaskListView *)view;
212225 if (listView) {
213- listView.keyword = _keyword;
214- listView.status = _status;
215- listView.label = _label;
226+ [self assignmentWithlistView: listView];
216227 [listView setTasks: curTasks];
217228 }else {
218229 __weak typeof (self) weakSelf = self;
219- listView = [[ProjectTaskListView alloc ] initWithFrame: carousel.bounds tasks: curTasks project_id: _project_id keyword: _keyword status: _status label: _label block: ^(ProjectTaskListView *taskListView, Task *task) {
230+ listView = [[ProjectTaskListView alloc ] initWithFrame: carousel.bounds tasks: curTasks project_id: _project_id keyword: _keyword status: _status label: _label owner: _owner watcher: _watcher creator: _creator block: ^(ProjectTaskListView *taskListView, Task *task) {
220231 EditTaskViewController *vc = [[EditTaskViewController alloc ] init ];
221232 vc.myTask = task;
222233 vc.taskChangedBlock = ^(){
@@ -252,10 +263,7 @@ - (void)carouselCurrentItemIndexDidChange:(iCarousel *)carousel{
252263 } else {
253264 _project_id = ((Project *)_myProjectList[index - 1 ]).id .stringValue ;
254265 }
255- curView.project_id = _project_id;
256- curView.keyword = _keyword;
257- curView.status = _status;
258- curView.label = _label;
266+ [self assignmentWithlistView: curView];
259267
260268 [curView refreshToQueryData ];
261269 [carousel.visibleItemViews enumerateObjectsUsingBlock: ^(UIView *obj, NSUInteger idx, BOOL *stop) {
@@ -323,5 +331,15 @@ - (UIBarButtonItem *)HDCustomNavButtonWithTitle:(NSString *)title imageName:(NSS
323331 return barButtonItem;
324332}
325333
334+ - (void )assignmentWithlistView : (ProjectTaskListView *)listView {
335+ listView.keyword = self.keyword ;
336+ listView.status = self.status ;
337+ listView.label = self.label ;
338+ listView.project_id = self.project_id ;
339+ listView.owner = self.owner ;
340+ listView.watcher = self.watcher ;
341+ listView.creator = self.creator ;
342+ }
343+
326344
327345@end
0 commit comments