Commit db7ca586 cgx

睡眠文章新增阅读数

1 个父辈 23bb143b
......@@ -3233,7 +3233,7 @@
CODE_SIGN_ENTITLEMENTS = DreamSleep/Basement/DSConfig/DreamSleepDebug.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 3;
CURRENT_PROJECT_VERSION = 5;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 4NDZ6UX8PW;
......@@ -3316,7 +3316,7 @@
CODE_SIGN_ENTITLEMENTS = DreamSleep/DreamSleep.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3;
CURRENT_PROJECT_VERSION = 5;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 4NDZ6UX8PW;
ENABLE_BITCODE = NO;
......@@ -3459,7 +3459,7 @@
CODE_SIGN_ENTITLEMENTS = DreamSleep/Basement/DSConfig/DreamSleepBeta.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3;
CURRENT_PROJECT_VERSION = 5;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 4NDZ6UX8PW;
......
......@@ -12,6 +12,7 @@
@property (nonatomic, strong) UILabel *contentLab;
@property (nonatomic, strong) UIImageView *coverIV;
@property (nonatomic, strong) UIView *tagsView;
@property (nonatomic, strong) UILabel *readCountLab;
@end
@implementation ArticleCell
......@@ -25,7 +26,8 @@
[self.contentView addSubview:self.contentLab];
[self.contentView addSubview:self.coverIV];
[self.contentView addSubview:self.tagsView];
[self.contentView addSubview:self.readCountLab];
[self.coverIV mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.contentView).offset(-8);
make.centerY.equalTo(self.contentView);
......@@ -45,6 +47,12 @@
make.height.equalTo(@21);
make.bottom.equalTo(self.contentView).offset(-12);
}];
[self.readCountLab mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.bottom.equalTo(self.coverIV);
make.height.equalTo(@25);
}];
[self layoutIfNeeded];
[self.readCountLab setCornerRadiusRect:(UIRectCornerBottomLeft | UIRectCornerBottomRight) cornerRadius:12];
}
return self;
}
......@@ -54,6 +62,7 @@
self.titleLab.text = model.title;
self.contentLab.text = model.content;
[self.coverIV yy_setImageWithURL:[NSURL URLWithString:model.cover] placeholder:[UIImage defaultPlaceholderWithSize:CGSizeMake(86, 86)]];
self.readCountLab.text = [NSString stringWithFormat:@"%ld人阅读过", model.read_count];
// tag标签最多只有3个
NSArray *tagsTitleArr = model.tags ? [model.tags componentsSeparatedByString:@"|"] : @[];
......@@ -119,4 +128,14 @@
return _tagsView;
}
- (UILabel *)readCountLab {
if (!_readCountLab) {
_readCountLab = [UILabel labWithFont:SysFont(11)];
_readCountLab.textAlignment = NSTextAlignmentCenter;
_readCountLab.textColor = ColorFromHexA(0xFFFFFF, .7);
_readCountLab.backgroundColor = ColorFromHexA(0x161E38, .35);
}
return _readCountLab;
}
@end
......@@ -16,6 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, copy) NSString *content;
@property (nonatomic, copy) NSString *url;
@property (nonatomic, copy) NSString *cover;
@property (nonatomic, assign) NSInteger read_count;
@end
NS_ASSUME_NONNULL_END
......@@ -41,6 +41,7 @@
[self.contentLab mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.userIcon.mas_bottom).offset(7);
make.left.equalTo(self.contentView).offset(73);
make.right.equalTo(self.contentView).offset(-50);
}];
}
return self;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!