首次提交

This commit is contained in:
启星
2025-09-22 18:48:29 +08:00
parent 28ae935e93
commit ae9be0b58e
8941 changed files with 999209 additions and 2 deletions

View File

@@ -0,0 +1,18 @@
//
// QXAliBindViewController.h
// QXLive
//
// Created by 启星 on 2025/7/9.
//
#import "QXBaseViewController.h"
#import "QXPayTypeModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface QXAliBindViewController : QXBaseViewController
@property (nonatomic,assign)BOOL isAli;
@property (nonatomic,strong)QXPayTypeModel *model;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,82 @@
//
// QXAliBindViewController.m
// QXLive
//
// Created by on 2025/7/9.
//
#import "QXAliBindViewController.h"
#import "QXLoginTextField.h"
#import "QXMineNetwork.h"
@interface QXAliBindViewController ()<QXLoginTextFieldDelegate>
@property (nonatomic,strong)QXLoginTextField *aliTextField;
@property (nonatomic,strong)QXLoginTextField *bankNumberTextField;
@property (nonatomic,strong)QXLoginTextField *bankNameTextField;
@property (nonatomic,strong)QXLoginTextField *bankAddressTextField;
@property (nonatomic,strong)UIButton *commitBtn;
@end
@implementation QXAliBindViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
}
-(void)setNavgationItems{
[super setNavgationItems];
self.navigationItem.title = self.isAli?@"绑定支付宝":@"绑定银行卡";
}
-(void)initSubViews{
if (self.isAli) {
self.aliTextField = [[QXLoginTextField alloc] initWithFrame:CGRectMake(16, NavContentHeight+12, SCREEN_WIDTH-32, 44) type:(LoginTextTypeAliPay)];
self.aliTextField.backgroundColor = RGB16(0xEFF2F8);
[self.aliTextField addRoundedCornersWithRadius:11];
[self.view addSubview:self.aliTextField];
self.commitBtn = [[UIButton alloc] initWithFrame:CGRectMake(38, self.aliTextField.bottom+16, SCREEN_WIDTH-38*2, 42)];
}else{
self.bankNumberTextField = [[QXLoginTextField alloc] initWithFrame:CGRectMake(16, NavContentHeight+12, SCREEN_WIDTH-32, 44) type:(LoginTextTypeBankNumber)];
self.bankNumberTextField.backgroundColor = RGB16(0xEFF2F8);
[self.bankNumberTextField addRoundedCornersWithRadius:11];
[self.view addSubview:self.bankNumberTextField];
self.bankNameTextField = [[QXLoginTextField alloc] initWithFrame:CGRectMake(16, self.bankNumberTextField.bottom+12, SCREEN_WIDTH-32, 44) type:(LoginTextTypeBankName)];
self.bankNameTextField.backgroundColor = RGB16(0xEFF2F8);
[self.bankNameTextField addRoundedCornersWithRadius:11];
[self.view addSubview:self.bankNameTextField];
self.bankNumberTextField = [[QXLoginTextField alloc] initWithFrame:CGRectMake(16, self.bankNameTextField.bottom+12, SCREEN_WIDTH-32, 44) type:(LoginTextTypeBankAddress)];
self.bankNumberTextField.backgroundColor = RGB16(0xEFF2F8);
[self.bankNumberTextField addRoundedCornersWithRadius:11];
[self.view addSubview:self.bankNumberTextField];
self.commitBtn = [[UIButton alloc] initWithFrame:CGRectMake(38, self.bankNumberTextField.bottom+16, SCREEN_WIDTH-38*2, 42)];
}
self.commitBtn.needEventInterval = 1;
[self.commitBtn setTitle:QXText(@"立即绑定") forState:(UIControlStateNormal)];
[self.commitBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)];
[self.commitBtn addTarget:self action:@selector(commitAction) forControlEvents:(UIControlEventTouchUpInside)];
[self.commitBtn addRoundedCornersWithRadius:21];
self.commitBtn.titleLabel.font = [UIFont systemFontOfSize:14];
self.commitBtn.backgroundColor = QXConfig.themeColor;
[self.view addSubview:self.commitBtn];
}
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
[self.view endEditing:YES];
}
-(void)commitAction{
MJWeakSelf
[QXMineNetwork walletBindWithUserId:QXGlobal.shareGlobal.loginModel.user_id type:self.model.type alipay_account:self.aliTextField.textField.text bank_card_number:self.bankNumberTextField.textField.text bank_card:self.bankNameTextField.textField.text open_bank:self.bankAddressTextField.textField.text successBlock:^(NSDictionary * _Nonnull dict) {
[weakSelf.navigationController popViewControllerAnimated:YES];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
}];;
}
@end

View File

