充值UI的修改

This commit is contained in:
fengshuo
2022-06-10 15:30:12 +08:00
committed by liyuhua
parent 39412ed46b
commit cf21da1cc4
18 changed files with 48 additions and 298 deletions

View File

@@ -1138,7 +1138,6 @@
E8B846C226FD82DC00A777FE /* XPMineUserInfoAlbumCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8B846C126FD82DC00A777FE /* XPMineUserInfoAlbumCollectionViewCell.m */; }; E8B846C226FD82DC00A777FE /* XPMineUserInfoAlbumCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8B846C126FD82DC00A777FE /* XPMineUserInfoAlbumCollectionViewCell.m */; };
E8B846C526FDB41A00A777FE /* XPMineUserInfolbumPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E8B846C426FDB41A00A777FE /* XPMineUserInfolbumPresenter.m */; }; E8B846C526FDB41A00A777FE /* XPMineUserInfolbumPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E8B846C426FDB41A00A777FE /* XPMineUserInfolbumPresenter.m */; };
E8B846C726FDB45000A777FE /* XPMineUserInfoAlbumProtocol.h in Sources */ = {isa = PBXBuildFile; fileRef = E8B846C626FDB44100A777FE /* XPMineUserInfoAlbumProtocol.h */; }; E8B846C726FDB45000A777FE /* XPMineUserInfoAlbumProtocol.h in Sources */ = {isa = PBXBuildFile; fileRef = E8B846C626FDB44100A777FE /* XPMineUserInfoAlbumProtocol.h */; };
E8B846CF26FDD96100A777FE /* XPMineRechageHeadView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8B846CE26FDD96100A777FE /* XPMineRechageHeadView.m */; };
E8B846D326FDDBE600A777FE /* XPMineRechargeTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8B846D226FDDBE600A777FE /* XPMineRechargeTableViewCell.m */; }; E8B846D326FDDBE600A777FE /* XPMineRechargeTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8B846D226FDDBE600A777FE /* XPMineRechargeTableViewCell.m */; };
E8B846D626FDE01B00A777FE /* XPMineRechargePresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E8B846D526FDE01B00A777FE /* XPMineRechargePresenter.m */; }; E8B846D626FDE01B00A777FE /* XPMineRechargePresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E8B846D526FDE01B00A777FE /* XPMineRechargePresenter.m */; };
E8B846D826FDE17300A777FE /* XPMineRechargeProtocol.h in Sources */ = {isa = PBXBuildFile; fileRef = E8B846D726FDE16300A777FE /* XPMineRechargeProtocol.h */; }; E8B846D826FDE17300A777FE /* XPMineRechargeProtocol.h in Sources */ = {isa = PBXBuildFile; fileRef = E8B846D726FDE16300A777FE /* XPMineRechargeProtocol.h */; };
@@ -3457,8 +3456,6 @@
E8B846C326FDB41A00A777FE /* XPMineUserInfolbumPresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineUserInfolbumPresenter.h; sourceTree = "<group>"; }; E8B846C326FDB41A00A777FE /* XPMineUserInfolbumPresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineUserInfolbumPresenter.h; sourceTree = "<group>"; };
E8B846C426FDB41A00A777FE /* XPMineUserInfolbumPresenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineUserInfolbumPresenter.m; sourceTree = "<group>"; }; E8B846C426FDB41A00A777FE /* XPMineUserInfolbumPresenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineUserInfolbumPresenter.m; sourceTree = "<group>"; };
E8B846C626FDB44100A777FE /* XPMineUserInfoAlbumProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineUserInfoAlbumProtocol.h; sourceTree = "<group>"; }; E8B846C626FDB44100A777FE /* XPMineUserInfoAlbumProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineUserInfoAlbumProtocol.h; sourceTree = "<group>"; };
E8B846CD26FDD96100A777FE /* XPMineRechageHeadView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineRechageHeadView.h; sourceTree = "<group>"; };
E8B846CE26FDD96100A777FE /* XPMineRechageHeadView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineRechageHeadView.m; sourceTree = "<group>"; };
E8B846D126FDDBE600A777FE /* XPMineRechargeTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineRechargeTableViewCell.h; sourceTree = "<group>"; }; E8B846D126FDDBE600A777FE /* XPMineRechargeTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineRechargeTableViewCell.h; sourceTree = "<group>"; };
E8B846D226FDDBE600A777FE /* XPMineRechargeTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineRechargeTableViewCell.m; sourceTree = "<group>"; }; E8B846D226FDDBE600A777FE /* XPMineRechargeTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineRechargeTableViewCell.m; sourceTree = "<group>"; };
E8B846D426FDE01B00A777FE /* XPMineRechargePresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineRechargePresenter.h; sourceTree = "<group>"; }; E8B846D426FDE01B00A777FE /* XPMineRechargePresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineRechargePresenter.h; sourceTree = "<group>"; };
@@ -8455,17 +8452,6 @@
path = UploadImage; path = UploadImage;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
E8B846CC26FDD93D00A777FE /* Recharge */ = {
isa = PBXGroup;
children = (
E8B846CD26FDD96100A777FE /* XPMineRechageHeadView.h */,
E8B846CE26FDD96100A777FE /* XPMineRechageHeadView.m */,
E89DA67327009ACD008483C1 /* XPMineRechargeNavView.h */,
E89DA67427009ACD008483C1 /* XPMineRechargeNavView.m */,
);
path = Recharge;
sourceTree = "<group>";
};
E8B846D026FDDBCD00A777FE /* Recharge */ = { E8B846D026FDDBCD00A777FE /* Recharge */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
@@ -9362,7 +9348,6 @@
children = ( children = (
E8C219F62948525500344FC5 /* AnchorLevel */, E8C219F62948525500344FC5 /* AnchorLevel */,
9BBC02882786E0060007C24B /* NobleCenter */, 9BBC02882786E0060007C24B /* NobleCenter */,
E8B846CC26FDD93D00A777FE /* Recharge */,
E88B5CC226FB429C00DA9178 /* MineInfo */, E88B5CC226FB429C00DA9178 /* MineInfo */,
E88B5CAA26FB168200DA9178 /* Teenager */, E88B5CAA26FB168200DA9178 /* Teenager */,
E8E70D8126F2F51A00F03460 /* XPMineHeadView.h */, E8E70D8126F2F51A00F03460 /* XPMineHeadView.h */,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 321 B

After

Width:  |  Height:  |  Size: 320 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 502 B

After

Width:  |  Height:  |  Size: 459 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 468 B

After

Width:  |  Height:  |  Size: 520 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 732 B

After

Width:  |  Height:  |  Size: 804 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 136 KiB

View File

@@ -14,7 +14,7 @@
///Model ///Model
#import "EnterpriseRechargeListInfoModel.h" #import "EnterpriseRechargeListInfoModel.h"
///View ///View
#import "XPEnterpriseChargeListCollectionViewCell.h" #import "XPEnterpriseHalfCollectionViewCell.h"
#import "XPEnterpriseRechargeHeaderView.h" #import "XPEnterpriseRechargeHeaderView.h"
@interface XPEnterpriseChargeListTableViewCell ()<UICollectionViewDelegate, UICollectionViewDataSource> @interface XPEnterpriseChargeListTableViewCell ()<UICollectionViewDelegate, UICollectionViewDataSource>
@@ -24,6 +24,8 @@
@property (nonatomic,strong) XPEnterpriseRechargeHeaderView *infoView; @property (nonatomic,strong) XPEnterpriseRechargeHeaderView *infoView;
/// ///
@property (nonatomic,strong) UICollectionView *collectionView; @property (nonatomic,strong) UICollectionView *collectionView;
///
@property (nonatomic,strong) UILabel *titleLabel;
/// ///
@property (nonatomic,strong) EnterpriseRechargeInfoModel *selectInfo; @property (nonatomic,strong) EnterpriseRechargeInfoModel *selectInfo;
@end @end
@@ -44,22 +46,31 @@
[self.contentView addSubview:self.backImageView]; [self.contentView addSubview:self.backImageView];
[self.contentView addSubview:self.infoView]; [self.contentView addSubview:self.infoView];
[self.contentView addSubview:self.collectionView]; [self.contentView addSubview:self.collectionView];
[self.contentView addSubview:self.titleLabel];
} }
- (void)initSubViewConstraints { - (void)initSubViewConstraints {
CGFloat kscale = 260.0/ 375.0;
[self.backImageView mas_makeConstraints:^(MASConstraintMaker *make) { [self.backImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.top.left.mas_equalTo(self); make.left.right.top.mas_equalTo(self);
make.height.mas_equalTo(250); make.height.mas_equalTo(KScreenWidth * kscale);
}]; }];
[self.infoView mas_makeConstraints:^(MASConstraintMaker *make) { [self.infoView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.top.mas_equalTo(self.contentView); make.centerX.mas_equalTo(self);
make.height.mas_equalTo(190 + kSafeAreaTopHeight); make.width.mas_equalTo(375);
make.top.mas_equalTo(self).offset(92);
make.height.mas_equalTo(106);
}]; }];
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) { [self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.infoView.mas_bottom); make.top.mas_equalTo(self.infoView.mas_bottom).offset(15);
make.left.right.mas_equalTo(self.contentView); make.left.right.mas_equalTo(self.contentView);
make.bottom.mas_equalTo(self.titleLabel.mas_top).offset(-12);
}];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.mas_equalTo(self.contentView).inset(30);
make.bottom.mas_equalTo(self.contentView).offset(-15); make.bottom.mas_equalTo(self.contentView).offset(-15);
}]; }];
} }
@@ -69,7 +80,7 @@
} }
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { - (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
XPEnterpriseChargeListCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPEnterpriseChargeListCollectionViewCell class]) forIndexPath:indexPath]; XPEnterpriseHalfCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPEnterpriseHalfCollectionViewCell class]) forIndexPath:indexPath];
EnterpriseRechargeInfoModel * info = [self.rechargeList objectAtIndex:indexPath.row]; EnterpriseRechargeInfoModel * info = [self.rechargeList objectAtIndex:indexPath.row];
if ([info.chargeProdId isEqualToString:self.selectInfo.chargeProdId]) { if ([info.chargeProdId isEqualToString:self.selectInfo.chargeProdId]) {
info.isSelect = YES; info.isSelect = YES;
@@ -112,16 +123,16 @@
- (UICollectionView *)collectionView{ - (UICollectionView *)collectionView{
if (!_collectionView) { if (!_collectionView) {
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
layout.itemSize = CGSizeMake((CGFloat)(KScreenWidth - 15 * 2 - 10 * 2) / 3.0, 80); layout.itemSize = CGSizeMake((CGFloat)(KScreenWidth - 15 * 2 - 8 * 2 - 3) / 3.0, 64);
layout.sectionInset = UIEdgeInsetsMake(0, 15, 0, 15); layout.sectionInset = UIEdgeInsetsMake(0, 15, 0, 15);
layout.minimumLineSpacing = 10; layout.minimumLineSpacing = 8;
layout.minimumInteritemSpacing = 10; layout.minimumInteritemSpacing = 8;
_collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout]; _collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
_collectionView.dataSource = self; _collectionView.dataSource = self;
_collectionView.delegate = self; _collectionView.delegate = self;
_collectionView.backgroundColor = [UIColor clearColor]; _collectionView.backgroundColor = [UIColor clearColor];
_collectionView.scrollEnabled = NO; _collectionView.scrollEnabled = NO;
[_collectionView registerClass:[XPEnterpriseChargeListCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([XPEnterpriseChargeListCollectionViewCell class])]; [_collectionView registerClass:[XPEnterpriseHalfCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([XPEnterpriseHalfCollectionViewCell class])];
} }
return _collectionView; return _collectionView;
} }
@@ -144,4 +155,16 @@
return _backImageView; return _backImageView;
} }
- (UILabel *)titleLabel {
if (!_titleLabel) {
_titleLabel = [[UILabel alloc] init];
_titleLabel.font = [UIFont systemFontOfSize:14];
_titleLabel.textColor = [ThemeColor secondTextColor];
_titleLabel.text = @"未成年禁止充值消费!请勿轻易相信各类刷单、退款等信息,以免上当受骗!";
_titleLabel.numberOfLines = 2;
_titleLabel.textAlignment = NSTextAlignmentCenter;
}
return _titleLabel;
}
@end @end

View File

@@ -57,7 +57,7 @@
}]; }];
[self.coinLabel mas_makeConstraints:^(MASConstraintMaker *make) { [self.coinLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.backView.mas_centerX).offset(11); make.centerX.mas_equalTo(self.backView.mas_centerX).offset(11);
make.bottom.mas_equalTo(self.backView.mas_centerY).offset(-1.5); make.bottom.mas_equalTo(self.backView.mas_centerY).offset(-1.5);
}]; }];

