Commit fac61d59 cgx

睡眠文章新增阅读数

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