@@ -0,0 +1,19 @@
//
// QXCornRecordSubViewController.h
// QXLive
//
// Created by 启星 on 2025/5/26.
//
#import "QXBaseViewController.h"
#import "JXCategoryView.h"
NS_ASSUME_NONNULL_BEGIN
@interface QXCornRecordSubViewController : QXBaseViewController<JXCategoryListContentViewDelegate>
/// 0 收入 1 支出
@property (nonatomic,assign)NSInteger type;
/// 流水类型
@property (nonatomic,assign)NSInteger waterType;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,109 @@
//
// QXCornRecordSubViewController.m
// QXLive
//
// Created by on 2025/5/26.
//
#import "QXCornRecordSubViewController.h"
#import "QXCornRecordCell.h"
#import "QXWalletDateView.h"
#import "QXMineNetwork.h"
@interface QXCornRecordSubViewController ()<UITableViewDelegate,UITableViewDataSource,QXWalletDateViewDelegate>
@property (nonatomic,strong)UITableView *tableView;
@property (nonatomic,strong)QXWalletDateView *dateView;
@property (nonatomic,strong)NSString* startTime;
@property (nonatomic,strong)NSString* endTime;
@end
@implementation QXCornRecordSubViewController
-(UIView *)listView{
return self.view;
}
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
}
-(void)initSubViews{
UIView *dateBg = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 48)];
dateBg.backgroundColor = [UIColor whiteColor];
[dateBg addSubview:self.dateView];
[self.view addSubview:dateBg];
[self.view addSubview:self.tableView];
self.page = 1;
}
-(void)getData{
// [self.dataArray addObject:@""];
// [self.dataArray addObject:@""];
// [self.dataArray addObject:@""];
// [self.tableView reloadData];
//
MJWeakSelf
[QXMineNetwork roomCoinOrDiamondDetailWithPage:self.page in_out_type:[NSString stringWithFormat:@"%ld",self.type+1] start_time:self.startTime end_time:self.endTime gift_type:[NSString stringWithFormat:@"%ld",self.waterType+1] successBlock:^(NSArray<QXCoinDetailModel *> * _Nonnull list) {
if (weakSelf.page == 1) {
[weakSelf.dataArray removeAllObjects];
}
[weakSelf.dataArray addObjectsFromArray:list];
[weakSelf.tableView reloadData];
if (list.count == 0) {
weakSelf.tableView.mj_footer.state = MJRefreshStateNoMoreData;
}else{
[weakSelf.tableView.mj_footer endRefreshing];
}
[weakSelf.tableView.mj_header endRefreshing];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
[weakSelf.tableView.mj_header endRefreshing];
[weakSelf.tableView.mj_footer endRefreshing];
}];
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return self.dataArray.count;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
QXCornRecordCell *cell = [QXCornRecordCell cellWithTableView:tableView];
cell.isCoin = self.waterType==0;
cell.model = self.dataArray[indexPath.row];
return cell;
}
#pragma mark - QXWalletDateViewDelegate
-(void)didSelectedStartDate:(NSString *)startDateString startDate:(NSDate *)startDate endDateString:(NSString *)endDateString endDate:(NSDate *)endDate{
QXLOG(@"开始时间-%@ 结束时间-%@",startDateString,endDateString);
self.startTime = startDateString;
self.endTime = endDateString;
self.page = 1;
[self getData];
}
-(QXWalletDateView *)dateView{
if (!_dateView) {
_dateView = [[QXWalletDateView alloc] initWithFrame:CGRectMake(16, 0, SCREEN_WIDTH-32, 38)];
_dateView.delegate = self;
}
return _dateView;
}
-(UITableView *)tableView{
if (!_tableView) {
_tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, self.dateView.bottom+10, SCREEN_WIDTH, SCREEN_HEIGHT - self.dateView.bottom-NavContentHeight-44) style:(UITableViewStylePlain)];
_tableView.dataSource = self;
_tableView.delegate = self;
_tableView.backgroundColor = [UIColor whiteColor];
_tableView.tableFooterView = [UIView new];
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
_tableView.rowHeight = 66;
MJWeakSelf
_tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
weakSelf.page = 1;
[weakSelf getData];
}];
_tableView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
weakSelf.page++;
[weakSelf getData];
}];
}
return _tableView;
}
@end

View File

