移动文件

This commit is contained in:
2025-10-29 16:44:00 +08:00
parent 9101ffaab0
commit c5326a3079
9 changed files with 71 additions and 10 deletions

View File

@@ -0,0 +1,20 @@
//
// KBGuideKFCell.h
// keyBoard
//
// 客服回复气泡 cell左侧头像 + 白色圆角气泡)
//
#import "BaseCell.h"
NS_ASSUME_NONNULL_BEGIN
@interface KBGuideKFCell : BaseCell
/// 设置文案
- (void)configText:(NSString *)text;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,77 @@
//
// KBGuideKFCell.m
// keyBoard
//
#import "KBGuideKFCell.h"
@interface KBGuideKFCell ()
@property (nonatomic, strong) UIView *avatarView; //
@property (nonatomic, strong) UIView *bubbleView; //
@property (nonatomic, strong) UILabel *contentLabel; //
@end
@implementation KBGuideKFCell
- (void)setupUI {
self.contentView.backgroundColor = [UIColor colorWithWhite:0.96 alpha:1.0];
[self.contentView addSubview:self.avatarView];
[self.avatarView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.contentView).offset(16);
make.top.equalTo(self.contentView).offset(10);
make.width.height.mas_equalTo(36);
}];
[self.contentView addSubview:self.bubbleView];
[self.bubbleView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.avatarView.mas_right).offset(8);
make.top.equalTo(self.contentView).offset(8);
make.right.lessThanOrEqualTo(self.contentView).offset(-80);
make.bottom.equalTo(self.contentView).offset(-8);
}];
[self.bubbleView addSubview:self.contentLabel];
[self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.bubbleView).insets(UIEdgeInsetsMake(10, 12, 10, 12));
}];
}
- (void)configText:(NSString *)text {
self.contentLabel.text = text;
}
#pragma mark - Lazy
- (UIView *)avatarView {
if (!_avatarView) {
_avatarView = [UIView new];
_avatarView.backgroundColor = [UIColor colorWithRed:0.23 green:0.47 blue:0.96 alpha:1.0];
_avatarView.layer.cornerRadius = 18;
_avatarView.layer.masksToBounds = YES;
}
return _avatarView;
}
- (UIView *)bubbleView {
if (!_bubbleView) {
_bubbleView = [UIView new];
_bubbleView.backgroundColor = [UIColor whiteColor];
_bubbleView.layer.cornerRadius = 18;
_bubbleView.layer.masksToBounds = YES;
}
return _bubbleView;
}
- (UILabel *)contentLabel {
if (!_contentLabel) {
_contentLabel = [UILabel new];
_contentLabel.numberOfLines = 0;
_contentLabel.font = [UIFont systemFontOfSize:15];
_contentLabel.textColor = [UIColor colorWithWhite:0.15 alpha:1.0];
}
return _contentLabel;
}
@end

View File

