From 8e4d7e1ee8396975dd01215800379f6774a5d267 Mon Sep 17 00:00:00 2001 From: CodeST <694468528@qq.com> Date: Tue, 23 Dec 2025 14:15:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- keyBoard/Class/Shop/V/KBShopHeadView.m | 32 +++++++++++++++++++++++ keyBoard/Class/Shop/VC/KBShopVC.m | 36 ++------------------------ 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/keyBoard/Class/Shop/V/KBShopHeadView.m b/keyBoard/Class/Shop/V/KBShopHeadView.m index eb57e1d..dc71ab6 100644 --- a/keyBoard/Class/Shop/V/KBShopHeadView.m +++ b/keyBoard/Class/Shop/V/KBShopHeadView.m @@ -9,6 +9,7 @@ #import "KBJfPay.h" #import "UIImageView+KBWebImage.h" #import "KBShopThemeDetailModel.h" +#import "KBConsumptionRecordVC.h" @interface KBShopHeadView () @@ -34,6 +35,7 @@ @property (nonatomic, strong) UIImageView *smallCoinView; // 左侧小金币:shop_jb_icon @property (nonatomic, strong) UILabel *amountLabel; // 数字 88.00 @property (nonatomic, strong) UIButton *rechargeButton; // 充值按钮:recharge_btn_bg +@property (nonatomic, strong) UIButton *recordButton; // 消费记录按钮 @end @@ -52,6 +54,7 @@ [self.containerView addSubview:self.greenStarView]; [self.containerView addSubview:self.greenStarView2]; [self.containerView addSubview:self.greenStarView3]; + [self.containerView addSubview:self.recordButton]; [self.containerView addSubview:self.infoCard]; [self.infoCard addSubview:self.myPointsLabel]; [self.infoCard addSubview:self.smallCoinView]; @@ -66,6 +69,13 @@ make.bottom.equalTo(self); }]; + [self.recordButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.equalTo(self.containerView); + make.top.equalTo(self.containerView).offset(KB_NAV_TOTAL_HEIGHT - 25); + make.height.mas_equalTo(32); + make.width.mas_greaterThanOrEqualTo(136); + }]; + // 左侧标题 [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.containerView).offset(32); @@ -191,6 +201,11 @@ [KB_CURRENT_NAV pushViewController:vc animated:true]; } +- (void)onRecordButtonTappedAction { + KBConsumptionRecordVC *vc = [[KBConsumptionRecordVC alloc] init]; + [KB_CURRENT_NAV pushViewController:vc animated:true]; +} + #pragma mark - Lazy UI - (UIView *)containerView { if (!_containerView) { @@ -324,4 +339,21 @@ return _rechargeButton; } +- (UIButton *)recordButton { + if (!_recordButton) { + _recordButton = [UIButton buttonWithType:UIButtonTypeCustom]; + _recordButton.backgroundColor = [UIColor colorWithHex:0xE8FFFD]; + _recordButton.layer.cornerRadius = 8; + _recordButton.layer.masksToBounds = YES; + [_recordButton setImage:[UIImage imageNamed:@"shop_goumai_icon"] forState:UIControlStateNormal]; + [_recordButton setTitle:KBLocalized(@"Consumption Record") forState:UIControlStateNormal]; + [_recordButton setTitleColor:[UIColor colorWithHex:KBColorValue] forState:UIControlStateNormal]; + _recordButton.titleLabel.font = [KBFont medium:12]; + _recordButton.contentEdgeInsets = UIEdgeInsetsMake(0, 10, 0, 12); + _recordButton.titleEdgeInsets = UIEdgeInsetsMake(0, 6, 0, -6); + [_recordButton addTarget:self action:@selector(onRecordButtonTappedAction) forControlEvents:UIControlEventTouchUpInside]; + } + return _recordButton; +} + @end diff --git a/keyBoard/Class/Shop/VC/KBShopVC.m b/keyBoard/Class/Shop/VC/KBShopVC.m index 37d40f8..a81fef1 100644 --- a/keyBoard/Class/Shop/VC/KBShopVC.m +++ b/keyBoard/Class/Shop/VC/KBShopVC.m @@ -15,7 +15,6 @@ #import "KBShopItemVC.h" #import "KBSearchVC.h" #import "MySkinVC.h" -#import "KBConsumptionRecordVC.h" #import "KBWebViewViewController.h" @@ -40,7 +39,6 @@ static const CGFloat JXheightForHeaderInSection = 50; @property (nonatomic, strong) UIImageView *bgImageView; // 全屏背景图 @property (nonatomic, strong) UIButton *searchBtn; @property (nonatomic, strong) UIButton *skinBtn; -@property (nonatomic, strong) UIButton *recordButton; // 记录当前分类条是否为白底,避免重复设置 @property (nonatomic, assign) BOOL categoryIsWhite; @property (nonatomic, strong) KBShopVM *shopVM; @@ -60,7 +58,6 @@ static const CGFloat JXheightForHeaderInSection = 50; [self setupUI]; [self.view addSubview:self.skinBtn]; [self.view addSubview:self.searchBtn]; - [self.view addSubview:self.recordButton]; [self.skinBtn mas_makeConstraints:^(MASConstraintMaker *make) { make.right.equalTo(self.view).offset(-16); make.top.mas_equalTo(KB_NAV_TOTAL_HEIGHT - 25); @@ -71,12 +68,6 @@ static const CGFloat JXheightForHeaderInSection = 50; make.top.equalTo(self.skinBtn); make.width.height.mas_equalTo(25); }]; - [self.recordButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerY.equalTo(self.skinBtn); - make.left.equalTo(self.view).offset(14); - make.height.mas_equalTo(32); - make.width.mas_greaterThanOrEqualTo(136); - }]; [self fetchShopStylesWithHUD:YES]; @@ -117,9 +108,8 @@ static const CGFloat JXheightForHeaderInSection = 50; self.categoryView.cellBackgroundColorGradientEnabled = YES; self.categoryView.cellBackgroundUnselectedColor = [UIColor colorWithHex:0xEFEFEF]; self.categoryView.cellBackgroundSelectedColor = [UIColor whiteColor]; - // Make the pills look compact - self.categoryView.cellWidthIncrement = 20; // horizontal padding for each item - self.categoryView.cellSpacing = 12; // spacing between items + self.categoryView.cellWidthIncrement = 20; + self.categoryView.cellSpacing = 12; self.categoryView.contentEdgeInsetLeft = 16; self.categoryView.contentEdgeInsetRight = 16; self.categoryView.averageCellSpacingEnabled = NO; @@ -263,11 +253,6 @@ static const CGFloat JXheightForHeaderInSection = 50; [self.navigationController pushViewController:vc animated:true]; } -- (void)recordButtonAction{ - KBConsumptionRecordVC *vc = [[KBConsumptionRecordVC alloc] init]; - [self.navigationController pushViewController:vc animated:true]; -} - #pragma mark - lazy - (UIButton *)searchBtn{ if (!_searchBtn) { @@ -286,23 +271,6 @@ static const CGFloat JXheightForHeaderInSection = 50; return _skinBtn; } -- (UIButton *)recordButton{ - if (!_recordButton) { - _recordButton = [UIButton buttonWithType:UIButtonTypeCustom]; - _recordButton.backgroundColor = [UIColor colorWithHex:0xE8FFFD]; - _recordButton.layer.cornerRadius = 8; - _recordButton.layer.masksToBounds = YES; - [_recordButton setImage:[UIImage imageNamed:@"shop_goumai_icon"] forState:UIControlStateNormal]; - [_recordButton setTitle:KBLocalized(@"Consumption Record") forState:UIControlStateNormal]; - [_recordButton setTitleColor:[UIColor colorWithHex:KBColorValue] forState:UIControlStateNormal]; - _recordButton.titleLabel.font = [KBFont medium:12]; - _recordButton.contentEdgeInsets = UIEdgeInsetsMake(0, 10, 0, 12); - _recordButton.titleEdgeInsets = UIEdgeInsetsMake(0, 6, 0, -6); - [_recordButton addTarget:self action:@selector(recordButtonAction) forControlEvents:UIControlEventTouchUpInside]; - } - return _recordButton; -} - - (KBShopVM *)shopVM { if (!_shopVM) { _shopVM = [[KBShopVM alloc] init];