@@ -0,0 +1,17 @@
//
// QXCornRecordViewController.h
// QXLive
//
// Created by 启星 on 2025/5/26.
//
#import "QXBaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface QXCornRecordViewController : QXBaseViewController
/// 0 金币 1 钻石
@property (nonatomic,assign)NSInteger type;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,84 @@
//
// QXCornRecordViewController.m
// QXLive
//
// Created by on 2025/5/26.
//
#import "QXCornRecordViewController.h"
#import "JXCategoryView.h"
#import "QXCornRecordSubViewController.h"
@interface QXCornRecordViewController ()<JXCategoryViewDelegate,JXCategoryListContainerViewDelegate>
@property (nonatomic,strong)JXCategoryTitleView *categoryView;
@property (nonatomic,strong)JXCategoryListContainerView *containerView;
@property (nonatomic,strong)NSMutableArray <UIViewController*>*listVCArray;
@property (nonatomic,strong)NSArray *titles;
@end
@implementation QXCornRecordViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
}
-(void)setNavgationItems{
[super setNavgationItems];
if (self.type == 0) {
self.navigationItem.title = QXText(@"金币收支");
}else{
self.navigationItem.title = QXText(@"钻石收支");
}
}
-(void)initSubViews{
self.view.backgroundColor = [UIColor whiteColor];
if (self.type == 0) {
self.titles = @[QXText(@"金币收入"),QXText(@"金币支出")];
}else{
self.titles = @[QXText(@"钻石收入"),QXText(@"钻石支出")];
}
self.listVCArray = [NSMutableArray array];
self.categoryView = [[JXCategoryTitleView alloc] init];
self.categoryView.frame = CGRectMake(0, kSafeAreaTop+44, SCREEN_WIDTH, 44);
self.categoryView.delegate = self;
self.categoryView.titles = self.titles;
self.categoryView.backgroundColor = [UIColor whiteColor];
self.categoryView.titleSelectedColor = [UIColor colorWithHexString:@"#333333"];
self.categoryView.titleColor = [UIColor colorWithHexString:@"#666666"];
self.categoryView.cellWidth = 70;
self.categoryView.contentEdgeInsetLeft = 16;
self.categoryView.cellSpacing = 12;
// self.categoryView.titleLabelZoomScale = 1.1;
self.categoryView.titleLabelZoomEnabled = YES;
self.categoryView.titleFont = [UIFont boldSystemFontOfSize:14];
self.categoryView.titleSelectedFont = [UIFont boldSystemFontOfSize:16];
self.categoryView.averageCellSpacingEnabled = NO;
JXCategoryIndicatorImageView *indicatorView = [[JXCategoryIndicatorImageView alloc] init];
indicatorView.indicatorImageView.image = [UIImage imageNamed:@"home_slider"];
indicatorView.indicatorImageViewSize = CGSizeMake(58, 8);
indicatorView.verticalMargin = 11;
self.categoryView.indicators = @[indicatorView];
self.containerView = [[JXCategoryListContainerView alloc] initWithType:(JXCategoryListContainerType_ScrollView) delegate:self];
self.containerView.frame = CGRectMake(0, self.categoryView.bottom, SCREEN_WIDTH, SCREEN_HEIGHT-self.categoryView.bottom);
[self.view addSubview:self.categoryView];
[self.view addSubview:self.containerView];
self.categoryView.listContainer = self.containerView;
[self requestMineUserInfoData];
}
- (void)requestMineUserInfoData {
}
-(NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView{
return self.titles.count;
}
-(id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index{
QXCornRecordSubViewController *vc = [[QXCornRecordSubViewController alloc] init];
vc.waterType = self.type;
vc.type = index;
return vc;
}
- (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index {
self.navigationController.interactivePopGestureRecognizer.enabled = (index == 0);
}
@end

View File

@@ -0,0 +1,16 @@
//
// QXDiamondViewController.h
// QXLive
//
// Created by 启星 on 2025/5/26.
//
#import "QXBaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface QXDiamondViewController : QXBaseViewController
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,120 @@
//
// QXDiamondViewController.m
// QXLive
//
// Created by on 2025/5/26.
//
#import "QXDiamondViewController.h"
#import "QXWalletTopView.h"
#import "QXWithDrawInputView.h"
#import "QXMineNetwork.h"
@interface QXDiamondViewController ()<QXWithDrawInputViewDelegate>
@property (nonatomic,strong)QXWalletTopView *topView;
@property (nonatomic,strong)QXWithDrawInputView *withDrawInputView;
@property (nonatomic,strong)UIButton *commitBtn;
@end
@implementation QXDiamondViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
}
-(void)setNavgationItems{
[super setNavgationItems];
self.navigationItem.title = QXText(@"钻石兑币");
}
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:NO animated:YES];
[self getPrice];
}
- (void)initSubViews{
[self.view addSubview:self.topView];
[self.topView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(16);
make.right.mas_equalTo(-16);
make.top.mas_equalTo(NavContentHeight+12);
make.height.mas_equalTo(ScaleWidth(112));
}];
[self.view addSubview:self.withDrawInputView];
[self.withDrawInputView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(16);
make.right.mas_equalTo(-16);
make.top.equalTo(self.topView.mas_bottom).offset(12);
make.height.mas_equalTo(95);
}];
self.commitBtn = [[UIButton alloc] init];
[self.commitBtn setTitle:QXText(@"确认兑换") forState:(UIControlStateNormal)];
self.commitBtn.titleLabel.font = [UIFont systemFontOfSize:14];;
[self.commitBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)];
[self.commitBtn addRoundedCornersWithRadius:21];
self.commitBtn.backgroundColor = QXConfig.themeColor;
[self.commitBtn addTarget:self action:@selector(commitAction:) forControlEvents:(UIControlEventTouchUpInside)];
[self.view addSubview:self.commitBtn];
[self.commitBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(38);
make.right.mas_equalTo(-38);
make.height.mas_equalTo(42);
make.bottom.mas_equalTo(-(kSafeAreaBottom));
}];
}
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
[self.view endEditing:YES];
}
-(void)getPrice{
MJWeakSelf
[QXMineNetwork getWalletInfoSuccessBlock:^(NSString * _Nonnull coin, NSString * _Nonnull earnings, NSString * _Nonnull title, NSString * _Nonnull url) {
weakSelf.topView.coin = earnings;
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
}];
[QXMineNetwork getWalletConfigSuccessBlock:^(NSString * _Nonnull coin_exchange_rate, NSString * _Nonnull withdrawal_service_fee, NSString * _Nonnull rmb_coin_ratio) {
weakSelf.withDrawInputView.fee = coin_exchange_rate;
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
}];
}
#pragma mark - QXWithDrawInputViewDelegate
-(void)didClickAll{
if (self.topView.coin.intValue == 0) {
self.withDrawInputView.textField.text = @"0";
}else{
self.withDrawInputView.textField.text = [NSString stringWithFormat:@"%ld",self.topView.coin.longValue];
}
}
-(void)commitAction:(UIButton*)sender{
MJWeakSelf
showLoadingInView(self.view);
[QXMineNetwork roomCoinExchangeWithEarningsNum:self.withDrawInputView.textField.text successBlock:^(NSDictionary * _Nonnull dict) {
hideLoadingInView(self.view);
showToast(@"兑换成功");
[weakSelf getPrice];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
hideLoadingInView(self.view);
showToast(msg);
}];
}
-(QXWalletTopView *)topView{
if (!_topView) {
_topView = [[QXWalletTopView alloc] init];
_topView.type = QXWalletTopViewTypeDiamond;
}
return _topView;
}
-(QXWithDrawInputView *)withDrawInputView{
if (!_withDrawInputView) {
_withDrawInputView = [[QXWithDrawInputView alloc] init];
_withDrawInputView.delegate = self;
_withDrawInputView.type = QXWithDrawInputViewTypeExchangeCorn;
}
return _withDrawInputView;
}
@end

