@@ -39,50 +39,7 @@ - (void)reloadData{
3939 }
4040}
4141
42- - (id )initWithFrame : (CGRect)frame tasks : (Tasks *)tasks block : (ProjectTaskBlock)block tabBarHeight : (CGFloat)tabBarHeight {
43- self = [super initWithFrame: frame];
44- if (self) {
45- // Initialization code
46- _myTasks = tasks;
47- _block = block;
48- _page = 1 ;
49-
50- _myTableView = ({
51- UITableView *tableView = [[UITableView alloc ] initWithFrame: self .bounds style: UITableViewStylePlain];
52- tableView.backgroundColor = [UIColor clearColor ];
53- tableView.delegate = self;
54- tableView.dataSource = self;
55- [tableView registerClass: [ProjectTaskListViewCell class ] forCellReuseIdentifier: kCellIdentifier_ProjectTaskList ];
56- tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
57- [self addSubview: tableView];
58- [tableView mas_makeConstraints: ^(MASConstraintMaker *make) {
59- make.edges .equalTo (self);
60- }];
61- if (tabBarHeight != 0 ) {
62- UIEdgeInsets insets = UIEdgeInsetsMake (0 , 0 , tabBarHeight, 0 );
63- tableView.contentInset = insets;
64- tableView.scrollIndicatorInsets = insets;
65- }
66- tableView;
67- });
68-
69- _myRefreshControl = [[ODRefreshControl alloc ] initInScrollView: self .myTableView];
70- [_myRefreshControl addTarget: self action: @selector (refresh ) forControlEvents: UIControlEventValueChanged];
71- __weak typeof (self) weakSelf = self;
72- [_myTableView addInfiniteScrollingWithActionHandler: ^{
73- [weakSelf refreshMore ];
74- }];
75- if (_myTasks.list .count > 0 ) {
76- [_myTableView reloadData ];
77- }else {
78- [self sendRequest ];
79- }
80- }
81- return self;
82- }
83-
84-
85- - (id )initWithFrame : (CGRect)frame tasks : (Tasks *)tasks project_id : (NSString *)project_id keyword : (NSString *)keyword status : (NSString *)status label : (NSString *)label owner : (NSString *)owner watcher : (NSString *)watcher creator : (NSString *)creator block : (ProjectTaskBlock)block tabBarHeight : (CGFloat)tabBarHeight {
42+ - (id )initWithFrame : (CGRect)frame tasks : (Tasks *)tasks project_id : (NSString *)project_id keyword : (NSString *)keyword status : (NSString *)status label : (NSString *)label userId : (NSString *)userId role : (TaskRoleType )role block : (ProjectTaskBlock)block tabBarHeight : (CGFloat)tabBarHeight {
8643 self = [super initWithFrame: frame];
8744 if (self) {
8845 // Initialization code
@@ -94,9 +51,8 @@ - (id)initWithFrame:(CGRect)frame tasks:(Tasks *)tasks project_id:(NSString *)pr
9451 self.keyword = keyword;
9552 self.status = status;
9653 self.label = label;
97- self.owner = owner;
98- self.watcher = watcher;
99- self.creator = creator;
54+ self.userId = userId;
55+ self.role = role;
10056
10157
10258 _myTableView = ({
@@ -180,7 +136,7 @@ - (void)sendRequest{
180136 }
181137 __weak typeof (self) weakSelf = self;
182138
183- [[Coding_NetAPIManager sharedManager ] request_tasks_searchWithOwner: _owner watcher: _watcher creator: _creator project_id: _project_id keyword: _keyword status: _status label: _label page: _page andBlock: ^(Tasks *data, NSError *error) {
139+ [[Coding_NetAPIManager sharedManager ] request_tasks_searchWithUserId: _userId role: _role project_id: _project_id keyword: _keyword status: _status label: _label page: _page andBlock: ^(Tasks *data, NSError *error) {
184140 [weakSelf endLoading ];
185141 [weakSelf.myRefreshControl endRefreshing ];
186142 [weakSelf.myTableView.infiniteScrollingView stopAnimating ];
@@ -194,21 +150,6 @@ - (void)sendRequest{
194150 }];
195151
196152 }];
197- /*
198- [[Coding_NetAPIManager sharedManager] request_ProjectTaskList_WithObj:_myTasks andBlock:^(Tasks *data, NSError *error) {
199- [weakSelf endLoading];
200- [weakSelf.myRefreshControl endRefreshing];
201- [weakSelf.myTableView.infiniteScrollingView stopAnimating];
202- if (data) {
203- [weakSelf.myTasks configWithTasks:data];
204- [weakSelf.myTableView reloadData];
205- weakSelf.myTableView.showsInfiniteScrolling = weakSelf.myTasks.canLoadMore;
206- }
207- [weakSelf configBlankPage:EaseBlankPageTypeTask hasData:(weakSelf.myTasks.list.count > 0) hasError:(error != nil) reloadButtonBlock:^(id sender) {
208- [weakSelf refresh];
209- }];
210- }];
211- */
212153}
213154
214155
0 commit comments