View File

@@ -87,7 +87,7 @@
_privacyLable = [[YYLabel alloc] init]; _privacyLable = [[YYLabel alloc] init];
NSMutableAttributedString *attString = [[NSMutableAttributedString alloc] initWithString:@"已阅读并同意"]; NSMutableAttributedString *attString = [[NSMutableAttributedString alloc] initWithString:@"已阅读并同意"];
attString.yy_color = [ThemeColor secondTextColor]; attString.yy_color = [ThemeColor secondTextColor];
attString.yy_font = [UIFont systemFontOfSize:14]; attString.yy_font = [UIFont systemFontOfSize:12];
NSMutableAttributedString *rechargeAttString = [[NSMutableAttributedString alloc] initWithString:@"《用户充值协议》" attributes:@{NSForegroundColorAttributeName:[ThemeColor appMainColor]}]; NSMutableAttributedString *rechargeAttString = [[NSMutableAttributedString alloc] initWithString:@"《用户充值协议》" attributes:@{NSForegroundColorAttributeName:[ThemeColor appMainColor]}];
@kWeakify(self); @kWeakify(self);
[rechargeAttString yy_setTextHighlightRange:NSMakeRange(0, rechargeAttString.length) color:nil backgroundColor:nil userInfo:nil tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) { [rechargeAttString yy_setTextHighlightRange:NSMakeRange(0, rechargeAttString.length) color:nil backgroundColor:nil userInfo:nil tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
@@ -107,7 +107,7 @@
- (UILabel *)descriptionLabel { - (UILabel *)descriptionLabel {
if (!_descriptionLabel) { if (!_descriptionLabel) {
_descriptionLabel = [[UILabel alloc] init]; _descriptionLabel = [[UILabel alloc] init];
_descriptionLabel.font = [UIFont systemFontOfSize:14]; _descriptionLabel.font = [UIFont systemFontOfSize:12];
_descriptionLabel.textColor = [ThemeColor appMainColor]; _descriptionLabel.textColor = [ThemeColor appMainColor];
_descriptionLabel.text = @"如有任何问题请咨询客服魔力号88001"; _descriptionLabel.text = @"如有任何问题请咨询客服魔力号88001";
_descriptionLabel.textAlignment = NSTextAlignmentCenter; _descriptionLabel.textAlignment = NSTextAlignmentCenter;

View File

@@ -101,7 +101,7 @@
_coinLabel = [[UILabel alloc] init]; _coinLabel = [[UILabel alloc] init];
_coinLabel.text = @"我的钻石"; _coinLabel.text = @"我的钻石";
_coinLabel.font = [UIFont systemFontOfSize:13]; _coinLabel.font = [UIFont systemFontOfSize:13];
_coinLabel.textColor = [UIColor whiteColor]; _coinLabel.textColor = [ThemeColor mainTextColor];
} }
return _coinLabel; return _coinLabel;
} }
@@ -109,8 +109,8 @@
- (UILabel *)amountLabel { - (UILabel *)amountLabel {
if (!_amountLabel) { if (!_amountLabel) {
_amountLabel = [[UILabel alloc] init]; _amountLabel = [[UILabel alloc] init];
_amountLabel.font = [UIFont boldSystemFontOfSize:36]; _amountLabel.font = [UIFont systemFontOfSize:24 weight:UIFontWeightMedium];
_amountLabel.textColor = [ThemeColor appMainColor]; _amountLabel.textColor = [ThemeColor mainTextColor];
_amountLabel.textAlignment = NSTextAlignmentCenter; _amountLabel.textAlignment = NSTextAlignmentCenter;
} }
return _amountLabel; return _amountLabel;

View File

@@ -132,17 +132,17 @@
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.section == 0) { if (indexPath.section == 0) {
CGFloat wallInfoHeight = (kSafeAreaTopHeight + 190); CGFloat wallInfoHeight = 211 + 72;
if (self.datasource.count > 0) { if (self.datasource.count > 0) {
CGFloat listHeight= 0; CGFloat listHeight= 0;
int page = self.datasource.count % 3; int page = self.datasource.count % 3;
int line = (int)self.datasource.count / 3; int line = (int)self.datasource.count / 3;
if (page == 0) { if (page == 0) {
listHeight = 80 * line + (line - 1) * 10; listHeight = 64 * line + (line - 1) * 8;
} else { } else {
listHeight = (line + 1) * 80 + line * 10; listHeight = (line + 1) * 64 + line * 8;
} }
return (listHeight + wallInfoHeight + 15); return (listHeight + wallInfoHeight);
} else { } else {
return wallInfoHeight; return wallInfoHeight;
} }
@@ -343,8 +343,8 @@
- (UIButton *)backButton { - (UIButton *)backButton {
if (!_backButton) { if (!_backButton) {
_backButton = [UIButton buttonWithType:UIButtonTypeCustom]; _backButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_backButton setImage:[UIImage imageNamed:@"home_search_white_back"] forState:UIControlStateNormal]; [_backButton setImage:[UIImage imageNamed:@"common_nav_back"] forState:UIControlStateNormal];
[_backButton setImage:[UIImage imageNamed:@"home_search_white_back"] forState:UIControlStateSelected]; [_backButton setImage:[UIImage imageNamed:@"common_nav_back"] forState:UIControlStateSelected];
[_backButton addTarget:self action:@selector(backButtonAction:) forControlEvents:UIControlEventTouchUpInside]; [_backButton addTarget:self action:@selector(backButtonAction:) forControlEvents:UIControlEventTouchUpInside];
} }
return _backButton; return _backButton;
@@ -354,7 +354,7 @@
if (!_titleLabel) { if (!_titleLabel) {
_titleLabel = [[UILabel alloc] init]; _titleLabel = [[UILabel alloc] init];
_titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightMedium]; _titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightMedium];
_titleLabel.textColor = [UIColor whiteColor]; _titleLabel.textColor = [ThemeColor mainTextColor];
_titleLabel.textAlignment = NSTextAlignmentCenter; _titleLabel.textAlignment = NSTextAlignmentCenter;
_titleLabel.text = @"我的账户"; _titleLabel.text = @"我的账户";
} }
@@ -365,7 +365,7 @@
if (!_incomeButton) { if (!_incomeButton) {
_incomeButton = [UIButton buttonWithType:UIButtonTypeCustom]; _incomeButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_incomeButton setTitle:@"我的收益" forState:UIControlStateNormal]; [_incomeButton setTitle:@"我的收益" forState:UIControlStateNormal];
[_incomeButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; [_incomeButton setTitleColor:[ThemeColor mainTextColor] forState:UIControlStateNormal];
_incomeButton.titleLabel.font = [UIFont systemFontOfSize:13]; _incomeButton.titleLabel.font = [UIFont systemFontOfSize:13];
[_incomeButton addTarget:self action:@selector(incomeButtonAction:) forControlEvents:UIControlEventTouchUpInside]; [_incomeButton addTarget:self action:@selector(incomeButtonAction:) forControlEvents:UIControlEventTouchUpInside];
} }

View File

@@ -1,17 +0,0 @@
//
// XPMineRechageHeadView.h
// xplan-ios
//
// Created by 冯硕 on 2021/9/24.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@class WalletInfoModel;
@interface XPMineRechageHeadView : UIView
///钱包信息
@property (nonatomic,strong) WalletInfoModel *walletInfo;
@end
NS_ASSUME_NONNULL_END

View File

@@ -1,138 +0,0 @@
//
// XPMineRechageHeadView.m
// xplan-ios
//
// Created by on 2021/9/24.
//
#import "XPMineRechageHeadView.h"
///Third
#import <Masonry/Masonry.h>
///Tool
#import "ThemeColor.h"
#import "XPMacro.h"
///Model
#import "WalletInfoModel.h"
@interface XPMineRechageHeadView ()
///
@property (nonatomic,strong) UIImageView *backImageView;
///
@property (nonatomic,strong) UIImageView *bottomBackImg;
///
@property (nonatomic,strong) UIImageView *coinImageView;
///
@property (nonatomic,strong) UILabel *coinLabel;
///
@property (nonatomic,strong) UILabel *amountLabel;
@end
@implementation XPMineRechageHeadView
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
[self initView];
[self initContrations];
}
return self;
}
#pragma mark - Private Method
- (void)initView {
[self addSubview:self.backImageView];
[self.backImageView addSubview:self.bottomBackImg];
[self.bottomBackImg addSubview:self.coinImageView];
[self.bottomBackImg addSubview:self.coinLabel];
[self.bottomBackImg addSubview:self.amountLabel];
}
- (void)initContrations {
self.frame = CGRectMake(0, 0, KScreenWidth, 190 + kSafeAreaTopHeight);
[self.backImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self);
}];
[self.bottomBackImg mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.bottom.mas_equalTo(self.backImageView);
make.height.mas_equalTo(110);
}];
[self.coinImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(21, 21));
make.top.mas_equalTo(self.bottomBackImg).offset(23);
make.right.mas_equalTo(self.coinLabel.mas_left).offset(-4);
}];
[self.coinLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self.coinImageView);
make.centerX.mas_equalTo(self.bottomBackImg.mas_centerX).offset(12);
}];
[self.amountLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self.bottomBackImg);
make.top.mas_equalTo(self.coinImageView.mas_bottom).offset(1);
}];
}
#pragma mark - Getters And Setters
- (void)setWalletInfo:(WalletInfoModel *)walletInfo {
_walletInfo = walletInfo;
if (_walletInfo) {
self.amountLabel.text = walletInfo.diamonds;
}
}
- (UIImageView *)backImageView {
if (!_backImageView) {
_backImageView = [[UIImageView alloc] init];
_backImageView.userInteractionEnabled = YES;
_backImageView.image = [UIImage imageNamed:@"mine_recharge_header_bg"];
_backImageView.layer.masksToBounds = YES;
_backImageView.contentMode = UIViewContentModeScaleAspectFill;
}
return _backImageView;
}
- (UIImageView *)bottomBackImg {
if (!_bottomBackImg) {
_bottomBackImg = [[UIImageView alloc] init];
_bottomBackImg.userInteractionEnabled = YES;
_bottomBackImg.image = [UIImage imageNamed:@"mine_recharge_coin_bg"];
_bottomBackImg.layer.masksToBounds = YES;
_bottomBackImg.contentMode = UIViewContentModeScaleAspectFit;
}
return _bottomBackImg;
}
- (UIImageView *)coinImageView {
if (!_coinImageView) {
_coinImageView = [[UIImageView alloc] init];
_coinImageView.userInteractionEnabled = YES;
_coinImageView.image = [UIImage imageNamed:@"common_diamond"];
}
return _coinImageView;
}
- (UILabel *)coinLabel {
if (!_coinLabel) {
_coinLabel = [[UILabel alloc] init];
_coinLabel.text = @"我的钻石";
_coinLabel.font = [UIFont systemFontOfSize:13];
_coinLabel.textColor = [UIColor whiteColor];
}
return _coinLabel;
}
- (UILabel *)amountLabel {
if (!_amountLabel) {
_amountLabel = [[UILabel alloc] init];
_amountLabel.font = [UIFont boldSystemFontOfSize:36];
_amountLabel.textColor = [ThemeColor appMainColor];
_amountLabel.textAlignment = NSTextAlignmentCenter;
}
return _amountLabel;
}
@end