View File

@@ -0,0 +1,16 @@
//
// QXRechargeViewcController.h
// QXLive
//
// Created by 启星 on 2025/5/16.
//
#import "QXBaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface QXRechargeViewcController : QXBaseViewController
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,82 @@
//
// QXRechargeViewcController.m
// QXLive
//
// Created by on 2025/5/16.
//
#import "QXRechargeViewcController.h"
#import "QXRechargeView.h"
#import "QXWalletTopView.h"
#import "QXPayTypeModel.h"
#import "QXMineNetwork.h"
@interface QXRechargeViewcController ()
@property (nonatomic,strong)QXWalletTopView *topView;
@property (nonatomic,strong)QXRechargeView *rechargeView;
@end
@implementation QXRechargeViewcController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
}
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:NO animated:YES];
[self getPrice];
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(rechargeSuccess) name:noticeAlipayResult object:nil];
}
-(void)setNavgationItems{
[super setNavgationItems];
self.navigationItem.title = QXText(@"充值");
}
-(void)rechargeSuccess{
[self getPrice];
}
- (void)initSubViews{
[self.view addSubview:self.topView];
[self.view addSubview:self.rechargeView];
[self.topView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(16);
make.right.mas_equalTo(-16);
make.top.mas_equalTo(NavContentHeight+12);
make.height.mas_equalTo(ScaleWidth(112));
}];
[self.rechargeView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(0);
make.right.mas_equalTo(0);
make.top.equalTo(self.topView.mas_bottom).offset(12);
make.bottom.mas_equalTo(-10);
}];
}
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
[self.view endEditing:YES];
}
-(void)getPrice{
MJWeakSelf
[QXMineNetwork getWalletInfoSuccessBlock:^(NSString * _Nonnull coin, NSString * _Nonnull earnings, NSString * _Nonnull title, NSString * _Nonnull url) {
weakSelf.topView.coin = coin;
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
}];
}
-(QXWalletTopView *)topView{
if (!_topView) {
_topView = [[QXWalletTopView alloc] init];
}
return _topView;
}
-(QXRechargeView *)rechargeView{
if (!_rechargeView) {
_rechargeView = [[QXRechargeView alloc] initWithFrame:CGRectMake(0, ScaleWidth(112)+12, SCREEN_WIDTH, SCREEN_HEIGHT-ScaleWidth(112)-12-NavContentHeight-12)];
}
return _rechargeView;
}
-(void)dealloc{
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
@end

View File

@@ -0,0 +1,16 @@
//
// QXWalletViewController.h
// QXLive
//
// Created by 启星 on 2025/5/9.
//
#import "QXBaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface QXWalletViewController : QXBaseViewController
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,183 @@
//
// QXWalletViewController.m
// QXLive
//
// Created by on 2025/5/9.
//
#import "QXWalletViewController.h"
#import "QXRechargeViewcController.h"
#import "QXWalletHomeTopView.h"
#import "QXWalletHomeCell.h"
#import "QXWithDrawViewController.h"
#import "QXDiamondViewController.h"
#import "QXCornRecordViewController.h"
#import "QXMineNetwork.h"
#import "QXWithDrawBindViewController.h"
#import "QXRealNameViewController.h"
#import "QXBindMobileViewController.h"
#import "QXAliBindViewController.h"
@interface QXWalletViewController ()<UITableViewDelegate,UITableViewDataSource,QXWalletHomeTopViewDelegate>
@property (nonatomic,strong)QXWalletHomeTopView *topView;
@property (nonatomic,strong)UITableView *tableView;
@property (nonatomic,assign)BOOL isBind;
@end
@implementation QXWalletViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
}
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:NO animated:YES];
[self getPrice];
}
-(void)setNavgationItems{
[super setNavgationItems];
self.navigationItem.title = QXText(@"钱包");
}
- (void)initSubViews{
NSArray *section1 = @[
QXText(@"金币收支"),
QXText(@"钻石收支"),
];
NSArray *section2 = @[
QXText(@"钻石换币"),
QXText(@"绑定管理"),
];
[self.dataArray addObject:section1];
[self.dataArray addObject:section2];
self.tableView.tableHeaderView = self.topView;
[self.view addSubview:self.tableView];
}
#pragma mark - UITableViewDelegate,UITableViewDataSource
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
return self.dataArray.count;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
NSArray *arr = self.dataArray[section];
return arr.count;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
QXWalletHomeCell *cell = [QXWalletHomeCell cellWithTableView:tableView];
NSArray *arr = self.dataArray[indexPath.section];
cell.titleLabel.text = arr[indexPath.row];
return cell;
}
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
UIView *header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 36)];
UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(16, 0, SCREEN_WIDTH-32, 36)];
titleLabel.font = [UIFont boldSystemFontOfSize:16];
titleLabel.textColor = RGB16(0x000000);
if (section == 0) {
titleLabel.text = QXText(@"我的账单");
}else{
titleLabel.text = QXText(@"其他功能");
}
[header addSubview:titleLabel];
return header;
}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
return 36;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
return 50;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
if (indexPath.section == 1) {
if (indexPath.row == 0) {
QXDiamondViewController *vc = [[QXDiamondViewController alloc] init];
[self.navigationController pushViewController:vc animated:YES];
}else{
QXWithDrawBindViewController *vc = [[QXWithDrawBindViewController alloc] init];
[self.navigationController pushViewController:vc animated:YES];
}
}else{
QXCornRecordViewController *vc = [[QXCornRecordViewController alloc] init];
vc.type = indexPath.row;
[self.navigationController pushViewController:vc animated:YES];
}
}
-(void)didClickButtonIsRecharge:(BOOL)isRecharge{
if (isRecharge) {
QXRechargeViewcController *vc = [[QXRechargeViewcController alloc] init];
[self.navigationController pushViewController:vc animated:YES];
}else{
if (QXGlobal.shareGlobal.loginModel.auth == 0) {
showToast(@"请先完成实名认证");
QXRealNameViewController *vc = [[QXRealNameViewController alloc] init];
[self.navigationController pushViewController:vc animated:YES];
return;
}
if (QXGlobal.shareGlobal.loginModel.mobile.length == 0) {
showToast(@"请先绑定手机号");
QXBindMobileViewController *vc = [[QXBindMobileViewController alloc] init];
[self.navigationController pushViewController:vc animated:YES];
return;
}
if (!self.isBind) {
showToast(@"请先绑定提现账号");
QXAliBindViewController *vc = [[QXAliBindViewController alloc] init];
[self.navigationController pushViewController:vc animated:YES];
return;
}
QXWithDrawViewController *vc = [[QXWithDrawViewController alloc] init];
[self.navigationController pushViewController:vc animated:YES];
}
}
-(void)getPrice{
MJWeakSelf
[QXMineNetwork getWalletInfoSuccessBlock:^(NSString * _Nonnull coin, NSString * _Nonnull earnings, NSString * _Nonnull title, NSString * _Nonnull url) {
weakSelf.topView.coin = coin;
weakSelf.topView.earnings = earnings;
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
}];
[QXMineNetwork walletPayTypeWithUserId:QXGlobal.shareGlobal.loginModel.user_id successBlock:^(QXPayTypeStatusModel * _Nonnull model) {
if (model.wx.is_with_draw_open.intValue == 1 && model.wx.is_bind.intValue == 1) {
weakSelf.isBind = YES;
return;
}
if (model.ali.is_pay_open.intValue == 1 && model.ali.is_bind.intValue == 1) {
weakSelf.isBind = YES;
return;
}
if (model.bank.is_pay_open.intValue == 1 && model.bank.is_bind.intValue == 1) {
weakSelf.isBind = YES;
return;
}
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
}];
}
-(UITableView *)tableView{
if (!_tableView) {
_tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, NavContentHeight, SCREEN_WIDTH, SCREEN_HEIGHT-NavContentHeight) style:(UITableViewStylePlain)];
_tableView.dataSource = self;
_tableView.delegate = self;
_tableView.backgroundColor = [UIColor clearColor];
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
if (@available(iOS 15.0, *)) {
_tableView.sectionHeaderTopPadding = 0;
} else {
// Fallback on earlier versions
}
}
return _tableView;
}
-(QXWalletHomeTopView *)topView{
if (!_topView) {
_topView = [[QXWalletHomeTopView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, ScaleWidth(110))];
_topView.delegate = self;
}
return _topView;
}
@end

