This commit is contained in:
2026-02-04 14:59:02 +08:00
parent 879dbb860c
commit e50eaecbd9
39 changed files with 360 additions and 75 deletions

View File

@@ -8,6 +8,8 @@
#import "KBSvipBenefitCell.h"
@interface KBSvipBenefitCell ()
@property (nonatomic, strong) UIView *coverView; //
@property (nonatomic, strong) UIImageView *iconView; //
@property (nonatomic, strong) UILabel *titleLabel; //
@property (nonatomic, strong) UIImageView *checkView; //
@@ -18,26 +20,33 @@
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
self.contentView.backgroundColor = [UIColor clearColor];
[self.contentView addSubview:self.coverView];
[self.contentView addSubview:self.iconView];
[self.contentView addSubview:self.titleLabel];
[self.contentView addSubview:self.checkView];
[self.coverView addSubview:self.titleLabel];
[self.coverView addSubview:self.checkView];
[self.coverView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(self.contentView).inset(8);
make.centerY.equalTo(self.contentView);
make.height.mas_equalTo(46);
}];
[self.iconView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.contentView).offset(16);
make.centerY.equalTo(self.contentView);
make.width.height.mas_equalTo(40);
make.left.equalTo(self.coverView).offset(16);
make.top.equalTo(self.contentView);
make.width.height.mas_equalTo(38);
}];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.iconView.mas_right).offset(12);
make.centerY.equalTo(self.contentView);
make.centerY.equalTo(self.coverView);
make.right.lessThanOrEqualTo(self.checkView.mas_left).offset(-12);
}];
[self.checkView mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.contentView).offset(-16);
make.centerY.equalTo(self.contentView);
make.right.equalTo(self.coverView).offset(-16);
make.centerY.equalTo(self.coverView);
make.width.height.mas_equalTo(20);
}];
}
@@ -75,14 +84,20 @@
if (!_checkView) {
_checkView = [UIImageView new];
_checkView.contentMode = UIViewContentModeScaleAspectFit;
// 使 SF Symbol
if (@available(iOS 13.0, *)) {
UIImageSymbolConfiguration *config = [UIImageSymbolConfiguration configurationWithWeight:UIImageSymbolWeightMedium];
_checkView.image = [UIImage systemImageNamed:@"checkmark" withConfiguration:config];
}
_checkView.tintColor = [UIColor colorWithHex:KBColorValue];
_checkView.image = [UIImage imageNamed:@"pay_oks_icon"];
}
return _checkView;
}
- (UIView *)coverView{
if (!_coverView) {
_coverView = [[UIView alloc] init];
_coverView.backgroundColor = [UIColor whiteColor];
_coverView.layer.cornerRadius = 8;
_coverView.layer.masksToBounds = true;
}
return _coverView;
}
@end