2024-07-11 10:06:33 +08:00
|
|
|
|
//
|
|
|
|
|
// XPMineGameMateOrderView.m
|
|
|
|
|
// YuMi
|
|
|
|
|
//
|
|
|
|
|
// Created by P on 2024/7/9.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
#import "XPMineGameMateOrderView.h"
|
|
|
|
|
|
|
|
|
|
#import "XPIAPRechargeViewController.h"
|
|
|
|
|
#import "XCCurrentVCStackManager.h"
|
|
|
|
|
|
|
|
|
|
#import "XPMineGamePartnerInfoModel.h"
|
|
|
|
|
#import "Api.h"
|
|
|
|
|
#import "WalletInfoModel.h"
|
|
|
|
|
|
|
|
|
|
@interface XPMineGameMateOrderView ()
|
|
|
|
|
|
|
|
|
|
@property (nonatomic, assign) NSInteger round;
|
|
|
|
|
@property (nonatomic, assign) NSInteger currentCoin;
|
|
|
|
|
|
|
|
|
|
@property (nonatomic, strong) UIImageView *bgImageView;
|
|
|
|
|
@property (nonatomic, strong) NetImageView *logoImageView;
|
|
|
|
|
@property (nonatomic, strong) UIButton *reduceButton;
|
|
|
|
|
@property (nonatomic, strong) UILabel *numberLabel;
|
|
|
|
|
@property (nonatomic, strong) UIButton *increaseButton;
|
|
|
|
|
@property (nonatomic, strong) UILabel *priceLabel;
|
|
|
|
|
@property (nonatomic, strong) UILabel *balanceLabel;
|
|
|
|
|
@property (nonatomic, strong) UIButton *payButton;
|
|
|
|
|
@property (nonatomic, strong) UIButton *rechargeButton;
|
|
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
@implementation XPMineGameMateOrderView
|
|
|
|
|
|
|
|
|
|
- (instancetype)initWithFrame:(CGRect)frame
|
|
|
|
|
{
|
|
|
|
|
if (self = [super initWithFrame:frame]) {
|
|
|
|
|
self.round = 1;
|
|
|
|
|
[self setup];
|
|
|
|
|
[self getCoin];
|
|
|
|
|
}
|
|
|
|
|
return self;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)getCoin {
|
|
|
|
|
NSString * uid = [AccountInfoStorage instance].getUid;
|
|
|
|
|
NSString * ticket = [AccountInfoStorage instance].getTicket;
|
|
|
|
|
@kWeakify(self);
|
|
|
|
|
[Api getUserWalletInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
|
|
|
|
if (code == 200) {
|
|
|
|
|
@kStrongify(self);
|
|
|
|
|
WalletInfoModel * model = [WalletInfoModel modelWithDictionary:data.data];
|
2024-07-11 18:57:34 +08:00
|
|
|
|
self.currentCoin = model.diamonds.integerValue;
|
2024-07-11 10:06:33 +08:00
|
|
|
|
self.balanceLabel.text = @(self.currentCoin).stringValue;
|
|
|
|
|
[self updateBalanceContent];
|
|
|
|
|
}
|
|
|
|
|
} uid:uid ticket:ticket];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)setInfoModel:(XPMineGamePartnerInfoModel *)infoModel {
|
|
|
|
|
_infoModel = infoModel;
|
2024-07-11 18:57:34 +08:00
|
|
|
|
self.round = MAX(1, _infoModel.inning);
|
2024-07-11 10:06:33 +08:00
|
|
|
|
|
|
|
|
|
self.logoImageView.imageUrl = infoModel.pic;
|
2024-07-11 18:57:34 +08:00
|
|
|
|
self.numberLabel.text = @(self.round).stringValue;
|
2024-07-11 10:06:33 +08:00
|
|
|
|
[self updatePriceContent];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)updatePriceContent {
|
2024-07-11 18:57:34 +08:00
|
|
|
|
self.priceLabel.text = @(self.infoModel.price * self.round).stringValue;
|
2024-07-11 10:06:33 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)updateBalanceContent {
|
|
|
|
|
NSTextAttachment *coinAttachment = [[NSTextAttachment alloc] init];
|
2024-09-10 15:27:47 +08:00
|
|
|
|
coinAttachment.image = kImage(@"moli_money_icon");
|
2024-07-11 10:06:33 +08:00
|
|
|
|
coinAttachment.bounds = CGRectMake(2, -0.5, 10, 10);
|
|
|
|
|
NSAttributedString *coin = [NSAttributedString attributedStringWithAttachment:coinAttachment];
|
2024-07-12 15:53:11 +08:00
|
|
|
|
NSAttributedString *price = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@:%ld ", YMLocalizedString(@"GameOrderContent_21"),(long)self.currentCoin]
|
2024-07-11 10:06:33 +08:00
|
|
|
|
attributes:@{
|
|
|
|
|
NSFontAttributeName: self.balanceLabel.font,
|
|
|
|
|
NSForegroundColorAttributeName: self.balanceLabel.textColor
|
|
|
|
|
}];
|
|
|
|
|
NSMutableAttributedString *mutableAttributedString = [[NSMutableAttributedString alloc] initWithAttributedString:coin];
|
|
|
|
|
[mutableAttributedString insertAttributedString:price atIndex:0];
|
|
|
|
|
self.balanceLabel.attributedText = mutableAttributedString.copy;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)setup {
|
|
|
|
|
UIView *maskBG = [[UIView alloc] initWithFrame:self.bounds];
|
|
|
|
|
maskBG.backgroundColor = [UIColor colorWithWhite:0 alpha:0.6];
|
|
|
|
|
[self addSubview:maskBG];
|
|
|
|
|
|
|
|
|
|
[self addSubview:self.bgImageView];
|
|
|
|
|
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
2024-07-11 18:57:34 +08:00
|
|
|
|
make.size.mas_equalTo(CGSizeMake(KScreenWidth - 38*2, 280));
|
2024-07-11 10:06:33 +08:00
|
|
|
|
make.center.mas_equalTo(self);
|
|
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
UIImageView *closeImage = [[UIImageView alloc] initWithImage:kImage(@"noble_time_close")];
|
|
|
|
|
closeImage.userInteractionEnabled = YES;
|
|
|
|
|
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didTapCloseButton:)];
|
|
|
|
|
[closeImage addGestureRecognizer:tap];
|
|
|
|
|
[self addSubview:closeImage];
|
|
|
|
|
[closeImage mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
make.size.mas_equalTo(CGSizeMake(26, 26));
|
|
|
|
|
make.bottom.mas_equalTo(self.bgImageView.mas_top);
|
2024-07-30 20:16:21 +08:00
|
|
|
|
make.leading.mas_equalTo(self.bgImageView.mas_trailing);
|
2024-07-11 10:06:33 +08:00
|
|
|
|
}];
|
|
|
|
|
|
2024-07-11 18:57:34 +08:00
|
|
|
|
UILabel *titleLabel = [UILabel labelInitWithText:YMLocalizedString(@"GameOrderContent_5")
|
2024-07-11 10:06:33 +08:00
|
|
|
|
font:kFontBold(20)
|
|
|
|
|
textColor:UIColorFromRGB(0x563c1f)];
|
|
|
|
|
titleLabel.clipsToBounds = NO;
|
|
|
|
|
[self addSubview:titleLabel];
|
|
|
|
|
[titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
make.top.mas_equalTo(self.bgImageView).offset(24);
|
|
|
|
|
make.centerX.mas_equalTo(self.bgImageView);
|
|
|
|
|
make.height.mas_equalTo(20);
|
|
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
[self addSubview:self.logoImageView];
|
|
|
|
|
[self.logoImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
make.top.mas_equalTo(titleLabel.mas_bottom).offset(17.5);
|
|
|
|
|
make.centerX.mas_equalTo(self.bgImageView);
|
2024-07-11 18:57:34 +08:00
|
|
|
|
make.size.mas_equalTo(CGSizeMake(KScreenWidth - 38*4, 95));
|
2024-07-11 10:06:33 +08:00
|
|
|
|
}];
|
|
|
|
|
|
2024-07-11 18:57:34 +08:00
|
|
|
|
UILabel *subTitleLabel_1 = [UILabel labelInitWithText:YMLocalizedString(@"GameOrderContent_19") font:kFontMedium(14) textColor:UIColorFromRGB(0x3f3c33)];
|
|
|
|
|
UILabel *subTitleLabel_2 = [UILabel labelInitWithText:YMLocalizedString(@"GameOrderContent_7") font:kFontMedium(14) textColor:UIColorFromRGB(0x3f3c33)];
|
2024-07-11 10:06:33 +08:00
|
|
|
|
UIStackView *subTitleStack = [[UIStackView alloc] init];
|
|
|
|
|
subTitleStack.axis = UILayoutConstraintAxisVertical;
|
|
|
|
|
subTitleStack.alignment = UIStackViewAlignmentTop;
|
|
|
|
|
subTitleStack.distribution = UIStackViewDistributionEqualSpacing;
|
2024-07-12 15:53:11 +08:00
|
|
|
|
subTitleStack.spacing = 10;
|
2024-07-11 10:06:33 +08:00
|
|
|
|
[subTitleStack addArrangedSubview:subTitleLabel_1];
|
|
|
|
|
[subTitleStack addArrangedSubview:subTitleLabel_2];
|
|
|
|
|
[self addSubview:subTitleStack];
|
|
|
|
|
[subTitleStack mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
make.top.mas_equalTo(self.logoImageView.mas_bottom).offset(19);
|
2024-07-30 20:16:21 +08:00
|
|
|
|
make.leading.mas_equalTo(self.logoImageView);
|
2024-07-11 10:06:33 +08:00
|
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
[self addSubview:self.increaseButton];
|
|
|
|
|
[self.increaseButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
make.top.mas_equalTo(self.logoImageView.mas_bottom).offset(15);
|
|
|
|
|
make.size.mas_equalTo(CGSizeMake(23, 23));
|
2024-07-30 20:16:21 +08:00
|
|
|
|
make.trailing.mas_equalTo(self.logoImageView);
|
2024-07-11 10:06:33 +08:00
|
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
[self addSubview:self.numberLabel];
|
|
|
|
|
[self.numberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
make.centerY.mas_equalTo(self.increaseButton);
|
2024-07-30 20:16:21 +08:00
|
|
|
|
make.trailing.mas_equalTo(self.increaseButton.mas_leading).offset(-12.5);
|
2024-07-11 10:06:33 +08:00
|
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
[self addSubview:self.reduceButton];
|
|
|
|
|
[self.reduceButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
make.top.mas_equalTo(self.logoImageView.mas_bottom).offset(15);
|
|
|
|
|
make.size.mas_equalTo(CGSizeMake(23, 23));
|
2024-07-30 20:16:21 +08:00
|
|
|
|
make.trailing.mas_equalTo(self.numberLabel.mas_leading).offset(-12.5);
|
2024-07-11 10:06:33 +08:00
|
|
|
|
}];
|
|
|
|
|
|
2024-07-11 18:57:34 +08:00
|
|
|
|
UIStackView *priceStack = [[UIStackView alloc] init];
|
|
|
|
|
priceStack.spacing = 1;
|
|
|
|
|
priceStack.distribution = UIStackViewDistributionFill;
|
|
|
|
|
priceStack.alignment = UIStackViewAlignmentCenter;
|
|
|
|
|
|
2024-09-10 15:27:47 +08:00
|
|
|
|
UIImageView *coinIcon = [[UIImageView alloc] initWithImage:kImage(@"moli_money_icon")];
|
2024-07-11 18:57:34 +08:00
|
|
|
|
coinIcon.frame = CGRectMake(0, 0, 12, 12);
|
|
|
|
|
[priceStack addArrangedSubview:self.priceLabel];
|
|
|
|
|
[priceStack addArrangedSubview:coinIcon];
|
|
|
|
|
[self addSubview:priceStack];
|
|
|
|
|
[priceStack mas_makeConstraints:^(MASConstraintMaker *make) {
|
2024-07-11 10:06:33 +08:00
|
|
|
|
make.centerX.mas_equalTo(self.numberLabel);
|
|
|
|
|
make.top.mas_equalTo(self.increaseButton.mas_bottom).offset(12);
|
|
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
UIImageView *line = [[UIImageView alloc] initWithImage:kImage(@"mine_game_order_line")];
|
|
|
|
|
[self addSubview:line];
|
|
|
|
|
[line mas_makeConstraints:^(MASConstraintMaker *make) {
|
2024-07-30 20:16:21 +08:00
|
|
|
|
make.leading.trailing.mas_equalTo(self.logoImageView);
|
2024-07-11 18:57:34 +08:00
|
|
|
|
make.height.mas_equalTo(0.5);
|
2024-07-11 10:06:33 +08:00
|
|
|
|
make.bottom.mas_equalTo(self.bgImageView).offset(-46);
|
|
|
|
|
make.top.mas_equalTo(self.priceLabel.mas_bottom).offset(15);
|
|
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
[self addSubview:self.balanceLabel];
|
|
|
|
|
[self.balanceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
make.top.mas_equalTo(line.mas_bottom).offset(15);
|
2024-07-30 20:16:21 +08:00
|
|
|
|
make.leading.mas_equalTo(self.logoImageView);
|
2024-07-11 10:06:33 +08:00
|
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
[self addSubview:self.rechargeButton];
|
2024-07-11 18:57:34 +08:00
|
|
|
|
[self addSubview:self.payButton];
|
|
|
|
|
|
2024-07-11 10:06:33 +08:00
|
|
|
|
[self.rechargeButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
make.centerY.mas_equalTo(self.balanceLabel);
|
2024-07-30 20:16:21 +08:00
|
|
|
|
make.leading.mas_equalTo(self.balanceLabel.mas_trailing).offset(8.5);
|
2024-07-11 10:06:33 +08:00
|
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
[self.payButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
make.centerY.mas_equalTo(self.balanceLabel);
|
|
|
|
|
make.size.mas_equalTo(CGSizeMake(65, 26));
|
2024-07-30 20:16:21 +08:00
|
|
|
|
make.trailing.mas_equalTo(self.logoImageView);
|
2024-07-11 10:06:33 +08:00
|
|
|
|
}];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (IBAction)didTapReduceButton:(id)sender {
|
|
|
|
|
self.round--;
|
|
|
|
|
if (self.round<1) {
|
|
|
|
|
self.round = 1;
|
|
|
|
|
}
|
2024-07-12 15:53:11 +08:00
|
|
|
|
self.reduceButton.enabled = self.round >= 1;
|
2024-07-11 10:06:33 +08:00
|
|
|
|
self.numberLabel.text = @(self.round).stringValue;
|
|
|
|
|
[self updatePriceContent];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (IBAction)didTapIncreaseButton:(id)sender {
|
|
|
|
|
self.round ++;
|
|
|
|
|
self.numberLabel.text = @(self.round).stringValue;
|
2024-07-12 15:53:11 +08:00
|
|
|
|
self.reduceButton.enabled = self.round >= 1;
|
2024-07-11 10:06:33 +08:00
|
|
|
|
[self updatePriceContent];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (IBAction)didTapRechargeButton:(id)sender {
|
|
|
|
|
XPIAPRechargeViewController *vc = [[XPIAPRechargeViewController alloc] init];
|
|
|
|
|
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:vc animated:YES];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (IBAction)didTapPayButton:(id)sender {
|
|
|
|
|
if (self.payForGame) {
|
|
|
|
|
self.payForGame(self.round);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (IBAction)didTapCloseButton:(id)sender {
|
|
|
|
|
[self removeFromSuperview];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#pragma mark -
|
|
|
|
|
- (UIImageView *)bgImageView {
|
|
|
|
|
if (!_bgImageView) {
|
|
|
|
|
_bgImageView = [[UIImageView alloc] initWithImage:[kImage(@"mine_game_order_bg") ms_SetImageForRTL]];
|
|
|
|
|
_bgImageView.contentMode = UIViewContentModeScaleAspectFill;
|
|
|
|
|
}
|
|
|
|
|
return _bgImageView;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (NetImageView *)logoImageView {
|
|
|
|
|
if (!_logoImageView) {
|
|
|
|
|
NetImageConfig * config = [[NetImageConfig alloc] init];
|
2024-07-12 14:07:53 +08:00
|
|
|
|
config.placeHolder = [UIImageConstant defaultBannerPlaceholder];
|
2024-07-11 10:06:33 +08:00
|
|
|
|
_logoImageView = [[NetImageView alloc] initWithConfig:config];
|
|
|
|
|
_logoImageView.contentMode = UIViewContentModeScaleAspectFill;
|
|
|
|
|
_logoImageView.layer.masksToBounds = YES;
|
|
|
|
|
_logoImageView.layer.cornerRadius = 8;
|
2024-07-12 14:07:53 +08:00
|
|
|
|
_logoImageView.layer.borderWidth = 2;
|
|
|
|
|
_logoImageView.layer.borderColor = UIColorFromRGB(0xf09540).CGColor;
|
|
|
|
|
|
2024-07-11 10:06:33 +08:00
|
|
|
|
_logoImageView.backgroundColor = [UIColor systemTealColor];
|
|
|
|
|
}
|
|
|
|
|
return _logoImageView;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (UIButton *)reduceButton {
|
|
|
|
|
if (!_reduceButton) {
|
|
|
|
|
_reduceButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
2024-07-12 15:53:11 +08:00
|
|
|
|
_reduceButton.enabled = NO;
|
2024-07-11 10:06:33 +08:00
|
|
|
|
[_reduceButton addTarget:self action:@selector(didTapReduceButton:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
|
|
[_reduceButton setImage:kImage(@"mine_game_order_reduce_icon") forState:UIControlStateNormal];
|
2024-07-12 15:53:11 +08:00
|
|
|
|
[_reduceButton setImage:kImage(@"mine_game_order_reduce_icon_disable") forState:UIControlStateDisabled];
|
2024-07-11 10:06:33 +08:00
|
|
|
|
[_reduceButton enlargeTouchArea:UIEdgeInsetsMake(10, 10, 10, 10)];
|
|
|
|
|
}
|
|
|
|
|
return _reduceButton;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (UIButton *)increaseButton {
|
|
|
|
|
if (!_increaseButton) {
|
|
|
|
|
_increaseButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
|
|
|
[_increaseButton addTarget:self action:@selector(didTapIncreaseButton:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
|
|
[_increaseButton setImage:kImage(@"mine_game_order_increase_icon") forState:UIControlStateNormal];
|
|
|
|
|
[_reduceButton enlargeTouchArea:UIEdgeInsetsMake(10, 10, 10, 10)];
|
|
|
|
|
}
|
|
|
|
|
return _increaseButton;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (UILabel *)numberLabel {
|
|
|
|
|
if (!_numberLabel) {
|
|
|
|
|
_numberLabel = [UILabel labelInitWithText:@"1"
|
|
|
|
|
font:kFontMedium(13)
|
|
|
|
|
textColor:UIColorFromRGB(0x471606)];
|
|
|
|
|
}
|
|
|
|
|
return _numberLabel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (UILabel *)priceLabel {
|
|
|
|
|
if (!_priceLabel) {
|
|
|
|
|
_priceLabel = [UILabel labelInitWithText:@"0"
|
|
|
|
|
font:kFontMedium(13)
|
|
|
|
|
textColor:UIColorFromRGB(0x471606)];
|
2024-07-11 18:57:34 +08:00
|
|
|
|
[_priceLabel setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
|
|
|
|
|
[_priceLabel setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
|
2024-07-11 10:06:33 +08:00
|
|
|
|
}
|
|
|
|
|
return _priceLabel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (UILabel *)balanceLabel {
|
|
|
|
|
if (!_balanceLabel) {
|
2024-07-11 18:57:34 +08:00
|
|
|
|
_balanceLabel = [UILabel labelInitWithText:YMLocalizedString(@"GameOrderContent_21")
|
2024-07-11 10:06:33 +08:00
|
|
|
|
font:kFontMedium(12)
|
|
|
|
|
textColor:UIColorFromRGB(0x471606)];
|
|
|
|
|
}
|
|
|
|
|
return _balanceLabel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (UIButton *)rechargeButton {
|
|
|
|
|
if (!_rechargeButton) {
|
|
|
|
|
_rechargeButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
2024-07-11 18:57:34 +08:00
|
|
|
|
[_rechargeButton setTitle:[NSString stringWithFormat:@"%@ >", YMLocalizedString(@"XPGiftBarView1")] forState:UIControlStateNormal];
|
2024-07-11 10:06:33 +08:00
|
|
|
|
[_rechargeButton.titleLabel setFont:kFontMedium(12)];
|
|
|
|
|
[_rechargeButton setTitleColor:UIColorFromRGB(0xff433a) forState:UIControlStateNormal];
|
|
|
|
|
[_rechargeButton addTarget:self
|
|
|
|
|
action:@selector(didTapRechargeButton:)
|
|
|
|
|
forControlEvents:UIControlEventTouchUpInside];
|
2024-07-11 18:57:34 +08:00
|
|
|
|
_rechargeButton.titleLabel.adjustsFontSizeToFitWidth = YES;
|
|
|
|
|
_rechargeButton.titleLabel.minimumScaleFactor = 0.5; // 最小缩放比例
|
2024-07-11 10:06:33 +08:00
|
|
|
|
}
|
|
|
|
|
return _rechargeButton;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (UIButton *)payButton {
|
|
|
|
|
if (!_payButton) {
|
|
|
|
|
_payButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
2024-07-11 18:57:34 +08:00
|
|
|
|
[_payButton setTitle:YMLocalizedString(@"GameOrderContent_22") forState:UIControlStateNormal];
|
2024-07-11 10:06:33 +08:00
|
|
|
|
UIImage *image = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0x57e193),UIColorFromRGB(0x14d2a6)]
|
|
|
|
|
gradientType:GradientTypeLeftToRight
|
|
|
|
|
imgSize:CGSizeMake(65, 26)];
|
|
|
|
|
[_payButton setBackgroundImage:image forState:UIControlStateNormal];
|
|
|
|
|
[_payButton.titleLabel setFont:kFontMedium(13)];
|
|
|
|
|
[_payButton addTarget:self
|
|
|
|
|
action:@selector(didTapPayButton:)
|
|
|
|
|
forControlEvents:UIControlEventTouchUpInside];
|
|
|
|
|
_payButton.layer.cornerRadius = 13;
|
|
|
|
|
_payButton.layer.masksToBounds = YES;
|
|
|
|
|
}
|
|
|
|
|
return _payButton;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@end
|