View File

@@ -0,0 +1,16 @@
//
// QXWithDrawBindViewController.h
// QXLive
//
// Created by 启星 on 2025/7/9.
//
#import "QXBaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface QXWithDrawBindViewController : QXBaseViewController
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,103 @@
//
// QXWithDrawBindViewController.m
// QXLive
//
// Created by on 2025/7/9.
//
#import "QXWithDrawBindViewController.h"
#import "QXSettingCell.h"
#import "QXMineNetwork.h"
#import "QXAliBindViewController.h"
@interface QXWithDrawBindViewController ()<UITableViewDelegate,UITableViewDataSource>
@property (nonatomic,strong)UITableView *tableView;;
@end
@implementation QXWithDrawBindViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
}
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:NO animated:YES];
[self getPayType];
}
-(void)setNavgationItems{
[super setNavgationItems];
self.navigationItem.title = QXText(@"绑定管理");
}
-(void)initSubViews{
[self.view addSubview:self.tableView];
[self getPayType];
}
-(void)getPayType{
MJWeakSelf
[QXMineNetwork walletPayTypeWithUserId:QXGlobal.shareGlobal.loginModel.user_id successBlock:^(QXPayTypeStatusModel * _Nonnull model) {
[weakSelf.dataArray removeAllObjects];
if (model.wx.is_with_draw_open.intValue == 1) {
[weakSelf.dataArray addObject:model.wx];
}
if (model.ali.is_with_draw_open.intValue == 1) {
[weakSelf.dataArray addObject:model.ali];
}
if (model.bank.is_with_draw_open.intValue == 1) {
[weakSelf.dataArray addObject:model.bank];
}
[weakSelf.tableView reloadData];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
}];
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return self.dataArray.count;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
QXSettingCell *cell = [QXSettingCell cellWithTableView:tableView];
cell.cellType = QXSettingCellTypeNormal;
QXPayTypeModel *model = self.dataArray[indexPath.row];
cell.titleLabel.text = model.name;
cell.detailLabel.text = model.is_bind.intValue==1?@"已绑定":@"未绑定";
return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
QXPayTypeModel *model = self.dataArray[indexPath.row];
if ([model.name containsString:@"支付宝"]) {
QXAliBindViewController *aliVC = [[QXAliBindViewController alloc] init];
aliVC.isAli = YES;
aliVC.model = model;
[self.navigationController pushViewController:aliVC animated:YES];
return;
}
if ([model.name containsString:@"银行卡"]) {
QXAliBindViewController *aliVC = [[QXAliBindViewController alloc] init];
aliVC.isAli = NO;
aliVC.model = model;
[self.navigationController pushViewController:aliVC animated:YES];
}
}
-(UITableView *)tableView{
if (!_tableView) {
_tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, NavContentHeight, SCREEN_WIDTH, SCREEN_HEIGHT-NavContentHeight) style:(UITableViewStyleGrouped)];
_tableView.dataSource = self;
_tableView.delegate = self;
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
_tableView.backgroundColor = [UIColor clearColor];
_tableView.rowHeight = 42;
}
return _tableView;
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end

