Skip to content

Commit b719f8b

Browse files
committed
项目广场
1 parent 79f88ae commit b719f8b

4 files changed

Lines changed: 35 additions & 10 deletions

File tree

Coding_iOS/Models/Project.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
@property (assign, nonatomic) BOOL isStaring, isWatching, isLoadingMember, isLoadingDetail;
1515

1616
@property (strong, nonatomic) User *owner;
17-
@property (strong, nonatomic) NSDate *created_at;
17+
@property (strong, nonatomic) NSDate *created_at,*updated_at;
1818

1919
+ (Project *)project_All;
2020
+ (Project *)project_FeedBack;

Coding_iOS/Views/Cell/ProjectAboutMeListCell.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ - (void)setProject:(Project *)project hasSWButtons:(BOOL)hasSWButtons hasBadgeTi
110110

111111
[_projectTitleLabel mas_updateConstraints:^(MASConstraintMaker *make) {
112112
make.top.equalTo(_projectIconView.mas_top);
113-
make.height.equalTo(@(25));
113+
make.height.equalTo(@(20));
114114
make.left.equalTo(_privateIconView.mas_right).offset(_privateIconView.hidden?0:8);
115115
make.right.lessThanOrEqualTo(self.mas_right);
116116
}];
@@ -123,7 +123,7 @@ - (void)setProject:(Project *)project hasSWButtons:(BOOL)hasSWButtons hasBadgeTi
123123

124124
[_describeLabel mas_updateConstraints:^(MASConstraintMaker *make) {
125125
make.left.equalTo(self.privateIconView);
126-
make.height.equalTo(@(40));
126+
make.height.equalTo(@(38));
127127
make.width.equalTo(@(kScreen_Width-kLeftOffset-kIconSize-kLeftOffset));
128128
make.top.equalTo(_projectTitleLabel.mas_bottom);
129129
}];

Coding_iOS/Views/Cell/ProjectAboutOthersListCell.m

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ @interface ProjectAboutOthersListCell ()
1818
@property (nonatomic, strong) Project *project;
1919
@property (nonatomic, strong) UIImageView *projectIconView, *privateIconView, *pinIconView;
2020
@property (nonatomic, strong) UILabel *projectTitleLabel;
21-
@property (nonatomic, strong) UILabel *ownerTitleLabel;
2221
@property (nonatomic, strong) UILabel *describeLabel;
2322
@property (nonatomic, strong) UIImageView *starV, *watchV, *forkV;
2423
@property (strong, nonatomic) UILabel *desL, *starL, *watchL, *forkL;
@@ -153,14 +152,14 @@ - (void)setProject:(Project *)project hasSWButtons:(BOOL)hasSWButtons hasBadgeTi
153152

154153
[_projectTitleLabel mas_updateConstraints:^(MASConstraintMaker *make) {
155154
make.top.equalTo(_projectIconView.mas_top);
156-
make.height.equalTo(@(25));
155+
make.height.equalTo(@(20));
157156
make.left.equalTo(_privateIconView.mas_right).offset(_privateIconView.hidden?0:8);
158157
make.right.lessThanOrEqualTo(self.mas_right);
159158
}];
160159

161160
[_describeLabel mas_updateConstraints:^(MASConstraintMaker *make) {
162161
make.left.equalTo(self.privateIconView);
163-
make.height.equalTo(@(40));
162+
make.height.equalTo(@(38));
164163
make.width.equalTo(@(kScreen_Width-kLeftOffset-kIconSize-kLeftOffset));
165164
make.top.equalTo(_projectTitleLabel.mas_bottom);
166165
}];

Coding_iOS/Views/Cell/ProjectPublicListCell.m

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,21 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
6060
[self.contentView addSubview:_privateIconView];
6161
}
6262

63+
if (!_ownerTitleLabel) {
64+
_ownerTitleLabel = [UILabel new];
65+
_ownerTitleLabel.textColor = [UIColor colorWithHexString:@"0x999999"];
66+
_ownerTitleLabel.font = [UIFont systemFontOfSize:11];
67+
[self.contentView addSubview:_ownerTitleLabel];
68+
}
69+
70+
[_ownerTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
71+
make.height.equalTo(@(14));
72+
make.width.equalTo(@(200));
73+
make.left.equalTo(self.privateIconView);
74+
make.bottom.equalTo(_projectIconView.mas_bottom);
75+
}];
76+
77+
6378
if (!_pinIconView) {
6479
_pinIconView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"icon_project_cell_setNormal"]];
6580
_pinIconView.hidden = YES;
@@ -108,7 +123,7 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
108123

109124

110125
[_starV mas_makeConstraints:^(MASConstraintMaker *make) {
111-
make.bottom.equalTo(_projectIconView);
126+
make.bottom.equalTo(_ownerTitleLabel.mas_top).offset(-3);
112127
make.left.equalTo(_privateIconView);
113128
make.centerY.equalTo(@[_starL, _watchV, _watchL, _forkV, _forkL]);
114129
make.width.height.equalTo(@[_watchV, _forkV, @12]);
@@ -151,25 +166,36 @@ - (void)setProject:(Project *)project hasSWButtons:(BOOL)hasSWButtons hasBadgeTi
151166

152167
[_projectTitleLabel mas_updateConstraints:^(MASConstraintMaker *make) {
153168
make.top.equalTo(_projectIconView.mas_top);
154-
make.height.equalTo(@(25));
169+
make.height.equalTo(@(20));
155170
make.left.equalTo(_privateIconView.mas_right).offset(_privateIconView.hidden?0:8);
156171
make.right.lessThanOrEqualTo(self.mas_right);
157172
}];
158173

159174
[_describeLabel mas_updateConstraints:^(MASConstraintMaker *make) {
160175
make.left.equalTo(self.privateIconView);
161-
make.height.equalTo(@(40));
176+
make.height.equalTo(@(38));
162177
make.width.equalTo(@(kScreen_Width-kLeftOffset-kIconSize-kLeftOffset));
163178
make.top.equalTo(_projectTitleLabel.mas_bottom);
164179
}];
165180

166181

167-
//Title & description & star & watch &fork
182+
//Title & description & star & watch &fork &owner+update_time
168183
_projectTitleLabel.text = _project.name;
169184
_describeLabel.text=_project.description_mine;
170185
_starL.text = _project.star_count.stringValue;
171186
_watchL.text = _project.watch_count.stringValue;
172187
_forkL.text = _project.fork_count.stringValue;
188+
189+
NSString *titleStr=[NSString stringWithFormat:@"%@ 最后更新于 %@",_project.owner_user_name,[_project.updated_at stringDisplay_HHmm]];
190+
NSMutableAttributedString *titleColorStr=[[NSMutableAttributedString alloc] initWithString:titleStr];
191+
[titleColorStr addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithHexString:@"0x3bbd79"] range:[titleStr rangeOfString:_project.owner_user_name]];
192+
//
193+
// [titleColorStr addAttribute:NSForegroundColorAttributeName value:ZZBThemeOrangeColor range:[titleStr rangeOfString:aPerson.text]];
194+
// _nameLabel.text = [NSString stringWithFormat:@"%@(%ld)", _folder.name, (long)(_folder.count.integerValue)];
195+
// _infoLabel.text = [NSString stringWithFormat:@"%@ 创建于 %@", _folder.owner_name, ];
196+
197+
_ownerTitleLabel.attributedText = titleColorStr;
198+
173199

174200
//hasSWButtons
175201
[self setRightUtilityButtons:hasSWButtons? [self rightButtons]: nil

0 commit comments

Comments
 (0)