JXShenQinTiMoneyVc.m 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. //
  2. // JXShenQinTiMoneyVc.m
  3. // shiku_im
  4. //
  5. // Created by 123 on 2020/5/30.
  6. // Copyright © 2020 Reese. All rights reserved.
  7. //
  8. #import "JXShenQinTiMoneyVc.h"
  9. #import "JLWithdrawalRecordViewController.h"
  10. #import "JXTiMoneyShowView.h"
  11. @interface JXShenQinTiMoneyVc ()
  12. @property (weak, nonatomic) IBOutlet NSLayoutConstraint *topViewH;
  13. @property (weak, nonatomic) IBOutlet NSLayoutConstraint *topviewConstH;
  14. @property (weak, nonatomic) IBOutlet UITextField *coinTF;
  15. @property (weak, nonatomic) IBOutlet UITextField *moneyTF;
  16. @property (weak, nonatomic) IBOutlet UIButton *tijiaoBtn;
  17. @property (nonatomic,copy) NSString *coinStr;
  18. @property (nonatomic,weak) JXTiMoneyShowView *moneyShowView;
  19. @end
  20. @implementation JXShenQinTiMoneyVc
  21. - (IBAction)goback:(UIButton *)sender {
  22. if (sender.tag==0) {
  23. [g_navigation dismissViewController:self animated:YES];
  24. }else{
  25. JLWithdrawalRecordViewController *vc = [[JLWithdrawalRecordViewController alloc] init];
  26. [g_navigation pushViewController:vc animated:YES];
  27. }
  28. }
  29. - (void)tijiaoBtnClick{
  30. [self.view endEditing:YES];
  31. if (_moneyTF.text.length==0) {
  32. [SVProgressHUD showWithStatus:@"请输入您的提现金额"];
  33. [SVProgressHUD dismissWithDelay:1.0];
  34. return;
  35. }
  36. // NSString *moenyStr=[_moneyTF.text stringByReplacingOccurrencesOfString:@" " withString:@""];
  37. if ([_coinTF.text intValue]<=[_moneyTF.text intValue]) {
  38. [SVProgressHUD showWithStatus:@"您的余额不足 不能提现"];
  39. [SVProgressHUD dismissWithDelay:1.0];
  40. return;
  41. }
  42. [SVProgressHUD show];
  43. long time = (long)[[NSDate date] timeIntervalSince1970];
  44. time = (time *1000 + g_server.timeDifference);
  45. NSString *salt = [NSString stringWithFormat:@"%ld", time];
  46. [g_server addWithdrawlPlatformName:salt account:@"即信" amount:_moneyTF.text reason:@"" remark:@"" verifyCode:@"" userId:g_server.myself.userId userName:g_server.myself.userNickname toView:self];
  47. }
  48. - (void)viewDidLoad {
  49. [super viewDidLoad];
  50. self.topviewConstH.constant=JX_SCREEN_HEIGHT>=812?88:64;
  51. [self.tijiaoBtn addTarget:self action:@selector(tijiaoBtnClick) forControlEvents:UIControlEventTouchUpInside];
  52. long time = (long)[[NSDate date] timeIntervalSince1970];
  53. time = (time *1000 + g_server.timeDifference);
  54. NSString *salt = [NSString stringWithFormat:@"%ld", time];
  55. [g_server getMyCoinsss:salt andToView:self];
  56. JXTiMoneyShowView *show=[[JXTiMoneyShowView alloc]init];
  57. show.frame=[UIScreen mainScreen].bounds;
  58. [[UIApplication sharedApplication].keyWindow addSubview:show];
  59. self.moneyShowView=show;
  60. show.hidden=YES;
  61. [show.knowBtn addTarget:self action:@selector(addBtnClick) forControlEvents:UIControlEventTouchUpInside];
  62. }
  63. - (void)addBtnClick{
  64. [g_navigation dismissViewController:self animated:YES];
  65. }
  66. - (void)didServerResultSucces:(JXConnection *)aDownload dict:(NSDictionary *)dict array:(NSArray *)array1{
  67. [SVProgressHUD dismiss];
  68. if ([aDownload.action isEqualToString:act_GetMyCoin]) {
  69. NSString * moneyStr = [NSString stringWithFormat:@"%@",dict[@"coin"]];
  70. _coinStr=moneyStr;
  71. self.coinTF.text=moneyStr;
  72. }
  73. if ([aDownload.action isEqualToString:act_addWithdrawl]) {
  74. self.moneyShowView.hidden=NO;
  75. }
  76. }
  77. - (int)didServerResultFailed:(JXConnection *)aDownload dict:(NSDictionary *)dict{
  78. [SVProgressHUD dismiss];
  79. if ([aDownload.action isEqualToString:act_alipayTransfer] || [aDownload.action isEqualToString:act_alipayTransferV1]) {
  80. }
  81. return show_error;
  82. }
  83. - (int)didServerConnectError:(JXConnection *)aDownload error:(NSError *)error{
  84. [SVProgressHUD dismiss];
  85. return hide_error;
  86. }
  87. @end