134 lines
4.0 KiB
Objective-C
134 lines
4.0 KiB
Objective-C
//
|
|
// LMWalletHomepageViewController.m
|
|
// SweetParty
|
|
//
|
|
// Created by Xmac on 2024/6/7.
|
|
//
|
|
|
|
#import "LMWalletHomepageViewController.h"
|
|
#import "SPWalletJinbiVC.h"
|
|
#import "SPWalletRecordListVC.h"
|
|
#import "SPWalletModel.h"
|
|
#import "SPWalletZuanshiVC.h"
|
|
#import "SPWalletTixianVC.h"
|
|
#import "SPWalletBindBankVC.h"
|
|
#import "ZMKHBindBankVC.h"
|
|
#import "LMBindBankQianyueViewController.h"
|
|
|
|
@interface LMWalletHomepageViewController ()
|
|
|
|
@property (weak, nonatomic) IBOutlet UILabel *coinLabel;
|
|
@property (weak, nonatomic) IBOutlet UILabel *moneyLabel;
|
|
|
|
@property (nonatomic, strong) SPWalletModel *model;
|
|
@property (weak, nonatomic) IBOutlet UILabel *bindingLabel;
|
|
@property (weak, nonatomic) IBOutlet UIView *aliCover;
|
|
|
|
@property (weak, nonatomic) IBOutlet UILabel *accountLabel;
|
|
@property (weak, nonatomic) IBOutlet UIView *bankCover;
|
|
@property (weak, nonatomic) IBOutlet UILabel *bankLabel;
|
|
@property (weak, nonatomic) IBOutlet UILabel *bankBindingLabel;
|
|
|
|
@end
|
|
|
|
@implementation LMWalletHomepageViewController
|
|
|
|
- (void)viewWillAppear:(BOOL)animated
|
|
{
|
|
[super viewWillAppear:animated];
|
|
[self fetchData];
|
|
}
|
|
|
|
- (void)viewDidLoad {
|
|
[super viewDidLoad];
|
|
[self showNaviBarWithTitle:@"我的钱包"];
|
|
|
|
// [ControlCreator createButton:self.view rect:CGRectMake(ScreenWidth-65-10, yb_StatusBar_H+7, 60, 30) text:@"明细记录" font:YBMediumFont(13) color:HEXCOLOR(0x111111) backguoundColor:nil imageName:nil target:self action:@selector(onRightClick)];
|
|
|
|
WEAK_SELF;
|
|
[self.aliCover dg_Tapped:^{
|
|
SPWalletBindBankVC *vc = [[SPWalletBindBankVC alloc] init];
|
|
vc.model = weakSelf.model;
|
|
[vc pushSelf];
|
|
}];
|
|
|
|
[self.bankCover dg_Tapped:^{
|
|
LMBindBankQianyueViewController *vc = [[LMBindBankQianyueViewController alloc] init];
|
|
vc.model = weakSelf.model;
|
|
[vc pushSelf];
|
|
}];
|
|
}
|
|
|
|
- (void)onRightClick
|
|
{
|
|
SPWalletRecordListVC *vc = [[SPWalletRecordListVC alloc] init];
|
|
vc.type = 4;
|
|
[vc pushSelf];
|
|
}
|
|
|
|
- (IBAction)rechargeButtonClick:(UIButton *)sender {
|
|
SPWalletJinbiVC *Jinbiv = [[SPWalletJinbiVC alloc] init];
|
|
[Jinbiv pushSelf];
|
|
}
|
|
|
|
- (IBAction)coinSendRecordButtonClick:(UIButton *)sender {
|
|
SPWalletRecordListVC *vc = [[SPWalletRecordListVC alloc] init];
|
|
vc.type = 1;
|
|
[vc pushSelf];
|
|
}
|
|
|
|
- (IBAction)onJinbiDetail:(id)sender {
|
|
SPWalletRecordListVC *vc = [[SPWalletRecordListVC alloc] init];
|
|
vc.type = 4;
|
|
[vc pushSelf];
|
|
}
|
|
|
|
- (IBAction)onZuanshiDetail:(id)sender {
|
|
SPWalletRecordListVC *vc = [[SPWalletRecordListVC alloc] init];
|
|
vc.type = 5;
|
|
[vc pushSelf];
|
|
}
|
|
|
|
- (IBAction)tixianButtonClick:(UIButton *)sender {
|
|
SPWalletTixianVC *txvc = [[SPWalletTixianVC alloc] init];
|
|
[txvc pushSelf];
|
|
}
|
|
|
|
- (IBAction)exchangeButtonClick:(UIButton *)sender {
|
|
SPWalletZuanshiVC *exchangeVC = [[SPWalletZuanshiVC alloc] init];
|
|
[exchangeVC pushSelf];
|
|
}
|
|
|
|
|
|
- (void)fetchData {
|
|
NSDictionary *params = @{};
|
|
[[AFNetworkRequset shared] postRequestWithParams:params Path:@"api/user/get_user_withdrawal_info" Loading:NO Hud:NO Success:^(id _Nonnull responseDic) {
|
|
SPWalletModel *model = [SPWalletModel mj_objectWithKeyValues:responseDic[@"data"]];
|
|
self.model = model;
|
|
self.coinLabel.text = model.integral;
|
|
self.moneyLabel.text = model.money;
|
|
if (model.alipay_account.length > 0) {
|
|
// self.bindingLabel.text = @"已绑定";
|
|
self.bindingLabel.textColor = HEXCOLORA(0x00D195, 1);
|
|
self.bindingLabel.text = model.alipay_account;
|
|
}else{
|
|
self.bindingLabel.text = @"绑定";
|
|
self.bindingLabel.textColor = HEXCOLORA(0x999999, 1);
|
|
}
|
|
if (model.bank_card_number.length > 0) {
|
|
// self.bankBindingLabel.text = @"已绑定";
|
|
self.bankBindingLabel.textColor = HEXCOLORA(0x00D195, 1);
|
|
self.bankBindingLabel.text = model.bank_card_number;
|
|
}else{
|
|
self.bankBindingLabel.text = @"绑定";
|
|
self.bankBindingLabel.textColor = HEXCOLORA(0x999999, 1);
|
|
}
|
|
|
|
} Failure:^(id _Nonnull errorData) {
|
|
|
|
}];
|
|
}
|
|
|
|
|
|
@end
|