处理按钮
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user