This commit is contained in:
2025-11-07 20:58:14 +08:00
parent 91d754b389
commit 48a12f0919
30 changed files with 282 additions and 46 deletions

View File

@@ -43,7 +43,7 @@
[self.cardImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.avatarCircleView.mas_bottom).offset(-34); //
make.left.right.equalTo(self);
make.height.mas_equalTo(KBFit(148));
make.height.mas_equalTo(KBFit(158));
}];
@@ -129,6 +129,9 @@
@property (nonatomic, strong) KBTopThreeCardView *rightCard;
/// KBTopThreeView
@property (nonatomic, strong) UIButton *plusButton;
/// plus
@property (nonatomic, strong) UIButton *leftPlusButton;
@property (nonatomic, strong) UIButton *rightPlusButton;
@end
@implementation KBTopThreeView
@@ -146,6 +149,8 @@
[self addSubview:self.centerCard];
[self addSubview:self.rightCard];
[self addSubview:self.plusButton];
[self addSubview:self.leftPlusButton];
[self addSubview:self.rightPlusButton];
//
[self.centerCard mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -173,11 +178,25 @@
// plusButton
[self.plusButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.centerCard.mas_bottom).offset(12);
make.centerX.equalTo(self);
make.width.mas_equalTo(52);
make.centerX.equalTo(self); // equalTo(self.centerCard)
make.width.mas_equalTo(60);
make.height.mas_equalTo(28);
make.bottom.equalTo(self).offset(-8);
}];
// plus
[self.leftPlusButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.leftCard.mas_bottom).offset(12);
make.centerX.equalTo(self.leftCard);
make.width.height.equalTo(self.plusButton);
make.bottom.equalTo(self).offset(-8);
}];
[self.rightPlusButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.rightCard.mas_bottom).offset(12);
make.centerX.equalTo(self.rightCard);
make.width.height.equalTo(self.plusButton);
make.bottom.equalTo(self).offset(-8);
}];
}
- (void)configWithItems:(NSArray<NSDictionary *> *)items {
@@ -214,4 +233,30 @@
return _plusButton;
}
- (UIButton *)leftPlusButton {
if (!_leftPlusButton) {
_leftPlusButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_leftPlusButton setTitle:@"+" forState:UIControlStateNormal];
[_leftPlusButton setTitleColor:[UIColor colorWithRed:0.20 green:0.65 blue:0.50 alpha:1.0] forState:UIControlStateNormal];
_leftPlusButton.titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightSemibold];
_leftPlusButton.layer.cornerRadius = 14.0;
_leftPlusButton.layer.masksToBounds = YES;
_leftPlusButton.backgroundColor = [[UIColor colorWithRed:0.20 green:0.65 blue:0.50 alpha:1.0] colorWithAlphaComponent:0.15];
}
return _leftPlusButton;
}
- (UIButton *)rightPlusButton {
if (!_rightPlusButton) {
_rightPlusButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_rightPlusButton setTitle:@"+" forState:UIControlStateNormal];
[_rightPlusButton setTitleColor:[UIColor colorWithRed:0.20 green:0.65 blue:0.50 alpha:1.0] forState:UIControlStateNormal];
_rightPlusButton.titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightSemibold];
_rightPlusButton.layer.cornerRadius = 14.0;
_rightPlusButton.layer.masksToBounds = YES;
_rightPlusButton.backgroundColor = [[UIColor colorWithRed:0.20 green:0.65 blue:0.50 alpha:1.0] colorWithAlphaComponent:0.15];
}
return _rightPlusButton;
}
@end