小说绘上架版本
This commit is contained in:
+21
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// WXYZ_CancelAccountTableViewCell.h
|
||||
// WXReader
|
||||
//
|
||||
// Created by Andrew on 2019/12/23.
|
||||
// Copyright © 2019 Andrew. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WXYZ_CancelAccountTableViewCell : TFBasicTableViewCell
|
||||
|
||||
@property (nonatomic, copy) NSString *titleString;
|
||||
|
||||
@property (nonatomic, copy) NSString *detailString;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
//
|
||||
// WXYZ_CancelAccountTableViewCell.m
|
||||
// WXReader
|
||||
//
|
||||
// Created by Andrew on 2019/12/23.
|
||||
// Copyright © 2019 Andrew. All rights reserved.
|
||||
//
|
||||
|
||||
#import "WXYZ_CancelAccountTableViewCell.h"
|
||||
|
||||
@implementation WXYZ_CancelAccountTableViewCell
|
||||
{
|
||||
UIImageView *pointView;
|
||||
UILabel *cellTitleLabel;
|
||||
UILabel *cellDetailLabel;
|
||||
}
|
||||
|
||||
- (void)createSubviews
|
||||
{
|
||||
[super createSubviews];
|
||||
|
||||
cellTitleLabel = [[UILabel alloc] init];
|
||||
cellTitleLabel.textColor = kBlackColor;
|
||||
cellTitleLabel.textAlignment = NSTextAlignmentLeft;
|
||||
cellTitleLabel.font = kBoldMainFont;
|
||||
cellTitleLabel.numberOfLines = 1;
|
||||
[self.contentView addSubview:cellTitleLabel];
|
||||
|
||||
[cellTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(kMargin);
|
||||
make.top.mas_equalTo(self.contentView.mas_top).with.offset(kHalfMargin);
|
||||
make.right.mas_equalTo(self.contentView.mas_right).with.offset(- kHalfMargin);
|
||||
make.height.mas_equalTo(30);
|
||||
}];
|
||||
|
||||
cellDetailLabel = [[UILabel alloc] init];
|
||||
cellDetailLabel.textColor = kGrayTextColor;
|
||||
cellDetailLabel.textAlignment = NSTextAlignmentLeft;
|
||||
cellDetailLabel.font = kMainFont;
|
||||
cellDetailLabel.numberOfLines = 0;
|
||||
[self.contentView addSubview:cellDetailLabel];
|
||||
|
||||
[cellDetailLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(cellTitleLabel.mas_left);
|
||||
make.top.mas_equalTo(cellTitleLabel.mas_bottom);
|
||||
make.right.mas_equalTo(cellTitleLabel.mas_right);
|
||||
make.bottom.mas_equalTo(self.contentView.mas_bottom).priorityLow();
|
||||
}];
|
||||
|
||||
pointView = [[UIImageView alloc] init];
|
||||
pointView.image = [UIImage imageNamed:@"cancel_point"];
|
||||
[self.contentView addSubview:pointView];
|
||||
|
||||
[pointView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(cellTitleLabel.mas_left);
|
||||
make.centerY.mas_equalTo(cellTitleLabel.mas_centerY);
|
||||
make.width.height.mas_equalTo(20);
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
- (void)setTitleString:(NSString *)titleString
|
||||
{
|
||||
_titleString = titleString;
|
||||
cellTitleLabel.text = titleString;
|
||||
}
|
||||
|
||||
- (void)setDetailString:(NSString *)detailString
|
||||
{
|
||||
_detailString = detailString;
|
||||
cellDetailLabel.text = detailString;
|
||||
}
|
||||
|
||||
@end
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// WXYZ_UserDataTableViewCell.h
|
||||
// WXReader
|
||||
//
|
||||
// Created by Andrew on 2020/5/30.
|
||||
// Copyright © 2020 Andrew. All rights reserved.
|
||||
//
|
||||
|
||||
#import "TFBasicTableViewCell.h"
|
||||
|
||||
@class TFUserDataListModel;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WXYZ_UserDataTableViewCell : TFBasicTableViewCell
|
||||
|
||||
@property (nonatomic, strong) TFUserDataListModel *cellModel;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+118
@@ -0,0 +1,118 @@
|
||||
//
|
||||
// WXYZ_UserDataTableViewCell.m
|
||||
// WXReader
|
||||
//
|
||||
// Created by Andrew on 2020/5/30.
|
||||
// Copyright © 2020 Andrew. All rights reserved.
|
||||
//
|
||||
|
||||
#import "WXYZ_UserDataTableViewCell.h"
|
||||
#import "TFUserDataModel.h"
|
||||
|
||||
@implementation WXYZ_UserDataTableViewCell
|
||||
{
|
||||
UILabel *cellTitleLabel;
|
||||
UILabel *cellDetailTitleLabel;
|
||||
UIImageView *connerImageView;
|
||||
UIImageView *avatarImageView;
|
||||
}
|
||||
|
||||
- (void)createSubviews
|
||||
{
|
||||
[super createSubviews];
|
||||
|
||||
cellTitleLabel = [[UILabel alloc] init];
|
||||
cellTitleLabel.textColor = kBlackColor;
|
||||
cellTitleLabel.font = kMainFont;
|
||||
cellTitleLabel.textAlignment = NSTextAlignmentLeft;
|
||||
[self.contentView addSubview:cellTitleLabel];
|
||||
|
||||
[cellTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.contentView.mas_left).with.offset(kMargin);
|
||||
make.centerY.mas_equalTo(self.contentView.mas_centerY);
|
||||
make.width.mas_equalTo(SCREEN_WIDTH / 2);
|
||||
make.height.mas_equalTo(self.contentView.mas_height);
|
||||
}];
|
||||
|
||||
connerImageView = [[UIImageView alloc] init];
|
||||
connerImageView.image = [UIImage imageNamed:@"public_more"];
|
||||
[self.contentView addSubview:connerImageView];
|
||||
|
||||
[connerImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(self.contentView.mas_right).with.offset(- kMargin);
|
||||
make.centerY.mas_equalTo(self.contentView.mas_centerY);
|
||||
make.width.mas_equalTo(10);
|
||||
make.height.mas_equalTo(10);
|
||||
}];
|
||||
|
||||
avatarImageView = [[UIImageView alloc] init];
|
||||
avatarImageView.layer.cornerRadius = 25;
|
||||
avatarImageView.clipsToBounds = YES;
|
||||
[self.contentView addSubview:avatarImageView];
|
||||
|
||||
[avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(connerImageView.mas_left).with.offset(- kHalfMargin);
|
||||
make.top.mas_equalTo(self.contentView.mas_top).with.offset(kHalfMargin);
|
||||
make.width.mas_equalTo(50);
|
||||
make.height.mas_equalTo(CGFLOAT_MIN);
|
||||
}];
|
||||
|
||||
cellDetailTitleLabel = [[UILabel alloc] init];
|
||||
cellDetailTitleLabel.font = kFont12;
|
||||
cellDetailTitleLabel.textAlignment = NSTextAlignmentRight;
|
||||
cellDetailTitleLabel.textColor = kGrayTextColor;
|
||||
[self.contentView addSubview:cellDetailTitleLabel];
|
||||
|
||||
[cellDetailTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(cellTitleLabel.mas_right);
|
||||
make.right.mas_equalTo(connerImageView.mas_left).with.offset(- kHalfMargin);
|
||||
make.top.mas_equalTo(avatarImageView.mas_bottom);
|
||||
make.height.mas_equalTo(CGFLOAT_MIN);
|
||||
make.bottom.mas_equalTo(self.contentView.mas_bottom).with.offset(- kHalfMargin);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)setCellModel:(TFUserDataListModel *)cellModel
|
||||
{
|
||||
_cellModel = cellModel;
|
||||
|
||||
if ([cellModel.action isEqualToString:@"avatar"]) {
|
||||
[avatarImageView setImageWithURL:[NSURL URLWithString:cellModel.desc?:@""] placeholder:HoldUserAvatar options:YYWebImageOptionSetImageWithFadeAnimation completion:nil];
|
||||
[avatarImageView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo(50);
|
||||
}];
|
||||
cellDetailTitleLabel.text = @"";
|
||||
[cellDetailTitleLabel mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo(CGFLOAT_MIN);
|
||||
}];
|
||||
} else {
|
||||
avatarImageView.image = nil;
|
||||
[avatarImageView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo(CGFLOAT_MIN);
|
||||
}];
|
||||
cellDetailTitleLabel.text = cellModel.desc?:@"";
|
||||
[cellDetailTitleLabel mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo(30);
|
||||
}];
|
||||
}
|
||||
|
||||
cellTitleLabel.text = cellModel.title?:@"";
|
||||
cellTitleLabel.textColor = [UIColor colorWithHexString:cellModel.title_color?:@""];
|
||||
cellDetailTitleLabel.textColor = [UIColor colorWithHexString:cellModel.desc_color?:@""];
|
||||
|
||||
connerImageView.hidden = !cellModel.is_click;
|
||||
if (cellModel.is_click) {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
[cellDetailTitleLabel mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
if (cellModel.is_click) {
|
||||
make.right.mas_equalTo(connerImageView.mas_left).with.offset(- kHalfMargin);
|
||||
} else {
|
||||
make.right.equalTo(connerImageView.mas_left).offset(10);
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user