View File

@@ -0,0 +1,16 @@
//
// QXWithDrawRecordVC.h
// QXLive
//
// Created by 启星 on 2025/7/12.
//
#import "QXBaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface QXWithDrawRecordVC : QXBaseViewController
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,110 @@
//
// QXWithDrawRecordVC.m
// QXLive
//
// Created by on 2025/7/12.
//
#import "QXWithDrawRecordVC.h"
#import "QXWalletDateView.h"
#import "QXWithDrawRecordCell.h"
#import "QXMineNetwork.h"
@interface QXWithDrawRecordVC ()<UITableViewDelegate,UITableViewDataSource,QXWalletDateViewDelegate>
@property (nonatomic,strong)UITableView *tableView;
@property (nonatomic,strong)QXWalletDateView *dateView;
@property (nonatomic,strong)NSString* startTime;
@property (nonatomic,strong)NSString* endTime;
@end
@implementation QXWithDrawRecordVC
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
}
-(void)setNavgationItems{
[super setNavgationItems];
self.navigationItem.title = @"提现记录";
}
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:NO animated:YES];
}
-(void)initSubViews{
UIView *dateBg = [[UIView alloc] initWithFrame:CGRectMake(0, NavContentHeight+8, SCREEN_WIDTH, 48)];
dateBg.backgroundColor = [UIColor clearColor];
[dateBg addSubview:self.dateView];
[self.view addSubview:dateBg];
[self.view addSubview:self.tableView];
self.page = 1;
}
-(void)getData{
MJWeakSelf
[QXMineNetwork walletWithDrawRecordWithPage:self.page start_time:self.startTime end_time:self.endTime SuccessBlock:^(NSArray<QXWithDrawRecordModel *> * _Nonnull list) {
if (weakSelf.page == 1) {
[weakSelf.dataArray removeAllObjects];
}
[weakSelf.dataArray addObjectsFromArray:list];
[weakSelf.tableView reloadData];
if (list.count == 0) {
weakSelf.tableView.mj_footer.state = MJRefreshStateNoMoreData;
}else{
[weakSelf.tableView.mj_footer endRefreshing];
}
[weakSelf.tableView.mj_header endRefreshing];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
[weakSelf.tableView.mj_header endRefreshing];
[weakSelf.tableView.mj_footer endRefreshing];
}];
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return self.dataArray.count;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
QXWithDrawRecordCell *cell = [QXWithDrawRecordCell cellWithTableView:tableView];
cell.model = self.dataArray[indexPath.row];
return cell;
}
#pragma mark - QXWalletDateViewDelegate
-(void)didSelectedStartDate:(NSString *)startDateString startDate:(NSDate *)startDate endDateString:(NSString *)endDateString endDate:(NSDate *)endDate{
QXLOG(@"开始时间-%@ 结束时间-%@",startDateString,endDateString);
self.startTime = startDateString;
self.endTime = endDateString;
self.page = 1;
[self getData];
}
-(QXWalletDateView *)dateView{
if (!_dateView) {
_dateView = [[QXWalletDateView alloc] initWithFrame:CGRectMake(16, 0, SCREEN_WIDTH-32, 38)];
_dateView.delegate = self;
}
return _dateView;
}
-(UITableView *)tableView{
if (!_tableView) {
_tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, NavContentHeight+48, SCREEN_WIDTH, SCREEN_HEIGHT -NavContentHeight-48) style:(UITableViewStylePlain)];
_tableView.dataSource = self;
_tableView.delegate = self;
_tableView.backgroundColor = [UIColor clearColor];
_tableView.tableFooterView = [UIView new];
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
_tableView.rowHeight = 66;
MJWeakSelf
_tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
weakSelf.page = 1;
[weakSelf getData];
}];
_tableView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
weakSelf.page++;
[weakSelf getData];
}];
}
return _tableView;
}
@end

View File

