91 lines
2.7 KiB
Objective-C
91 lines
2.7 KiB
Objective-C
//
|
|
// TFBookStoreComicBasicItemCell.m
|
|
// TFReader
|
|
//
|
|
// Created by 谢腾飞 on 2020/12/16.
|
|
// Copyright © 2020 xtfei_2011@126.com. All rights reserved.
|
|
//
|
|
|
|
#import "TFBookStoreComicBasicItemCell.h"
|
|
#import "TFBookStoreComicNormalItemCell.h"
|
|
|
|
@interface TFBookStoreComicBasicItemCell ()
|
|
|
|
@end
|
|
|
|
@implementation TFBookStoreComicBasicItemCell
|
|
|
|
- (instancetype)initWithFrame:(CGRect)frame
|
|
{
|
|
if (self = [super initWithFrame:frame]) {
|
|
|
|
self.backgroundColor = kWhiteColor;
|
|
[self createSubViews];
|
|
}
|
|
return self;
|
|
}
|
|
|
|
- (void)createSubViews
|
|
{
|
|
[self setupSubview];
|
|
[self setupSubviewFrame];
|
|
}
|
|
|
|
- (void)setupSubview
|
|
{
|
|
self.comicCoverView = [[TFProductionCoverView alloc] initWithProductionType:TFProductionTypeComic coverDirection:TFProductionCoverDirectionVertical];
|
|
[self addSubview:self.comicCoverView];
|
|
|
|
self.titileLabel = [[UILabel alloc] init];
|
|
self.titileLabel.textColor = kBlackColor;
|
|
self.titileLabel.textAlignment = NSTextAlignmentLeft;
|
|
self.titileLabel.font = kMainFont;
|
|
self.titileLabel.numberOfLines = 1;
|
|
[self addSubview:self.titileLabel];
|
|
|
|
self.describeLabel = [[UILabel alloc] init];
|
|
self.describeLabel.textColor = kGrayTextColor;
|
|
self.describeLabel.textAlignment = NSTextAlignmentLeft;
|
|
self.describeLabel.font = kFont12;
|
|
self.describeLabel.numberOfLines = 1;
|
|
[self addSubview:self.describeLabel];
|
|
}
|
|
|
|
- (void)setupSubviewFrame
|
|
{
|
|
[self.comicCoverView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.left.mas_equalTo(self.mas_left);
|
|
make.top.mas_equalTo(self.mas_top);
|
|
make.width.mas_equalTo(Comic_NormalVertical_Width);
|
|
make.height.mas_equalTo(Comic_NormalVertical_Height);
|
|
}];
|
|
|
|
|
|
[self.titileLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.left.mas_equalTo(self.mas_left).with.offset(kQuarterMargin);
|
|
make.top.mas_equalTo(self.comicCoverView.mas_bottom).with.offset(kQuarterMargin);
|
|
make.right.mas_equalTo(self.mas_right).with.offset(-kQuarterMargin);
|
|
make.height.mas_equalTo(Comic_Cell_Title_Height / 2);
|
|
}];
|
|
|
|
|
|
[self.describeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.left.mas_equalTo(self.titileLabel.mas_left);
|
|
make.top.mas_equalTo(self.titileLabel.mas_bottom);
|
|
make.right.mas_equalTo(self.titileLabel.mas_right);
|
|
make.height.mas_equalTo(self.titileLabel.mas_height);
|
|
}];
|
|
}
|
|
|
|
- (void)setProductionModel:(TFProductionModel *)productionModel
|
|
{
|
|
if (!productionModel) return;
|
|
|
|
_productionModel = productionModel;
|
|
|
|
self.comicCoverView.coverTitleString = productionModel.flag ? : @"";
|
|
self.titileLabel.text = productionModel.name ? : @"";
|
|
}
|
|
|
|
@end
|