@@ -0,0 +1,17 @@
//
// KBGuideTopCell.h
// keyBoard
//
// 顶部固定引导 cell左侧头像 + 卡片文案)
//
#import "BaseCell.h"
NS_ASSUME_NONNULL_BEGIN
@interface KBGuideTopCell : BaseCell
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,156 @@
//
// KBGuideTopCell.m
// keyBoard
//
#import "KBGuideTopCell.h"
@interface KBGuideTopCell ()
//
@property (nonatomic, strong) UIView *avatarView;
//
@property (nonatomic, strong) UIView *cardView;
// /
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UILabel *descLabel;
@property (nonatomic, strong) UIView *line1;
@property (nonatomic, strong) UILabel *q1Label;
@property (nonatomic, strong) UIView *line2;
@property (nonatomic, strong) UILabel *q2Label;
@end
@implementation KBGuideTopCell
- (void)setupUI {
self.contentView.backgroundColor = [UIColor colorWithWhite:0.96 alpha:1.0];
//
[self.contentView addSubview:self.avatarView];
[self.avatarView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.contentView).offset(16);
make.top.equalTo(self.contentView).offset(12);
make.width.height.mas_equalTo(36);
}];
//
[self.contentView addSubview:self.cardView];
[self.cardView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.avatarView.mas_right).offset(8);
make.right.lessThanOrEqualTo(self.contentView).offset(-32);
make.top.equalTo(self.contentView).offset(8);
make.bottom.equalTo(self.contentView).offset(-8);
}];
[self.cardView addSubview:self.titleLabel];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.equalTo(self.cardView).offset(12);
make.right.equalTo(self.cardView).offset(-12);
}];
[self.cardView addSubview:self.descLabel];
[self.descLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.titleLabel.mas_bottom).offset(6);
make.left.right.equalTo(self.titleLabel);
}];
//
[self.cardView addSubview:self.line1];
[self.cardView addSubview:self.q1Label];
[self.cardView addSubview:self.line2];
[self.cardView addSubview:self.q2Label];
[self.line1 mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.descLabel.mas_bottom).offset(10);
make.left.right.equalTo(self.cardView);
make.height.mas_equalTo(KB_ONE_PIXEL);
}];
[self.q1Label mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.line1.mas_bottom).offset(10);
make.left.right.equalTo(self.titleLabel);
}];
[self.line2 mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.q1Label.mas_bottom).offset(10);
make.left.right.equalTo(self.cardView);
make.height.mas_equalTo(KB_ONE_PIXEL);
}];
[self.q2Label mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.line2.mas_bottom).offset(10);
make.left.right.equalTo(self.titleLabel);
make.bottom.equalTo(self.cardView).offset(-14);
}];
}
#pragma mark - Lazy
- (UIView *)avatarView {
if (!_avatarView) {
_avatarView = [UIView new];
_avatarView.backgroundColor = [UIColor colorWithRed:0.23 green:0.47 blue:0.96 alpha:1.0];
_avatarView.layer.cornerRadius = 18;
_avatarView.layer.masksToBounds = YES;
}
return _avatarView;
}
- (UIView *)cardView {
if (!_cardView) {
_cardView = [UIView new];
_cardView.backgroundColor = [UIColor whiteColor];
_cardView.layer.cornerRadius = 18;
_cardView.layer.masksToBounds = YES;
}
return _cardView;
}
- (UILabel *)titleLabel {
if (!_titleLabel) {
_titleLabel = [UILabel new];
_titleLabel.numberOfLines = 0;
_titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
_titleLabel.textColor = [UIColor colorWithWhite:0.2 alpha:1.0];
_titleLabel.text = @"👋 欢迎使用『Lovekey 键盘』";
}
return _titleLabel;
}
- (UILabel *)descLabel {
if (!_descLabel) {
_descLabel = [UILabel new];
_descLabel.numberOfLines = 0;
_descLabel.font = [UIFont systemFontOfSize:14];
_descLabel.textColor = [UIColor colorWithWhite:0.2 alpha:1.0];
_descLabel.text = @"点击任一对话去粘贴,选择任意回复方式去试用吧~";
}
return _descLabel;
}
- (UIView *)line1 { if (!_line1) { _line1 = [UIView new]; _line1.backgroundColor = [UIColor colorWithWhite:0.92 alpha:1.0]; } return _line1; }
- (UIView *)line2 { if (!_line2) { _line2 = [UIView new]; _line2.backgroundColor = [UIColor colorWithWhite:0.92 alpha:1.0]; } return _line2; }
- (UILabel *)q1Label {
if (!_q1Label) {
_q1Label = [UILabel new];
_q1Label.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
_q1Label.textColor = [UIColor blackColor];
_q1Label.text = @"在干嘛?";
}
return _q1Label;
}
- (UILabel *)q2Label {
if (!_q2Label) {
_q2Label = [UILabel new];
_q2Label.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
_q2Label.textColor = [UIColor blackColor];
_q2Label.text = @"我去洗澡了";
}
return _q2Label;
}
@end

View File

@@ -0,0 +1,19 @@
//
// KBGuideUserCell.h
// keyBoard
//
// 我方发送气泡 cell右侧紫色气泡
//
#import "BaseCell.h"
NS_ASSUME_NONNULL_BEGIN
@interface KBGuideUserCell : BaseCell
- (void)configText:(NSString *)text;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,60 @@
//
// KBGuideUserCell.m
// keyBoard
//
#import "KBGuideUserCell.h"
@interface KBGuideUserCell ()
@property (nonatomic, strong) UIView *bubbleView; //
@property (nonatomic, strong) UILabel *contentLabel;
@end
@implementation KBGuideUserCell
- (void)setupUI {
self.contentView.backgroundColor = [UIColor colorWithWhite:0.96 alpha:1.0];
[self.contentView addSubview:self.bubbleView];
[self.bubbleView mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.contentView).offset(-16);
make.top.equalTo(self.contentView).offset(8);
make.left.greaterThanOrEqualTo(self.contentView).offset(80);
make.bottom.equalTo(self.contentView).offset(-8);
}];
[self.bubbleView addSubview:self.contentLabel];
[self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.bubbleView).insets(UIEdgeInsetsMake(8, 10, 8, 10));
}];
}
- (void)configText:(NSString *)text {
self.contentLabel.text = text;
}
#pragma mark - Lazy
- (UIView *)bubbleView {
if (!_bubbleView) {
_bubbleView = [UIView new];
_bubbleView.backgroundColor = [UIColor colorWithRed:0.42 green:0.45 blue:0.98 alpha:1.0];
_bubbleView.layer.cornerRadius = 12;
_bubbleView.layer.masksToBounds = YES;
}
return _bubbleView;
}
- (UILabel *)contentLabel {
if (!_contentLabel) {
_contentLabel = [UILabel new];
_contentLabel.numberOfLines = 0;
_contentLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
_contentLabel.textColor = [UIColor whiteColor];
_contentLabel.textAlignment = NSTextAlignmentCenter;
}
return _contentLabel;
}
@end