YOUPAIHRChatRoomGuildBalanceVC.m 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483
  1. #import "YOUPAIHRChatRoomGuildBalanceVC.h"
  2. #import "IQActionSheetPickerView.h"
  3. #import "LZPickerWindow.h"
  4. #import "UIViewController+TFPresent.h"
  5. #import "PGPickerView.h"
  6. #import "YOUPAILZProfitListVC.h"
  7. #import "YOUPAIHRGuildDetailVC.h"
  8. @interface YOUPAIHRChatRoomGuildBalanceVC ()<IQActionSheetPickerViewDelegate,LZPickerWindowDelegate,PGPickerViewDelegate,PGPickerViewDataSource,UIScrollViewDelegate>
  9. @property (nonatomic, weak) UILabel *youpaipprofitL; // 收益的钻石
  10. @property (nonatomic, weak) UILabel *youpaipprofitMoneyL; // 收益的钻石等于多少钱
  11. @property (nonatomic, strong) UITextField *youpaipnameTextField;
  12. @property (nonatomic, strong) UITextField *youpaipaccountTextField;
  13. @property (nonatomic, strong) UILabel *youpaipmoneyLabel;
  14. @property (nonatomic, strong) UIButton *youpaipwithdrawBtn;
  15. @property(nonatomic,assign)NSInteger youpaipmin_money;//收益的余额
  16. @property(nonatomic,assign)CGFloat youpaipincome_money;//收益的余额
  17. @property(nonatomic,strong)NSMutableArray* youpaipmoneyArray;
  18. @property(nonatomic,strong)NSString* youpaipname;//真实姓名
  19. @property(nonatomic,strong)NSString* youpaipaccount;//账号
  20. @property(nonatomic,assign)NSInteger youpaipverify;//账户是否通过认证
  21. @property (nonatomic, strong) NSString *youpaipselectedMoney;
  22. @end
  23. @implementation YOUPAIHRChatRoomGuildBalanceVC
  24. - (void)youpaifinitData{
  25. [LCHttpHelper requestWithURLString:WalletWithdraw parameters:nil needToken:YES type:(HttpRequestTypePost) success:^(id responseObject) {
  26. NSDictionary* dict = (NSDictionary*)responseObject;
  27. NSInteger code = [[dict objectForKey:@"code"] integerValue];
  28. if (code==0) {//成功
  29. self.youpaipverify = [[[dict objectForKey:@"data"]objectForKey:LCStr(word39)] integerValue];
  30. self.youpaipmin_money = [[[dict objectForKey:@"data"]objectForKey:@"min_money"] integerValue];
  31. self.youpaipmoneyArray = [[dict objectForKey:@"data"]objectForKey:@"list"];
  32. self.youpaipaccount = [[dict objectForKey:@"data"]objectForKey:LCStr(word40)];
  33. self.youpaipname = [[dict objectForKey:@"data"]objectForKey:LCStr(word41)];
  34. self.youpaipincome_money = [[[dict objectForKey:@"data"]objectForKey:@"income_money"] floatValue];
  35. [self youpaifupdateData];
  36. }else{
  37. [ZCHUDHelper showTitle:dict[@"message"]];
  38. }
  39. }failure:^(NSError *error) {
  40. }];
  41. }
  42. - (void)youpaifupdateData{
  43. self.youpaipnameTextField.text = self.youpaipname;
  44. self.youpaipaccountTextField.text = self.youpaipaccount;
  45. if (self.youpaipaccount.length >0 && self.youpaipverify==1) {
  46. self.youpaipnameTextField.enabled = NO;
  47. self.youpaipaccountTextField.enabled = NO;
  48. }else{
  49. self.youpaipnameTextField.enabled = YES;
  50. self.youpaipaccountTextField.enabled = YES;
  51. }
  52. if (self.youpaipincome_money>self.youpaipmin_money) {
  53. self.youpaipmoneyLabel.text = [NSString stringWithFormat:@"%zd",self.youpaipmin_money];
  54. }else{
  55. self.youpaipmoneyLabel.text = @"0";
  56. }
  57. [self youpaifverifyWithdrawBtn];
  58. }
  59. - (void)youpaifverifyWithdrawBtn{
  60. if ( [self.youpaipnameTextField.text isEqualToString:@""]||[self.youpaipaccountTextField.text isEqualToString:@""]||[self.youpaipmoneyLabel.text isEqualToString:@""]){
  61. [self.youpaipwithdrawBtn setBackgroundImage:nil forState:(UIControlStateNormal)];
  62. self.youpaipwithdrawBtn.userInteractionEnabled = NO;
  63. }else{
  64. [self.youpaipwithdrawBtn setBackgroundImage:[LCTools ColorImage:self.youpaipwithdrawBtn.frame.size FromColors:@[HexColorFromRGB(0xFFD33F),HexColorFromRGB(0xF37A19)] ByGradientType:(GradientLeftToRight)] forState:(UIControlStateNormal)];
  65. self.youpaipwithdrawBtn.userInteractionEnabled = YES;
  66. }
  67. }
  68. - (void)viewDidLoad {
  69. [super viewDidLoad];
  70. self.youpaipmoneyArray = [NSMutableArray array];
  71. self.title = LCStr(word9);//@"我的收益";
  72. [self youpaifinitUI];
  73. [self youpaifrequestWalleetInfo];
  74. [self youpaifinitData];
  75. }
  76. - (void)youpaifinitUI{
  77. self.navigationItem.rightBarButtonItem = [UIBarButtonItem itemWithTarget:self action:@selector(youpaifprofitAction) title:@"查看明细" font:LCFont14 titleColor:HexColorFromRGB(0xffffff) highlightedColor:HexColorFromRGB(0xffffff) titleEdgeInsets:UIEdgeInsetsZero];
  78. UIScrollView *scrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(0.0f, NavBarHeight, KScreenWidth, KScreenHeight - NavBarHeight)];
  79. scrollView.showsVerticalScrollIndicator = NO;
  80. scrollView.showsHorizontalScrollIndicator = NO;
  81. scrollView.delegate = self;
  82. [self.view addSubview:scrollView];
  83. UIImageView *headerImgV = [[UIImageView alloc] init];
  84. headerImgV.image = [UIImage imageNamed:@"vqu_images_profit_bg"];
  85. [scrollView addSubview:headerImgV];
  86. [headerImgV mas_makeConstraints:^(MASConstraintMaker *make) {
  87. make.left.offset(14.0f);
  88. make.width.offset(KScreenWidth - 28.0f);
  89. make.top.offset(10.0f);
  90. make.height.offset(128.0f);
  91. }];
  92. UILabel *profitDescL = [[UILabel alloc] init];
  93. profitDescL.font = LCFont14;
  94. profitDescL.text = LCStr(word9);//@"我的收益";
  95. profitDescL.textColor = [UIColor whiteColor];
  96. [headerImgV addSubview:profitDescL];
  97. [profitDescL mas_makeConstraints:^(MASConstraintMaker *make) {
  98. make.left.offset(28.0f);
  99. make.top.offset(31.0f);
  100. }];
  101. UILabel *youpaipprofitL = [[UILabel alloc] init];
  102. youpaipprofitL.font = LCFont(36.0f);
  103. youpaipprofitL.text = @"0";
  104. youpaipprofitL.textColor = [UIColor whiteColor];
  105. [headerImgV addSubview:youpaipprofitL];
  106. self.youpaipprofitL = youpaipprofitL;
  107. [youpaipprofitL mas_makeConstraints:^(MASConstraintMaker *make) {
  108. make.left.offset(28.0f);
  109. make.top.equalTo(profitDescL.mas_bottom).offset(16.0f);
  110. }];
  111. UILabel *youpaipprofitMoneyL = [[UILabel alloc] init];
  112. youpaipprofitMoneyL.font = LCFont(17.0f);
  113. youpaipprofitMoneyL.text = @"= 0元";
  114. youpaipprofitMoneyL.textColor = [UIColor whiteColor];
  115. [headerImgV addSubview:youpaipprofitMoneyL];
  116. self.youpaipprofitMoneyL = youpaipprofitMoneyL;
  117. [youpaipprofitMoneyL mas_makeConstraints:^(MASConstraintMaker *make) {
  118. make.left.equalTo(youpaipprofitL.mas_right).offset(8.0f);
  119. make.top.equalTo(youpaipprofitL.mas_centerY).offset(-6.0f);
  120. }];
  121. UILabel *labe1 = [[UILabel alloc] init];
  122. labe1.text = LCStr(word6);//@"请输入提现支付宝账户:";
  123. labe1.textColor = HexColorFromRGB(0x9F9DA5);
  124. labe1.font = LCFont(12);
  125. [scrollView addSubview:labe1];
  126. [labe1 mas_makeConstraints:^(MASConstraintMaker *make) {
  127. make.left.offset(14.0f);
  128. make.top.equalTo(headerImgV.mas_bottom).offset(20.0f);
  129. }];
  130. UIView *nameView = [[UIView alloc] initWithFrame:CGRectMake(12,CGRectGetMaxY(labe1.frame) + 12.0f,KScreenWidth-24,48)];
  131. nameView.backgroundColor = HexColorFromRGB(0x2A2935);
  132. nameView.layer.cornerRadius = 5;
  133. nameView.layer.masksToBounds = YES;
  134. [scrollView addSubview:nameView];
  135. [nameView mas_makeConstraints:^(MASConstraintMaker *make) {
  136. make.left.offset(14.0f);
  137. make.top.equalTo(labe1.mas_bottom).offset(12.0f);
  138. make.width.offset(KScreenWidth - 28.0f);
  139. make.height.offset(48.0f);
  140. }];
  141. UILabel* nameTipLabel = [[UILabel alloc]init];
  142. nameTipLabel.text = @"真实姓名:";
  143. nameTipLabel.textColor = [UIColor whiteColor];
  144. nameTipLabel.font = LCFont14;
  145. [nameView addSubview:nameTipLabel];
  146. [nameTipLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  147. make.left.offset(12.0f);
  148. make.top.bottom.offset(0.0f);
  149. make.width.offset(80.0f);
  150. }];
  151. UITextField* youpaipnameTextField = [[UITextField alloc]init];
  152. self.youpaipnameTextField = youpaipnameTextField;
  153. youpaipnameTextField.tintColor = ZYPinkColor;
  154. youpaipnameTextField.textColor = [UIColor whiteColor];
  155. youpaipnameTextField.clearButtonMode = UITextFieldViewModeWhileEditing;
  156. [[youpaipnameTextField valueForKey:@"_clearButton"] setImage:[UIImage imageNamed:@"vqu_images_D_nick_clean"] forState:UIControlStateNormal];
  157. [youpaipnameTextField addTarget:self action:@selector(textFieldDidEditing:) forControlEvents:UIControlEventEditingChanged];
  158. NSMutableAttributedString* attrStrName = [[NSMutableAttributedString alloc]initWithString:LCStr(word42)];//@"请输入支付宝实名认证名字"
  159. [attrStrName addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:12] range:NSMakeRange(0, attrStrName.length)];
  160. [attrStrName addAttribute:NSForegroundColorAttributeName value:HexColorFromRGB(0x6C6B70) range:NSMakeRange(0, attrStrName.length)];
  161. youpaipnameTextField.attributedPlaceholder = attrStrName;
  162. [nameView addSubview:youpaipnameTextField];
  163. [youpaipnameTextField mas_makeConstraints:^(MASConstraintMaker *make) {
  164. make.left.equalTo(nameTipLabel.mas_right).offset(0.0f);
  165. make.top.bottom.offset(0.0f);
  166. make.right.offset(-12.0f);
  167. }];
  168. UIView *accountView = [[UIView alloc] init];
  169. accountView.backgroundColor = HexColorFromRGB(0x2A2935);
  170. accountView.layer.cornerRadius = 5;
  171. accountView.layer.masksToBounds = YES;
  172. [scrollView addSubview:accountView];
  173. [accountView mas_makeConstraints:^(MASConstraintMaker *make) {
  174. make.left.offset(14.0f);
  175. make.top.equalTo(nameView.mas_bottom).offset(7.0f);
  176. make.width.offset(KScreenWidth - 28.0f);
  177. make.height.offset(48.0f);
  178. }];
  179. UILabel* accountTipLabel = [[UILabel alloc]init];
  180. accountTipLabel.text = LCStr(word7);//@"支付宝账号:";
  181. accountTipLabel.textColor = [UIColor whiteColor];
  182. accountTipLabel.font = LCFont14;
  183. [accountView addSubview:accountTipLabel];
  184. [accountTipLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  185. make.left.offset(12.0f);
  186. make.top.bottom.offset(0.0f);
  187. make.width.offset(94.0f);
  188. }];
  189. UITextField* youpaipaccountTextField = [[UITextField alloc]init];
  190. self.youpaipaccountTextField = youpaipaccountTextField;
  191. youpaipaccountTextField.tintColor = ZYPinkColor;
  192. youpaipaccountTextField.textColor = [UIColor whiteColor];
  193. youpaipaccountTextField.clearButtonMode = UITextFieldViewModeWhileEditing;
  194. [[youpaipaccountTextField valueForKey:@"_clearButton"] setImage:[UIImage imageNamed:@"vqu_images_D_nick_clean"] forState:UIControlStateNormal];
  195. [youpaipaccountTextField addTarget:self action:@selector(textFieldDidEditing:) forControlEvents:UIControlEventEditingChanged];
  196. NSMutableAttributedString* attrStrAccount = [[NSMutableAttributedString alloc]initWithString:LCStr(word8)];//请输入支付宝账号
  197. [attrStrAccount addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:12] range:NSMakeRange(0, attrStrAccount.length)];
  198. [attrStrAccount addAttribute:NSForegroundColorAttributeName value:HexColorFromRGB(0x6C6B70) range:NSMakeRange(0, attrStrAccount.length)];
  199. youpaipaccountTextField.attributedPlaceholder = attrStrAccount;
  200. [accountView addSubview:youpaipaccountTextField];
  201. [youpaipaccountTextField mas_makeConstraints:^(MASConstraintMaker *make) {
  202. make.left.equalTo(accountTipLabel.mas_right).offset(0.0f);
  203. make.top.bottom.offset(0.0f);
  204. make.right.offset(-12.0f);
  205. }];
  206. UILabel* botLabel = [[UILabel alloc]init];
  207. botLabel.text = LCStr(word26);//@"注:真实姓名需与支付宝实名认证相同,否则无法到账";
  208. botLabel.textColor = HexColorFromRGB(0x6C6B70);
  209. botLabel.font = LCFont(10);
  210. botLabel.textAlignment = NSTextAlignmentLeft;
  211. [scrollView addSubview:botLabel];
  212. [botLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  213. make.left.offset(14.0f);
  214. make.top.equalTo(accountView.mas_bottom).offset(7.0f);
  215. }];
  216. UILabel* moneyTip = [[UILabel alloc]init];
  217. moneyTip.textColor = HexColorFromRGB(0x9F9DA5);
  218. moneyTip.font = LCFont(12);
  219. moneyTip.text =LCStr(word17);//请输入提现金额(元):
  220. [scrollView addSubview:moneyTip];
  221. [moneyTip mas_makeConstraints:^(MASConstraintMaker *make) {
  222. make.left.offset(14.0f);
  223. make.top.equalTo(botLabel.mas_bottom).offset(28.0f);
  224. }];
  225. UIView *monView = [[UIView alloc] init];
  226. monView.layer.cornerRadius = 5;
  227. monView.layer.masksToBounds = YES;
  228. monView.backgroundColor = HexColorFromRGB(0x2A2935);
  229. [scrollView addSubview:monView];
  230. [monView mas_makeConstraints:^(MASConstraintMaker *make) {
  231. make.left.offset(14.0f);
  232. make.width.offset(KScreenWidth - 28.0f);
  233. make.height.offset(54.0f);
  234. make.top.equalTo(moneyTip.mas_bottom).offset(12.0f);
  235. }];
  236. UILabel* monFL = [[UILabel alloc]init];
  237. monFL.textAlignment = NSTextAlignmentCenter;
  238. monFL.textColor = [UIColor whiteColor];
  239. monFL.font = LCBoldFont(25);
  240. monFL.text = @"¥";
  241. [monView addSubview:monFL];
  242. [monFL mas_makeConstraints:^(MASConstraintMaker *make) {
  243. make.left.offset(12.0f);
  244. make.top.bottom.offset(0.0f);
  245. make.width.offset(23.0f);
  246. }];
  247. UILabel* monValue = [[UILabel alloc]init];
  248. monValue.textColor = [UIColor whiteColor];
  249. monValue.font = LCBoldFont(25);
  250. monValue.text = @"0";
  251. monValue.userInteractionEnabled = YES;
  252. [monView addSubview:monValue];
  253. [monValue mas_makeConstraints:^(MASConstraintMaker *make) {
  254. make.left.equalTo(monFL.mas_right).offset(7.0f);
  255. make.top.bottom.offset(0.0f);
  256. make.right.offset(-12.0f);
  257. }];
  258. UITapGestureRecognizer* monTap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(youpaifmonValueHandel:)];
  259. [monValue addGestureRecognizer:monTap];
  260. self.youpaipmoneyLabel = monValue;
  261. UILabel* botTipL = [[UILabel alloc] init];
  262. botTipL.textColor = HexColorFromRGB(0x6C6B70);
  263. botTipL.font = LCFont(10);
  264. botTipL.numberOfLines= 0;
  265. [scrollView addSubview:botTipL];
  266. botTipL.text =LCStr(word27);// @"1.每天可提交一次申请,1~3个工作日到账(节假日顺延);\n2.100元以下收取2%的手续费,100~500元收取1%的手续费,500元以上免手续费。";
  267. [botTipL mas_makeConstraints:^(MASConstraintMaker *make) {
  268. make.left.offset(14.0f);
  269. make.width.offset(KScreenWidth - 28.0f);
  270. make.top.equalTo(monView.mas_bottom).offset(7.0f);
  271. }];
  272. UIButton* youpaipwithdrawBtn = [[UIButton alloc]initWithFrame:CGRectMake(60, CGRectGetMaxY(botTipL.frame)+45.0f, KScreenWidth-120, 48)];
  273. youpaipwithdrawBtn.uxy_acceptEventInterval = 3.0;
  274. youpaipwithdrawBtn.userInteractionEnabled = NO;
  275. youpaipwithdrawBtn.backgroundColor = HexColorFromRGB(0x4F4B5B);
  276. youpaipwithdrawBtn.layer.cornerRadius = 24.0;
  277. youpaipwithdrawBtn.layer.masksToBounds = YES;
  278. youpaipwithdrawBtn.titleLabel.font = LCFont16;
  279. [youpaipwithdrawBtn setTitleColor:[UIColor whiteColor] forState:(UIControlStateNormal)];
  280. [youpaipwithdrawBtn setTitle:LCStr(word18) forState:(UIControlStateNormal)];//确认提现
  281. [youpaipwithdrawBtn addTarget:self action:@selector(youpaifapplyWithdraw) forControlEvents:(UIControlEventTouchUpInside)];
  282. [scrollView addSubview:youpaipwithdrawBtn];
  283. [youpaipwithdrawBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  284. make.left.offset(40.0f);
  285. make.width.offset(KScreenWidth - 80.0f);
  286. make.top.equalTo(botTipL.mas_bottom).offset(45.0f);
  287. make.height.offset(48.0f);
  288. }];
  289. self.youpaipwithdrawBtn = youpaipwithdrawBtn;
  290. [scrollView layoutIfNeeded];
  291. CGFloat height = CGRectGetMaxY(self.youpaipwithdrawBtn.frame) + 40.0f + SafeHeight;
  292. if (height < KScreenHeight - NavBarHeight) {
  293. height = KScreenHeight - NavBarHeight + 1;
  294. }
  295. scrollView.contentSize = CGSizeMake(KScreenWidth, height);
  296. }
  297. - (void)scrollViewDidScroll:(UIScrollView *)scrollView{
  298. [self.view endEditing:YES];
  299. }
  300. - (void)youpaifprofitAction{
  301. // YOUPAILZProfitListVC *vc = [[YOUPAILZProfitListVC alloc] init];
  302. // [self.navigationController pushViewController:vc animated:YES];
  303. YOUPAIHRGuildDetailVC *vc = [YOUPAIHRGuildDetailVC new];
  304. [self.navigationController pushViewController:vc animated:YES];
  305. }
  306. - (void)youpaifselectMoney:(NSString*)str{
  307. LZPickerWindow *vc = [[LZPickerWindow alloc] init];
  308. vc.isTouchDismiss = YES;
  309. vc.delegate = self;
  310. [self TFPresentVC:vc completion:^{}];
  311. vc.pickerView.dataSource = self;
  312. vc.pickerView.delegate = self;
  313. if (self.youpaipmoneyArray.count != 0) {
  314. self.youpaipselectedMoney = [NSString stringWithFormat:@"%@",self.youpaipmoneyArray[0]];
  315. }
  316. }
  317. #pragma mark - PGPickerViewDataSource
  318. // returns the number of 'columns' to display.
  319. - (NSInteger)numberOfComponentsInPickerView:(PGPickerView *)pickerView{
  320. return 1;
  321. }
  322. // returns the # of rows in each component..
  323. - (NSInteger)pickerView:(PGPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component{
  324. return self.youpaipmoneyArray.count;
  325. }
  326. - (NSString *)pickerView:(PGPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component{
  327. return [NSString stringWithFormat:@"%@",self.youpaipmoneyArray[row]];
  328. }
  329. #pragma mark - PGPickerViewDelegate
  330. - (void)pickerView:(PGPickerView *)pickerView title:(NSString *)title didSelectRow:(NSInteger)row inComponent:(NSInteger)component{
  331. self.youpaipselectedMoney = title;
  332. }
  333. #pragma mark - LZPickerWindowDelegate
  334. - (void)confirmClick{
  335. NSString* str= self.youpaipselectedMoney;
  336. if (self.youpaipincome_money< [str integerValue]) {
  337. [ZCHUDHelper showTitle:LCStr(word10)];//@"提现金额不能大于收益的余额"
  338. }else{
  339. self.youpaipmoneyLabel.text = str;
  340. [self youpaifverifyWithdrawBtn];
  341. }
  342. }
  343. - (void)actionSheetPickerView:(IQActionSheetPickerView *)pickerView didSelectTitles:(NSArray<NSString *> *)titles{
  344. if (pickerView.tag==1) {
  345. NSString* str= [titles lastObject];
  346. if (self.youpaipincome_money< [str integerValue]) {
  347. [ZCHUDHelper showTitle:LCStr(word10)];//@"提现金额不能大于收益的余额"
  348. }else{
  349. self.youpaipmoneyLabel.text = str;
  350. [self youpaifverifyWithdrawBtn];
  351. }
  352. }
  353. }
  354. - (void)youpaifmonValueHandel:(UITapGestureRecognizer*)tap{
  355. if (tap.state == UIGestureRecognizerStateEnded) {
  356. UILabel* lab = (UILabel*)tap.view;
  357. NSInteger num = [lab.text integerValue];
  358. if (num>0) {
  359. [self youpaifselectMoney:lab.text];
  360. }else{
  361. [ZCHUDHelper showTitle:[NSString stringWithFormat:@"%@%zd",LCStr(word11),self.youpaipmin_money]];//可提现余额小于最小可提现金额
  362. }
  363. }
  364. }
  365. - (void)youpaifapplyWithdraw{
  366. if (self.youpaipaccount.length >0 && self.youpaipverify==1) {
  367. //账户已绑定 直接提现
  368. [LCHttpHelper requestWithURLString:WithDrawApply parameters:@{@"money":self.youpaipmoneyLabel.text} needToken:YES type:(HttpRequestTypePost) success:^(id responseObject) {
  369. NSDictionary* dict = (NSDictionary*)responseObject;
  370. NSInteger code = [[dict objectForKey:@"code"] integerValue];
  371. if (code==0) {//成功
  372. [ZCHUDHelper showTitle: LCStr(word19)];//提现已申请成功,请耐心等待
  373. [self.navigationController popViewControllerAnimated:YES];
  374. }
  375. }failure:^(NSError *error) {
  376. }];
  377. }else{
  378. //先绑定账户再提现
  379. [LCHttpHelper requestWithURLString:WalletZFBBind parameters:@{@"card_account":self.youpaipaccountTextField.text,@"card_name":self.youpaipnameTextField.text} needToken:YES type:(HttpRequestTypePost) success:^(id responseObject) {
  380. NSDictionary* dict = (NSDictionary*)responseObject;
  381. NSInteger code = [[dict objectForKey:@"code"] integerValue];
  382. if (code==0) {//成功
  383. [LCHttpHelper requestWithURLString:WithDrawApply parameters:@{@"money":self.youpaipmoneyLabel.text} needToken:YES type:(HttpRequestTypePost) success:^(id responseObject) {
  384. NSDictionary* dict = (NSDictionary*)responseObject;
  385. NSInteger code = [[dict objectForKey:@"code"] integerValue];
  386. if (code==0) {//成功
  387. [ZCHUDHelper showTitle:LCStr(word19)];//提现已申请成功,请耐心等待
  388. [self.navigationController popViewControllerAnimated:YES];
  389. }
  390. }failure:^(NSError *error) {
  391. }];
  392. }
  393. }failure:^(NSError *error) {
  394. }];
  395. }
  396. }
  397. -(void)textFieldDidEditing:(UITextField *)textField{
  398. if ( [self.youpaipnameTextField.text isEqualToString:@""]||[self.youpaipaccountTextField.text isEqualToString:@""]||[self.youpaipmoneyLabel.text isEqualToString:@""]){
  399. [self.youpaipwithdrawBtn setBackgroundImage:nil forState:(UIControlStateNormal)];
  400. self.youpaipwithdrawBtn.userInteractionEnabled = NO;
  401. }else{
  402. [self.youpaipwithdrawBtn setBackgroundImage:[LCTools ColorImage:self.youpaipwithdrawBtn.frame.size FromColors:@[HexColorFromRGB(0xFFD33F),HexColorFromRGB(0xF37A19)] ByGradientType:(GradientLeftToRight)] forState:(UIControlStateNormal)];
  403. self.youpaipwithdrawBtn.userInteractionEnabled = YES;
  404. }
  405. }
  406. #pragma mark - Request
  407. - (void)youpaifrequestWalleetInfo{
  408. [LCHttpHelper requestWithURLString:WalletInit parameters:nil needToken:YES type:(HttpRequestTypePost) success:^(id responseObject) {
  409. NSDictionary* dict = (NSDictionary*)responseObject;
  410. NSInteger code = [[dict objectForKey:@"code"] integerValue];
  411. if (code==0) {//成功
  412. NSString *incomeCoin = [[[dict objectForKey:@"data"]objectForKey:@"account"]objectForKey:@"income_coin"];
  413. NSString *incomeMoney = [[[dict objectForKey:@"data"]objectForKey:@"account"]objectForKey:@"income_coin_money"];
  414. self.youpaipprofitL.text = [NSString stringWithFormat:@"%@",incomeCoin];
  415. self.youpaipprofitMoneyL.text = [NSString stringWithFormat:@"= %@元",incomeMoney];
  416. }
  417. } failure:^(NSError *error) {
  418. }];
  419. }
  420. @end