小说绘上架版本
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// TFAppraiseCommViewCell.h
|
||||
// TFReader
|
||||
//
|
||||
// Created by 谢腾飞 on 2020/12/21.
|
||||
// Copyright © 2020 xtfei_2011@126.com. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "TFBasicTableViewCell.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface TFAppraiseCommViewCell : TFBasicTableViewCell
|
||||
|
||||
@property (nonatomic ,strong) TFCommentsListModel *commentsDetailModel;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+200
@@ -0,0 +1,200 @@
|
||||
//
|
||||
// TFAppraiseCommViewCell.m
|
||||
// TFReader
|
||||
//
|
||||
// Created by 谢腾飞 on 2020/12/21.
|
||||
// Copyright © 2020 xtfei_2011@126.com. All rights reserved.
|
||||
//
|
||||
|
||||
#import "TFAppraiseCommViewCell.h"
|
||||
|
||||
@interface TFAppraiseCommViewCell ()
|
||||
|
||||
@property (nonatomic ,strong) UIImageView *avatarView; //头像
|
||||
@property (nonatomic ,strong) UILabel *nickNameLabel; //昵称
|
||||
@property (nonatomic ,strong) UIImageView *vipView; // VIP标识
|
||||
@property (nonatomic ,strong) UILabel *timeLabel; //发布时间
|
||||
@property (nonatomic ,strong) UILabel *commentLabel; //评论
|
||||
@property (nonatomic ,strong) YYLabel *replyCommentLabel; //二级评论
|
||||
@property (nonatomic ,strong) UILabel *bookNameLabel;
|
||||
@property (nonatomic ,strong) UILabel *commentCountLabel;
|
||||
@end
|
||||
|
||||
@implementation TFAppraiseCommViewCell
|
||||
|
||||
- (void)createSubviews
|
||||
{
|
||||
[super createSubviews];
|
||||
|
||||
// 头像
|
||||
self.avatarView = [[UIImageView alloc] initWithCornerRadiusAdvance:35.0f / 2 rectCornerType:UIRectCornerAllCorners];
|
||||
[self.contentView addSubview:self.avatarView];
|
||||
|
||||
[self.avatarView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.contentView.mas_left).with.offset(kMargin);
|
||||
make.top.mas_equalTo(self.contentView.mas_top).with.offset(kHalfMargin);
|
||||
make.width.height.mas_equalTo(35.0f);
|
||||
}];
|
||||
|
||||
// 昵称
|
||||
self.nickNameLabel = [[UILabel alloc] init];
|
||||
self.nickNameLabel.textColor = kGrayTextDeepColor;
|
||||
self.nickNameLabel.font = kFont13;
|
||||
self.nickNameLabel.textAlignment = NSTextAlignmentLeft;
|
||||
[self.contentView addSubview:self.nickNameLabel];
|
||||
|
||||
[self.nickNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.avatarView.mas_right).with.offset(kHalfMargin);
|
||||
make.top.mas_equalTo(self.avatarView.mas_top);
|
||||
make.width.mas_equalTo(200);
|
||||
make.height.mas_equalTo(self.avatarView.mas_height).multipliedBy(0.6);
|
||||
}];
|
||||
|
||||
self.vipView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"public_vip_normal"]];
|
||||
self.vipView.hidden = YES;
|
||||
[self addSubview:self.vipView];
|
||||
|
||||
[self.vipView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.nickNameLabel.mas_right);
|
||||
make.centerY.mas_equalTo(self.nickNameLabel.mas_centerY);
|
||||
make.height.mas_equalTo(10);
|
||||
make.width.mas_equalTo(kGeometricWidth(10, 138, 48));
|
||||
}];
|
||||
|
||||
self.timeLabel = [[UILabel alloc] init];
|
||||
self.timeLabel.textAlignment = NSTextAlignmentLeft;
|
||||
self.timeLabel.font = kFont10;
|
||||
self.timeLabel.textColor = kGrayTextColor;
|
||||
[self.contentView addSubview:self.timeLabel];
|
||||
[self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.nickNameLabel.mas_left);
|
||||
make.bottom.mas_equalTo(self.avatarView.mas_bottom);
|
||||
make.right.mas_equalTo(self.contentView.mas_right);
|
||||
make.height.mas_equalTo(self.avatarView.mas_height).multipliedBy(0.4);
|
||||
}];
|
||||
|
||||
// 二级评论
|
||||
self.replyCommentLabel = [[YYLabel alloc] init];
|
||||
self.replyCommentLabel.textAlignment = NSTextAlignmentLeft;
|
||||
self.replyCommentLabel.textColor = kGrayTextDeepColor;
|
||||
self.replyCommentLabel.font = kFont13;
|
||||
self.replyCommentLabel.backgroundColor = kGrayViewColor;
|
||||
self.replyCommentLabel.numberOfLines = 0;
|
||||
self.replyCommentLabel.textContainerInset = UIEdgeInsetsMake(6, 5, 4, 5);
|
||||
[self.contentView addSubview:self.replyCommentLabel];
|
||||
|
||||
[self.replyCommentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.nickNameLabel.mas_left);
|
||||
make.top.mas_equalTo(self.avatarView.mas_bottom);
|
||||
make.right.mas_equalTo(self.contentView.mas_right).with.offset(- kMargin);
|
||||
make.height.mas_equalTo(CGFLOAT_MIN);
|
||||
}];
|
||||
|
||||
// 评论
|
||||
self.commentLabel = [[UILabel alloc] init];
|
||||
self.commentLabel.textAlignment = NSTextAlignmentLeft;
|
||||
self.commentLabel.font = kMainFont;
|
||||
self.commentLabel.numberOfLines = 0;
|
||||
self.commentLabel.textColor = kBlackColor;
|
||||
[self.contentView addSubview:self.commentLabel];
|
||||
|
||||
[self.commentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.nickNameLabel.mas_left);
|
||||
make.right.mas_equalTo(self.contentView.mas_right).with.offset(- kMargin);
|
||||
make.top.mas_equalTo(self.replyCommentLabel.mas_bottom).with.offset(kHalfMargin);
|
||||
make.height.mas_equalTo(200);
|
||||
}];
|
||||
|
||||
self.commentCountLabel = [[UILabel alloc] init];
|
||||
self.commentCountLabel.font = kFont10;
|
||||
self.commentCountLabel.textAlignment = NSTextAlignmentRight;
|
||||
self.commentCountLabel.textColor = kGrayTextColor;
|
||||
[self.contentView addSubview:self.commentCountLabel];
|
||||
|
||||
[self.commentCountLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(self.contentView.mas_right).with.offset(- kHalfMargin);
|
||||
make.top.mas_equalTo(self.commentLabel.mas_bottom).with.offset(kHalfMargin);
|
||||
make.width.mas_equalTo(100);
|
||||
make.height.mas_equalTo(15);
|
||||
}];
|
||||
|
||||
self.bookNameLabel = [[UILabel alloc] init];
|
||||
self.bookNameLabel.font = kFont10;
|
||||
self.bookNameLabel.textAlignment = NSTextAlignmentLeft;
|
||||
self.bookNameLabel.textColor = kGrayTextColor;
|
||||
[self.contentView addSubview:self.bookNameLabel];
|
||||
|
||||
[self.bookNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.nickNameLabel.mas_left);
|
||||
make.right.mas_equalTo(self.commentCountLabel.mas_left).with.offset(- kHalfMargin);
|
||||
make.centerY.mas_equalTo(self.commentCountLabel.mas_centerY);
|
||||
make.height.mas_equalTo(self.commentCountLabel.mas_height);
|
||||
make.bottom.mas_equalTo(self.contentView.mas_bottom).with.offset(- kHalfMargin).priorityLow();
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)setCommentsDetailModel:(TFCommentsListModel *)commentsDetailModel
|
||||
{
|
||||
if (!commentsDetailModel) {
|
||||
return;
|
||||
}
|
||||
|
||||
_commentsDetailModel = commentsDetailModel;
|
||||
|
||||
self.timeLabel.text = [NSString stringWithFormat:@"%@",commentsDetailModel.time ? : @""];
|
||||
self.commentLabel.text = [NSString stringWithFormat:@"%@",commentsDetailModel.content ? : @""];
|
||||
|
||||
[self.commentLabel mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo([TFViewHelper getDynamicHeightWithLabelFont:self.commentLabel.font labelWidth:(SCREEN_WIDTH - 35.0f - kMargin) labelText:self.commentLabel.text] - kHalfMargin);
|
||||
}];
|
||||
|
||||
[self.avatarView setImageWithURL:[NSURL URLWithString:commentsDetailModel.avatar ? : @""] placeholder:HoldUserAvatar options:YYWebImageOptionSetImageWithFadeAnimation completion:nil];
|
||||
self.nickNameLabel.text = [NSString stringWithFormat:@"%@",commentsDetailModel.nickname ? : @""];
|
||||
[self.nickNameLabel mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo([TFViewHelper getDynamicWidthWithLabel:self.nickNameLabel]);
|
||||
}];
|
||||
|
||||
if (commentsDetailModel.is_vip == 1) {
|
||||
self.vipView.hidden = NO;
|
||||
} else {
|
||||
self.vipView.hidden = YES;
|
||||
}
|
||||
|
||||
self.commentCountLabel.text = [NSString stringWithFormat:TFLocalizedString(@"%@条回复"), [TFUtilsHelper formatStringWithInteger:commentsDetailModel.reply_num]];
|
||||
[self.commentCountLabel mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo([TFViewHelper getDynamicWidthWithLabel:self.commentCountLabel]);
|
||||
}];
|
||||
|
||||
self.bookNameLabel.text = commentsDetailModel.name_title ? : @"";
|
||||
|
||||
if (commentsDetailModel.reply_info.length > 0) {
|
||||
|
||||
CGFloat replyHeight = [TFViewHelper getDynamicHeightWithLabelFont:kFont11 labelWidth:(SCREEN_WIDTH - 2 * kMargin - 35.0f - kHalfMargin) labelText:commentsDetailModel.reply_info ? : @""];
|
||||
NSString *replyInfo = [NSString stringWithFormat:@"%@",commentsDetailModel.reply_info ? : @""];
|
||||
|
||||
NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc] init];
|
||||
style.lineSpacing = 3;
|
||||
|
||||
NSMutableAttributedString *attrString = [[NSMutableAttributedString alloc] initWithString:replyInfo];
|
||||
[attrString addAttribute:NSParagraphStyleAttributeName value:style range:NSMakeRange(0, replyInfo.length)];
|
||||
[attrString addAttribute:NSFontAttributeName value:kFont11 range:NSMakeRange(0, replyInfo.length)];
|
||||
|
||||
self.replyCommentLabel.attributedText = attrString;
|
||||
[self.replyCommentLabel mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.avatarView.mas_bottom).with.offset(kHalfMargin);
|
||||
make.height.mas_equalTo(replyHeight);
|
||||
}];
|
||||
} else {
|
||||
self.replyCommentLabel.attributedText = [[NSMutableAttributedString alloc] initWithString:@""];
|
||||
[self.replyCommentLabel mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.avatarView.mas_bottom);
|
||||
make.height.mas_equalTo(CGFLOAT_MIN);
|
||||
}];
|
||||
}
|
||||
|
||||
[self.commentLabel mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo([TFViewHelper getDynamicHeightWithLabelFont:self.commentLabel.font labelWidth:(SCREEN_WIDTH - 35.0f - kMargin) labelText:self.commentLabel.text] - kHalfMargin);
|
||||
}];
|
||||
}
|
||||
|
||||
@end
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// TFAppraiseDetailHeaderView.h
|
||||
// TFReader
|
||||
//
|
||||
// Created by 谢腾飞 on 2020/12/21.
|
||||
// Copyright © 2020 xtfei_2011@126.com. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "TFAppraiseDetailModel.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface TFAppraiseDetailHeaderView : TFBasicTableViewCell
|
||||
|
||||
@property (nonatomic ,copy) void (^commentProductionClickBlock)(void);
|
||||
|
||||
@property (nonatomic ,strong) TFAppraiseDetailModel *appraiseDetailModel;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+234
@@ -0,0 +1,234 @@
|
||||
//
|
||||
// TFAppraiseDetailHeaderView.m
|
||||
// TFReader
|
||||
//
|
||||
// Created by 谢腾飞 on 2020/12/21.
|
||||
// Copyright © 2020 xtfei_2011@126.com. All rights reserved.
|
||||
//
|
||||
|
||||
#import "TFAppraiseDetailHeaderView.h"
|
||||
|
||||
@interface TFAppraiseDetailHeaderView ()
|
||||
|
||||
@property (nonatomic ,strong) UIImageView *avatarView; //头像
|
||||
@property (nonatomic ,strong) UILabel *nickNameLabel; //昵称
|
||||
@property (nonatomic ,strong) UIImageView *vipView; // VIP标识
|
||||
@property (nonatomic ,strong) UILabel *timeLabel; //发布时间
|
||||
@property (nonatomic ,strong) UILabel *commentLabel; //评论
|
||||
@property (nonatomic ,strong) YYLabel *replycommentLabel; // 二级评论
|
||||
@property (nonatomic ,strong) TFProductionCoverView *coverView;
|
||||
@property (nonatomic ,strong) UIButton *baseBtn;
|
||||
@property (nonatomic ,strong) UILabel *titleLabel;
|
||||
@property (nonatomic ,strong) UILabel *authorLabel;
|
||||
|
||||
@end
|
||||
|
||||
@implementation TFAppraiseDetailHeaderView
|
||||
|
||||
- (void)createSubviews
|
||||
{
|
||||
[super createSubviews];
|
||||
|
||||
// 头像
|
||||
self.avatarView = [[UIImageView alloc] initWithCornerRadiusAdvance:35.0f / 2 rectCornerType:UIRectCornerAllCorners];
|
||||
[self.contentView addSubview:self.avatarView];
|
||||
|
||||
[self.avatarView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.contentView.mas_left).with.offset(kMargin);
|
||||
make.top.mas_equalTo(self.contentView.mas_top).with.offset(kMargin);
|
||||
make.width.height.mas_equalTo(35.0f);
|
||||
}];
|
||||
|
||||
// 昵称
|
||||
self.nickNameLabel = [[UILabel alloc] init];
|
||||
self.nickNameLabel.textColor = kGrayTextDeepColor;
|
||||
self.nickNameLabel.font = kFont13;
|
||||
self.nickNameLabel.textAlignment = NSTextAlignmentLeft;
|
||||
[self.contentView addSubview:self.nickNameLabel];
|
||||
|
||||
[self.nickNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.avatarView.mas_right).with.offset(kHalfMargin);
|
||||
make.top.mas_equalTo(self.avatarView.mas_top);
|
||||
make.width.mas_equalTo(200);
|
||||
make.height.mas_equalTo(self.avatarView.mas_height).multipliedBy(0.6);
|
||||
}];
|
||||
|
||||
self.vipView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"public_vip_normal"]];
|
||||
self.vipView.hidden = YES;
|
||||
[self.contentView addSubview:self.vipView];
|
||||
|
||||
[self.vipView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.nickNameLabel.mas_right);
|
||||
make.centerY.mas_equalTo(self.nickNameLabel.mas_centerY);
|
||||
make.height.mas_equalTo(10);
|
||||
make.width.mas_equalTo(kGeometricWidth(10, 138, 48));
|
||||
}];
|
||||
|
||||
self.timeLabel = [[UILabel alloc] init];
|
||||
self.timeLabel.textAlignment = NSTextAlignmentLeft;
|
||||
self.timeLabel.font = kFont10;
|
||||
self.timeLabel.textColor = kGrayTextColor;
|
||||
[self.contentView addSubview:self.timeLabel];
|
||||
|
||||
[self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.avatarView.mas_right).with.offset(kHalfMargin);
|
||||
make.bottom.mas_equalTo(self.avatarView.mas_bottom);
|
||||
make.right.mas_equalTo(self.contentView.mas_right).with.offset(- kHalfMargin);
|
||||
make.height.mas_equalTo(self.avatarView.mas_height).multipliedBy(0.4);
|
||||
}];
|
||||
|
||||
// 二级评论
|
||||
self.replycommentLabel = [[YYLabel alloc] init];
|
||||
self.replycommentLabel.textAlignment = NSTextAlignmentLeft;
|
||||
self.replycommentLabel.textColor = kGrayTextDeepColor;
|
||||
self.replycommentLabel.font = kFont13;
|
||||
self.replycommentLabel.backgroundColor = kGrayViewColor;
|
||||
self.replycommentLabel.numberOfLines = 0;
|
||||
self.replycommentLabel.textContainerInset = UIEdgeInsetsMake(6, 5, 4, 5);
|
||||
[self.contentView addSubview:self.replycommentLabel];
|
||||
|
||||
[self.replycommentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.avatarView.mas_left);
|
||||
make.top.mas_equalTo(self.avatarView.mas_bottom);
|
||||
make.right.mas_equalTo(self.contentView.mas_right).with.offset(- kMargin);
|
||||
make.height.mas_equalTo(CGFLOAT_MIN);
|
||||
}];
|
||||
|
||||
// 评论
|
||||
self.commentLabel = [[UILabel alloc] init];
|
||||
self.commentLabel.textAlignment = NSTextAlignmentLeft;
|
||||
self.commentLabel.font = kFont12;
|
||||
self.commentLabel.numberOfLines = 0;
|
||||
self.commentLabel.textColor = KGrayTextMiddleColor;
|
||||
[self.contentView addSubview:self.commentLabel];
|
||||
|
||||
[self.commentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(kMargin);
|
||||
make.right.mas_equalTo(self.contentView.mas_right).with.offset(- kMargin);
|
||||
make.top.mas_equalTo(self.replycommentLabel.mas_bottom).with.offset(kHalfMargin);
|
||||
make.height.mas_equalTo(200);
|
||||
}];
|
||||
|
||||
self.baseBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
self.baseBtn.backgroundColor = kGrayViewColor;
|
||||
[ self.baseBtn addTarget:self action:@selector(commentProductionClick) forControlEvents:UIControlEventTouchUpInside];
|
||||
[self.contentView addSubview: self.baseBtn];
|
||||
|
||||
[ self.baseBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(kMargin);
|
||||
make.right.mas_equalTo(self.contentView.mas_right).with.offset(- kMargin);
|
||||
make.top.mas_equalTo(self.commentLabel.mas_bottom).with.offset(kHalfMargin);
|
||||
make.height.mas_equalTo(kGeometricHeight(SCREEN_WIDTH, 3, 1) - kMargin);
|
||||
make.bottom.mas_equalTo(self.contentView.mas_bottom).with.offset(- kHalfMargin).priorityLow();
|
||||
}];
|
||||
|
||||
self.coverView = [[TFProductionCoverView alloc] initWithProductionType:TFProductionTypeNovel coverDirection:TFProductionCoverDirectionVertical];
|
||||
self.coverView.userInteractionEnabled = NO;
|
||||
[ self.baseBtn addSubview:self.coverView];
|
||||
|
||||
[self.coverView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo( self.baseBtn.mas_left).with.offset(kHalfMargin);
|
||||
make.centerY.mas_equalTo( self.baseBtn.mas_centerY);
|
||||
make.height.mas_equalTo( self.baseBtn.mas_height).with.offset(- kMargin);
|
||||
make.width.mas_equalTo(kGeometricWidth(kGeometricHeight(SCREEN_WIDTH, 3, 1) - 2 * kMargin, 3, 4));
|
||||
}];
|
||||
|
||||
self.titleLabel = [[UILabel alloc] init];
|
||||
self.titleLabel.textColor = kBlackColor;
|
||||
self.titleLabel.textAlignment = NSTextAlignmentLeft;
|
||||
self.titleLabel.numberOfLines = 1;
|
||||
self.titleLabel.font = kMainFont;
|
||||
[ self.baseBtn addSubview:self.titleLabel];
|
||||
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.coverView.mas_right).with.offset(kHalfMargin);
|
||||
make.bottom.mas_equalTo( self.baseBtn.mas_centerY);
|
||||
make.right.mas_equalTo( self.baseBtn.mas_right).with.offset(- kHalfMargin);
|
||||
make.height.mas_equalTo(40);
|
||||
}];
|
||||
|
||||
self.authorLabel = [[UILabel alloc] init];
|
||||
self.authorLabel.textColor = kGrayTextColor;
|
||||
self.authorLabel.textAlignment = NSTextAlignmentLeft;
|
||||
self.authorLabel.font = kFont10;
|
||||
[ self.baseBtn addSubview:self.authorLabel];
|
||||
|
||||
[self.authorLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.titleLabel.mas_left);
|
||||
make.right.mas_equalTo(self.titleLabel.mas_right);
|
||||
make.height.mas_equalTo(30);
|
||||
make.top.mas_equalTo( self.baseBtn.mas_centerY);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)setAppraiseDetailModel:(TFAppraiseDetailModel *)appraiseDetailModel
|
||||
{
|
||||
_appraiseDetailModel = appraiseDetailModel;
|
||||
|
||||
self.timeLabel.text = [NSString stringWithFormat:@"%@",appraiseDetailModel.time ? : @""];
|
||||
|
||||
self.commentLabel.text = [NSString stringWithFormat:@"%@",appraiseDetailModel.content ? : @""];
|
||||
|
||||
[self.commentLabel mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo([TFViewHelper getDynamicHeightWithLabelFont:self.commentLabel.font labelWidth:(SCREEN_WIDTH - 35.0f - kMargin) labelText:self.commentLabel.text] - kHalfMargin);
|
||||
}];
|
||||
|
||||
[self.avatarView setImageWithURL:[NSURL URLWithString:appraiseDetailModel.avatar ? : @""] placeholder:HoldUserAvatar options:YYWebImageOptionSetImageWithFadeAnimation completion:nil];
|
||||
|
||||
self.nickNameLabel.text = [NSString stringWithFormat:@"%@",appraiseDetailModel.nickname ? : @""];
|
||||
[self.nickNameLabel mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo([TFViewHelper getDynamicWidthWithLabel:self.nickNameLabel]);
|
||||
}];
|
||||
|
||||
if (appraiseDetailModel.is_vip == 1) {
|
||||
self.vipView.hidden = NO;
|
||||
} else {
|
||||
self.vipView.hidden = YES;
|
||||
}
|
||||
|
||||
self.coverView.coverImageUrl = appraiseDetailModel.cover;
|
||||
|
||||
self.titleLabel.text = appraiseDetailModel.name ? : @"";
|
||||
|
||||
self.authorLabel.text = appraiseDetailModel.author ? : @"";
|
||||
|
||||
if (appraiseDetailModel.reply_info.length > 0) {
|
||||
CGFloat replyHeight = [TFViewHelper getDynamicHeightWithLabelFont:kFont11 labelWidth:(SCREEN_WIDTH - 2 * kMargin - 35.0f - kHalfMargin) labelText:appraiseDetailModel.reply_info];
|
||||
NSString *replyInfo = [NSString stringWithFormat:@"%@",appraiseDetailModel.reply_info];
|
||||
|
||||
NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc] init];
|
||||
style.lineSpacing = 3;
|
||||
|
||||
NSMutableAttributedString *attrString = [[NSMutableAttributedString alloc] initWithString:replyInfo];
|
||||
[attrString addAttribute:NSParagraphStyleAttributeName value:style range:NSMakeRange(0, replyInfo.length)];
|
||||
[attrString addAttribute:NSFontAttributeName value:kFont11 range:NSMakeRange(0, replyInfo.length)];
|
||||
|
||||
self.replycommentLabel.attributedText = attrString;
|
||||
[self.replycommentLabel mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.avatarView.mas_bottom).with.offset(kHalfMargin);
|
||||
make.height.mas_equalTo(replyHeight);
|
||||
}];
|
||||
} else {
|
||||
self.replycommentLabel.attributedText = [[NSMutableAttributedString alloc] initWithString:@""];
|
||||
[self.replycommentLabel mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.avatarView.mas_bottom);
|
||||
make.height.mas_equalTo(CGFLOAT_MIN);
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setProductionType:(TFProductionType)productionType
|
||||
{
|
||||
[super setProductionType:productionType];
|
||||
|
||||
self.coverView.productionType = productionType;
|
||||
}
|
||||
|
||||
- (void)commentProductionClick
|
||||
{
|
||||
if (self.commentProductionClickBlock) {
|
||||
self.commentProductionClickBlock();
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user