View File

@@ -1,21 +0,0 @@
//
// XPMineRechargeNavView.h
// xplan-ios
//
// Created by 冯硕 on 2021/9/26.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@class XPMineRechargeNavView;
@protocol XPMineRechargeNavViewDelegate <NSObject>
///点击了返回按钮
- (void)xPMineRechargeNavView:(XPMineRechargeNavView *)view didClickBackButton:(UIButton *)sender;
@end
@interface XPMineRechargeNavView : UIView
///代理
@property (nonatomic,weak) id<XPMineRechargeNavViewDelegate> delegate;
@end
NS_ASSUME_NONNULL_END

View File

@@ -1,82 +0,0 @@
//
// XPMineRechargeNavView.m
// xplan-ios
//
// Created by on 2021/9/26.
//
#import "XPMineRechargeNavView.h"
///Third
#import <Masonry/Masonry.h>
///Tool
#import "ThemeColor.h"
#import "UIButton+EnlargeTouchArea.h"
@interface XPMineRechargeNavView ()
///
@property (nonatomic,strong) UIButton *backButton;
///
@property (nonatomic,strong) UILabel *titleLabel;
@end
@implementation XPMineRechargeNavView
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self initSubViews];
[self initSubViewConstraints];
}
return self;
}
#pragma mark - Response
- (void)backButtonAction:(UIButton *)sender {
if (self.delegate && [self.delegate respondsToSelector:@selector(xPMineRechargeNavView:didClickBackButton:)]) {
[self.delegate xPMineRechargeNavView:self didClickBackButton:sender];
}
}
#pragma mark - Private Method
- (void)initSubViews {
self.backgroundColor = [UIColor clearColor];
[self addSubview:self.backButton];
[self addSubview:self.titleLabel];
}
- (void)initSubViewConstraints {
[self.backButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(15);
make.centerY.equalTo(self.mas_bottom).mas_offset(-22);
}];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self);
make.centerY.equalTo(self.mas_bottom).mas_offset(-22);
}];
}
#pragma mark - Getters And Setters
- (UIButton *)backButton {
if (!_backButton) {
_backButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_backButton setImage:[UIImage imageNamed:@"home_search_white_back"] forState:UIControlStateNormal];
_backButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
[_backButton addTarget:self action:@selector(backButtonAction:) forControlEvents:UIControlEventTouchUpInside];
[_backButton setEnlargeEdgeWithTop:10 right:10 bottom:10 left:10];
}
return _backButton;
}
- (UILabel *)titleLabel {
if (!_titleLabel) {
_titleLabel = [[UILabel alloc] init];
_titleLabel.textAlignment = NSTextAlignmentCenter;
_titleLabel.font = [UIFont systemFontOfSize:15];
_titleLabel.text = @"账户";
_titleLabel.textColor = [UIColor whiteColor];
}
return _titleLabel;
}
@end