88
99#define kProjectTaskListViewCell_LeftPading 93.0
1010#define kProjectTaskListViewCell_RightPading 10.0
11- #define kProjectTaskListViewCell_UserIconWidth 33 .0
11+ #define kProjectTaskListViewCell_UserIconWidth 40 .0
1212#define kProjectTaskListViewCell_UpDownPading 10.0
1313#define kProjectTaskListViewCell_MaxContentHeight 20.0
1414#define kProjectTaskListViewCell_ContentWidth (kScreen_Width - kProjectTaskListViewCell_LeftPading - kProjectTaskListViewCell_RightPading )
2222#import " NSString+Attribute.h"
2323
2424@interface TaskSearchCell ()
25- @property (strong , nonatomic ) UIImageView *userIconView, *commentIconView, *timeClockIconView, *mdIconView, *taskPriorityView ;
26- @property (strong , nonatomic ) UILabel *contentLabel, *userNameLabel, *timeLabel, *commentCountLabel, *mdLabel, *numLabel;
25+ @property (strong , nonatomic ) UIImageView *userIconView, *commentIconView, *timeClockIconView, *mdIconView;
26+ @property (strong , nonatomic ) UILabel *contentLabel, *userNameLabel, *timeLabel, *commentCountLabel, *mdLabel, *numLabel,*describeLabe; ;
2727@end
2828
2929
@@ -41,17 +41,22 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
4141 [_userIconView doCircleFrame ];
4242 [self .contentView addSubview: _userIconView];
4343 }
44- if (!_taskPriorityView) {
45- _taskPriorityView = [UIImageView new ];
46- _taskPriorityView.contentMode = UIViewContentModeScaleAspectFit;
47- [self .contentView addSubview: _taskPriorityView];
48- }
44+
4945 if (!_contentLabel) {
5046 _contentLabel = [UILabel new ];
5147 _contentLabel.textColor = [UIColor colorWithHexString: @" 0x222222" ];
5248 _contentLabel.font = kProjectTaskListViewCell_ContentFont ;
5349 [self .contentView addSubview: _contentLabel];
5450 }
51+
52+ if (!_describeLabe) {
53+ _describeLabe = [UILabel new ];
54+ _describeLabe.textColor = [UIColor colorWithHexString: @" 0x666666" ];
55+ _describeLabe.font = kProjectTaskListViewCell_ContentFont ;
56+ _describeLabe.numberOfLines =2 ;
57+ [self .contentView addSubview: _describeLabe];
58+ }
59+
5560 if (!_numLabel) {
5661 _numLabel = [UILabel new ];
5762 _numLabel.font = [UIFont systemFontOfSize: 10 ];
@@ -101,21 +106,24 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
101106
102107 [_userIconView mas_makeConstraints: ^(MASConstraintMaker *make) {
103108 make.left .equalTo (self.contentView ).offset (kPaddingLeftWidth );
104- make.centerY .equalTo (self.contentView );
109+ make.top .equalTo (self.contentView ). offset ( 19 );
105110 make.size .mas_equalTo (CGSizeMake (kProjectTaskListViewCell_UserIconWidth ,
106111 kProjectTaskListViewCell_UserIconWidth ));
107112 }];
108- [_taskPriorityView mas_makeConstraints: ^(MASConstraintMaker *make) {
109- make.top .equalTo (self.contentView ).offset (10 );
110- make.left .equalTo (self.userIconView .mas_right ).offset (10 );
111- make.size .mas_equalTo (CGSizeMake (17 , 17 ));
112- }];
113+
113114 [_contentLabel mas_makeConstraints: ^(MASConstraintMaker *make) {
114- make.centerY .equalTo (self.taskPriorityView );
115- make.left .equalTo (self.taskPriorityView .mas_right ).offset (10 );
115+ make.top .equalTo (self.contentView ). offset ( 19 - 3 );
116+ make.left .equalTo (self.userIconView .mas_right ).offset (10 );
116117 make.right .equalTo (self.contentView ).offset (-kPaddingLeftWidth );
117118 make.height .mas_equalTo (20 );
118119 }];
120+
121+ [_describeLabe mas_makeConstraints: ^(MASConstraintMaker *make) {
122+ make.top .equalTo (self.contentLabel .mas_bottom ).offset (10 );
123+ make.left .equalTo (self.userIconView .mas_right ).offset (10 );
124+ make.right .equalTo (self.contentView ).offset (-kPaddingLeftWidth );
125+ make.height .mas_equalTo (40 );
126+ }];
119127
120128 [_numLabel mas_makeConstraints: ^(MASConstraintMaker *make) {
121129 make.bottom .equalTo (self.contentView ).offset (-10 );
@@ -168,32 +176,18 @@ - (void)layoutSubviews{
168176 return ;
169177 }
170178 [_userIconView sd_setImageWithURL: [_task.owner.avatar urlImageWithCodePathResize: 2 *kProjectTaskListViewCell_UserIconWidth ] placeholderImage: kPlaceholderMonkeyRoundWidth (kProjectTaskListViewCell_UserIconWidth )];
171- [_taskPriorityView setImage: [UIImage imageNamed: [NSString stringWithFormat: @" taskPriority%@ _small" , _task.priority.stringValue]]];
172- _contentLabel.textColor = [UIColor colorWithHexString: _task.status.integerValue == 1 ? @" 0x222222" : @" 0x999999" ];
173179
174180 _contentLabel.attributedText =[NSString getAttributeFromText: [_task.content stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet ]] emphasizeTag: @" em" emphasizeColor: [UIColor colorWithHexString: @" 0xE84D60" ]];
175181
176182// _contentLabel.text = [_task.content stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
177183 // Bottom
178- _numLabel.text = [NSString stringWithFormat: @" #%@ " , _task.number .stringValue];
184+ _numLabel.text = [NSString stringWithFormat: @" #%@ " , _task.resource_id .stringValue];
179185 _userNameLabel.text = _task.creator .name ;
180186 _timeLabel.text = [_task.created_at stringDisplay_MMdd ];
181187 _commentCountLabel.text = _task.comments .stringValue ;
182188 _mdIconView.hidden = _mdLabel.hidden = !_task.has_description .boolValue ;
189+ _describeLabe.text =_task.description_mine ;
183190}
184191
185- + (CGFloat)cellHeightWithObj : (id )obj {
186- CGFloat cellHeight = 0 ;
187- if ([obj isKindOfClass: [Task class ]]) {
188- Task *task = (Task *)obj;
189- if (task.deadline_date || task.labels .count > 0 ) {
190- cellHeight = 95 ;
191- }else {
192- cellHeight = 60 ;
193- }
194- }
195- return cellHeight;
196- }
197192@end
198193
199-
0 commit comments