@@ -0,0 +1,16 @@
//
// QXWithDrawViewController.h
// QXLive
//
// Created by 启星 on 2025/5/26.
//
#import "QXBaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface QXWithDrawViewController : QXBaseViewController
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,295 @@
//
// QXWithDrawViewController.m
// QXLive
//
// Created by on 2025/5/26.
//
#import "QXWithDrawViewController.h"
#import "QXWalletTopView.h"
#import "QXWithDrawInputView.h"
#import "QXWithDrawTypeCell.h"
#import "QXReVerificationPopView.h"
#import "QXMineNetwork.h"
#import "QXWithDrawRecordVC.h"
@interface QXWithDrawViewController ()<UITableViewDelegate,UITableViewDataSource,QXWithDrawInputViewDelegate>
@property (nonatomic,strong)QXWalletTopView *topView;
@property (nonatomic,strong)QXWithDrawInputView *withDrawInputView;
@property (nonatomic,strong)UITableView *tableView;
@property (nonatomic,strong)QXPayTypeModel *selectedPayTypeModel;
@property (nonatomic,strong)UIButton *commitBtn;
@property (nonatomic,strong)UIButton *agreeBtn;
@property (nonatomic,strong)YYLabel *textLabel;
@property (nonatomic,strong)NSString *protocolTitle;
@property (nonatomic,strong)NSString *protocolUrl;
@end
@implementation QXWithDrawViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
}
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:NO animated:YES];
[self getPrice];
}
-(void)setNavgationItems{
[super setNavgationItems];
self.navigationItem.title = QXText(@"提现");
UIButton*recordBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 44, 44)];
[recordBtn setTitle:QXText(@"提现记录") forState:(UIControlStateNormal)];
[recordBtn setTitleColor:RGB16(0xFF8ACC) forState:(UIControlStateNormal)];
recordBtn.titleLabel.font = [UIFont systemFontOfSize:16];
[recordBtn addTarget:self action:@selector(recordAction) forControlEvents:(UIControlEventTouchUpInside)];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:recordBtn];
}
- (void)initSubViews{
self.protocolTitle = @"《灵活就业合作伙伴协议》";
QXPayTypeModel *model1 = [[QXPayTypeModel alloc] init];
model1.type = @"1";
model1.name = @"微信";
model1.icon = @"recharge_wechat";
QXPayTypeModel *model2 = [[QXPayTypeModel alloc] init];
model2.type = @"2";
model2.name = @"支付宝";
model2.icon = @"recharge_alipay";
[self.dataArray addObject:model1];
[self.dataArray addObject:model2];
[self.view addSubview:self.topView];
[self.topView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(16);
make.right.mas_equalTo(-16);
make.top.mas_equalTo(NavContentHeight+12);
make.height.mas_equalTo(ScaleWidth(112));
}];
[self.view addSubview:self.withDrawInputView];
[self.withDrawInputView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(16);
make.right.mas_equalTo(-16);
make.top.equalTo(self.topView.mas_bottom).offset(12);
make.height.mas_equalTo(95);
}];
[self.view addSubview:self.tableView];
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(16);
make.right.mas_equalTo(-16);
make.top.equalTo(self.withDrawInputView.mas_bottom).offset(20);
make.bottom.equalTo(self.view).offset(-kSafeAreaBottom);
}];
self.commitBtn = [[UIButton alloc] init];
[self.commitBtn setTitle:QXText(@"立即提现") forState:(UIControlStateNormal)];
self.commitBtn.titleLabel.font = [UIFont systemFontOfSize:14];;
[self.commitBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)];
[self.commitBtn addRoundedCornersWithRadius:21];
self.commitBtn.backgroundColor = QXConfig.themeColor;
[self.commitBtn addTarget:self action:@selector(withDrawAction:) forControlEvents:(UIControlEventTouchUpInside)];
[self.view addSubview:self.commitBtn];
[self.commitBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(38);
make.right.mas_equalTo(-38);
make.height.mas_equalTo(42);
make.bottom.mas_equalTo(-(kSafeAreaBottom));
}];
[self getPrice];
NSString *str = [NSString stringWithFormat:@"%@%@",QXText(@"我已阅读并同意"),self.protocolTitle];
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:str];
MJWeakSelf
[attr yy_setTextHighlightRange:[str rangeOfString:self.protocolTitle] color:RGB16(0xFF8ACC) backgroundColor:[UIColor clearColor] tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
QXLOG(@"点击灵活就业协议");
QXBaseWebViewController *vc = [[QXBaseWebViewController alloc] init];
vc.urlStr = weakSelf.protocolUrl;
[weakSelf.navigationController pushViewController:vc animated:YES];
}];
[attr yy_setFont:[UIFont systemFontOfSize:12] range:NSMakeRange(0, str.length)];
[attr yy_setColor:RGB16(0x333333) range:NSMakeRange(0, str.length)];
[attr yy_setColor:RGB16(0xFF8ACC) range:[str rangeOfString:self.protocolTitle]];
_textLabel = [[YYLabel alloc] init];
_textLabel.attributedText = attr;
_textLabel.userInteractionEnabled = YES;
[self.view addSubview:self.textLabel];
[self.textLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(42);
make.centerX.equalTo(self.view).offset(17);
make.bottom.equalTo(self.commitBtn.mas_top).offset(-10);
}];
self.agreeBtn = [[UIButton alloc] init];
[self.agreeBtn setImage:[UIImage imageNamed:@"login_agreement_nor"] forState:(UIControlStateNormal)];
[self.agreeBtn setImage:[UIImage imageNamed:@"login_agreement_sel"] forState:(UIControlStateSelected)];
[self.view addSubview:self.agreeBtn];
[self.agreeBtn addTarget:self action:@selector(agreeAction:) forControlEvents:(UIControlEventTouchUpInside)];
[self.agreeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.textLabel.mas_left);
make.width.height.mas_equalTo(40);
make.centerY.equalTo(self.textLabel);
}];
}
-(void)recordAction{
QXWithDrawRecordVC *vc = [[QXWithDrawRecordVC alloc] init];
[self.navigationController pushViewController:vc animated:YES];
}
-(void)getPrice{
MJWeakSelf
[QXMineNetwork getWalletInfoSuccessBlock:^(NSString * _Nonnull coin, NSString * _Nonnull earnings, NSString * _Nonnull title, NSString * _Nonnull url) {
weakSelf.topView.coin = earnings;
weakSelf.protocolUrl = url;
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
}];
[QXMineNetwork getWalletConfigSuccessBlock:^(NSString * _Nonnull coin_exchange_rate, NSString * _Nonnull withdrawal_service_fee, NSString * _Nonnull rmb_coin_ratio) {
weakSelf.withDrawInputView.fee = withdrawal_service_fee;
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
}];
[QXMineNetwork walletPayTypeWithUserId:QXGlobal.shareGlobal.loginModel.user_id successBlock:^(QXPayTypeStatusModel * _Nonnull model) {
[weakSelf.dataArray removeAllObjects];
if (model.wx.is_with_draw_open.intValue == 1 && model.wx.is_bind.intValue == 1) {
[weakSelf.dataArray addObject:model.wx];
}
if (model.ali.is_pay_open.intValue == 1 && model.ali.is_bind.intValue == 1) {
[weakSelf.dataArray addObject:model.ali];
}
if (model.bank.is_pay_open.intValue == 1 && model.bank.is_bind.intValue == 1) {
[weakSelf.dataArray addObject:model.bank];
}
[weakSelf.tableView reloadData];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
}];
}
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
[self.view endEditing:YES];
}
-(void)withDrawAction:(UIButton*)sender{
if (self.agreeBtn.selected == NO) {
showToast(@"请先阅读并同意灵活就业协议");
return;
}
if (self.withDrawInputView.textField.text.longValue == 0) {
showToast(@"请输入提现金额");
return;
}
MJWeakSelf
QXReVerificationPopView *popView = [[QXReVerificationPopView alloc] initWithFrame:CGRectMake(0, 0, ScaleWidth(300), ScaleWidth(200))];
popView.commitBlock = ^(NSString * _Nonnull code) {
QXLOG(@"验证码为%@",code);
[[QXGlobal shareGlobal] hideViewBlock:^{
[weakSelf withDrawNetworkWithCode:code];
}];
};
[[QXGlobal shareGlobal] showView:popView popType:(PopViewTypeTopToCenter) tapDismiss:NO finishBlock:^{
}];
}
-(void)withDrawNetworkWithCode:(NSString*)code{
MJWeakSelf
showLoadingInView(self.view);
[QXMineNetwork walletWithDrawWithNumber:self.withDrawInputView.textField.text type:self.selectedPayTypeModel.type sms_code:code successBlock:^(NSDictionary * _Nonnull dict) {
hideLoadingInView(weakSelf.view);
showToast(@"提现成功");
[self getPrice];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
hideLoadingInView(weakSelf.view);
showToast(msg);
}];
}
#pragma mark - UITableViewDelegate,UITableViewDataSource
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return self.dataArray.count;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
QXWithDrawTypeCell *cell = [QXWithDrawTypeCell cellWithTableView:tableView];
cell.model = self.dataArray[indexPath.row];
return cell;
}
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
UIView *header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 35)];
UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(16, 0, SCREEN_WIDTH-32, 35)];
titleLabel.font = [UIFont boldSystemFontOfSize:16];
titleLabel.textColor = QXConfig.textColor;
titleLabel.text = QXText(@"提现方式");
[header addSubview:titleLabel];
return header;
}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
return 35;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
QXPayTypeModel *model = self.dataArray[indexPath.row];
if (model == self.selectedPayTypeModel) {
return;
}
if (self.selectedPayTypeModel) {
self.selectedPayTypeModel.isSelected = NO;
}
model.isSelected = YES;
self.selectedPayTypeModel = model;
[tableView reloadData];
}
#pragma mark - QXWithDrawInputViewDelegate
-(void)didClickAll{
if (self.topView.coin.intValue == 0) {
self.withDrawInputView.textField.text = @"0";
}else{
// self.withDrawInputView.textField.text = self.topView.coin;
self.withDrawInputView.textField.text = [NSString stringWithFormat:@"%ld",self.topView.coin.longValue];
}
}
-(QXWalletTopView *)topView{
if (!_topView) {
_topView = [[QXWalletTopView alloc] init];
_topView.type = QXWalletTopViewTypeWithDraw;
}
return _topView;
}
-(QXWithDrawInputView *)withDrawInputView{
if (!_withDrawInputView) {
_withDrawInputView = [[QXWithDrawInputView alloc] init];
_withDrawInputView.delegate = self;
_withDrawInputView.type = QXWithDrawInputViewTypeWithDraw;
}
return _withDrawInputView;
}
-(UITableView *)tableView{
if (!_tableView) {
_tableView = [[UITableView alloc] initWithFrame:CGRectZero style:(UITableViewStyleGrouped)];
_tableView.dataSource = self;
_tableView.delegate = self;
_tableView.backgroundColor = [UIColor clearColor];
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
_tableView.rowHeight = 40;
_tableView.keyboardDismissMode = UIScrollViewKeyboardDismissModeOnDrag;
}
return _tableView;
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
-(void)agreeAction:(UIButton*)sender{
self.agreeBtn.selected = !self.agreeBtn.selected;
}
@end