新增按钮

This commit is contained in:
2025-12-22 21:16:38 +08:00
parent 6f336e8368
commit a477592f5d
4 changed files with 53 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "shop_goumai_icon@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "shop_goumai_icon@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@@ -15,6 +15,7 @@
#import "KBShopItemVC.h"
#import "KBSearchVC.h"
#import "MySkinVC.h"
#import "KBConsumptionRecordVC.h"
#import "KBWebViewViewController.h"
@@ -39,6 +40,7 @@ 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;
@@ -58,6 +60,7 @@ 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);
@@ -68,6 +71,12 @@ 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];
@@ -254,6 +263,11 @@ 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) {
@@ -272,6 +286,23 @@ 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];