From 45b1c0e6d708d2dcb62686afa46a9fa610e3dbde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E5=8D=8E=E8=BD=A9?= <646903573@qq.com> Date: Tue, 17 Nov 2020 11:27:32 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=8F=90=E7=8E=B0=20-=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E6=97=A0=E6=B3=95=E6=8F=90=E7=8E=B0?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/withdraw_page/withdraw_page.dart | 52 ++++++++++++++++------ 1 file changed, 38 insertions(+), 14 deletions(-) diff --git a/lib/pages/withdraw_page/withdraw_page.dart b/lib/pages/withdraw_page/withdraw_page.dart index 31293bc..9b7d480 100644 --- a/lib/pages/withdraw_page/withdraw_page.dart +++ b/lib/pages/withdraw_page/withdraw_page.dart @@ -363,10 +363,28 @@ class _WithdrawContainerState extends State<_WithdrawContainer> { } Widget _createSubmit(WithdrawModel model) { - - String value = model.cashOutDashbordItems[_currentIndex].value; + // String value = model.cashOutDashbordItems[_currentIndex].value; + // try { + // if (num.tryParse(value) != null && + // null != _bloc.withdrawDataModel && + // num.tryParse(value) < + // num.tryParse(_bloc.withdrawDataModel.finValue)) { + // _submitable = true; + // } else { + // _submitable = false; + // } + // } catch (e, s) { + // print(e); + // print(s); + // } try { - if (num.tryParse(value) != null && null != _bloc.withdrawDataModel && num.tryParse(value) < num.tryParse(_bloc.withdrawDataModel.finValue)) { + var currentWithdraw = num.tryParse(_controller.text); + var finValue = num.tryParse(_bloc.withdrawDataModel.finValue); + if (currentWithdraw != null && + currentWithdraw != 0 && + finValue != null && + finValue != 0 && + currentWithdraw <= finValue) { _submitable = true; } else { _submitable = false; @@ -434,18 +452,24 @@ class _WithdrawContainerState extends State<_WithdrawContainer> { ); } + ///检查提现按钮是否可用 void _checkSubmit(String value) { - try { - if (num.tryParse(value) != null && - num.tryParse(value) < num.tryParse(_bloc.withdrawDataModel.finValue)) { - _submitable = true; - } else { - _submitable = false; - } - } catch (e, s) { - print(e); - print(s); - } + // try { + // var currentValue = num.tryParse(value); + // var finValue = num.tryParse(_bloc.withdrawDataModel.finValue); + // + // if (currentValue != null && + // currentValue != 0 && + // currentValue <= finValue && + // finValue != 0) { + // _submitable = true; + // } else { + // _submitable = false; + // } + // } catch (e, s) { + // print(e); + // print(s); + // } setState(() {}); } }