// // JXShenQinTiMoneyVc.m // shiku_im // // Created by 123 on 2020/5/30. // Copyright © 2020 Reese. All rights reserved. // #import "JXShenQinTiMoneyVc.h" #import "JLWithdrawalRecordViewController.h" #import "JXTiMoneyShowView.h" @interface JXShenQinTiMoneyVc () @property (weak, nonatomic) IBOutlet NSLayoutConstraint *topViewH; @property (weak, nonatomic) IBOutlet NSLayoutConstraint *topviewConstH; @property (weak, nonatomic) IBOutlet UITextField *coinTF; @property (weak, nonatomic) IBOutlet UITextField *moneyTF; @property (weak, nonatomic) IBOutlet UIButton *tijiaoBtn; @property (nonatomic,copy) NSString *coinStr; @property (nonatomic,weak) JXTiMoneyShowView *moneyShowView; @end @implementation JXShenQinTiMoneyVc - (IBAction)goback:(UIButton *)sender { if (sender.tag==0) { [g_navigation dismissViewController:self animated:YES]; }else{ JLWithdrawalRecordViewController *vc = [[JLWithdrawalRecordViewController alloc] init]; [g_navigation pushViewController:vc animated:YES]; } } - (void)tijiaoBtnClick{ [self.view endEditing:YES]; if (_moneyTF.text.length==0) { [SVProgressHUD showWithStatus:@"请输入您的提现金额"]; [SVProgressHUD dismissWithDelay:1.0]; return; } // NSString *moenyStr=[_moneyTF.text stringByReplacingOccurrencesOfString:@" " withString:@""]; if ([_coinTF.text intValue]<=[_moneyTF.text intValue]) { [SVProgressHUD showWithStatus:@"您的余额不足 不能提现"]; [SVProgressHUD dismissWithDelay:1.0]; return; } [SVProgressHUD show]; long time = (long)[[NSDate date] timeIntervalSince1970]; time = (time *1000 + g_server.timeDifference); NSString *salt = [NSString stringWithFormat:@"%ld", time]; [g_server addWithdrawlPlatformName:salt account:@"即信" amount:_moneyTF.text reason:@"" remark:@"" verifyCode:@"" userId:g_server.myself.userId userName:g_server.myself.userNickname toView:self]; } - (void)viewDidLoad { [super viewDidLoad]; self.topviewConstH.constant=JX_SCREEN_HEIGHT>=812?88:64; [self.tijiaoBtn addTarget:self action:@selector(tijiaoBtnClick) forControlEvents:UIControlEventTouchUpInside]; long time = (long)[[NSDate date] timeIntervalSince1970]; time = (time *1000 + g_server.timeDifference); NSString *salt = [NSString stringWithFormat:@"%ld", time]; [g_server getMyCoinsss:salt andToView:self]; JXTiMoneyShowView *show=[[JXTiMoneyShowView alloc]init]; show.frame=[UIScreen mainScreen].bounds; [[UIApplication sharedApplication].keyWindow addSubview:show]; self.moneyShowView=show; show.hidden=YES; [show.knowBtn addTarget:self action:@selector(addBtnClick) forControlEvents:UIControlEventTouchUpInside]; } - (void)addBtnClick{ [g_navigation dismissViewController:self animated:YES]; } - (void)didServerResultSucces:(JXConnection *)aDownload dict:(NSDictionary *)dict array:(NSArray *)array1{ [SVProgressHUD dismiss]; if ([aDownload.action isEqualToString:act_GetMyCoin]) { NSString * moneyStr = [NSString stringWithFormat:@"%@",dict[@"coin"]]; _coinStr=moneyStr; self.coinTF.text=moneyStr; } if ([aDownload.action isEqualToString:act_addWithdrawl]) { self.moneyShowView.hidden=NO; } } - (int)didServerResultFailed:(JXConnection *)aDownload dict:(NSDictionary *)dict{ [SVProgressHUD dismiss]; if ([aDownload.action isEqualToString:act_alipayTransfer] || [aDownload.action isEqualToString:act_alipayTransferV1]) { } return show_error; } - (int)didServerConnectError:(JXConnection *)aDownload error:(NSError *)error{ [SVProgressHUD dismiss]; return hide_error; } @end