|
@@ -138,26 +138,31 @@ class MoneyPageState extends State<MoneyPage> |
|
|
CustomUI.buildConfirmBotton(I18n.of(context).determine, () async {
|
|
|
CustomUI.buildConfirmBotton(I18n.of(context).determine, () async {
|
|
|
var m;
|
|
|
var m;
|
|
|
if (money == null || money == '' || (m = int.parse(money)) == 0) {
|
|
|
if (money == null || money == '' || (m = int.parse(money)) == 0) {
|
|
|
showToast(I18n.of(context).enter_num_qian1);
|
|
|
|
|
|
|
|
|
showToast(I18n.of(context).enter_num_qian1,
|
|
|
|
|
|
position: ToastPosition.top);
|
|
|
return;
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
if (m > Provider.of<MoneyChangeProvider>(context).money) {
|
|
|
if (m > Provider.of<MoneyChangeProvider>(context).money) {
|
|
|
showToast(I18n.of(context).not_enough);
|
|
|
|
|
|
|
|
|
showToast(I18n.of(context).not_enough, position: ToastPosition.top);
|
|
|
return;
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
if (m < minMoney) {
|
|
|
if (m < minMoney) {
|
|
|
showToast(I18n.of(context)
|
|
|
|
|
|
.little_min
|
|
|
|
|
|
.replaceFirst('/s1', (minMoney * 1000).toString()));
|
|
|
|
|
|
|
|
|
showToast(
|
|
|
|
|
|
I18n.of(context)
|
|
|
|
|
|
.little_min
|
|
|
|
|
|
.replaceFirst('/s1', (minMoney * 1000).toString()),
|
|
|
|
|
|
position: ToastPosition.top);
|
|
|
return;
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
if (m > maxMoney) {
|
|
|
if (m > maxMoney) {
|
|
|
showToast(I18n.of(context)
|
|
|
|
|
|
.more_big
|
|
|
|
|
|
.replaceFirst('/s1', (maxMoney * 1000).toString()));
|
|
|
|
|
|
|
|
|
showToast(
|
|
|
|
|
|
I18n.of(context)
|
|
|
|
|
|
.more_big
|
|
|
|
|
|
.replaceFirst('/s1', (maxMoney * 1000).toString()),
|
|
|
|
|
|
position: ToastPosition.top);
|
|
|
return;
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
@@ -170,7 +175,7 @@ class MoneyPageState extends State<MoneyPage> |
|
|
|
|
|
|
|
|
Response res = await HttpUtil().post('wallet/draw/order', data: data);
|
|
|
Response res = await HttpUtil().post('wallet/draw/order', data: data);
|
|
|
Map resData = res.data;
|
|
|
Map resData = res.data;
|
|
|
showToast(resData['msg']);
|
|
|
|
|
|
|
|
|
showToast(resData['msg'], position: ToastPosition.top);
|
|
|
if (resData['code'] == 0) {
|
|
|
if (resData['code'] == 0) {
|
|
|
Navigator.of(context).pop();
|
|
|
Navigator.of(context).pop();
|
|
|
UserData().incomeMoney -= m;
|
|
|
UserData().incomeMoney -= m;
|
|
@@ -237,19 +242,21 @@ class MoneyPageState extends State<MoneyPage> |
|
|
CustomUI.buildConfirmBotton(I18n.of(context).determine, () async {
|
|
|
CustomUI.buildConfirmBotton(I18n.of(context).determine, () async {
|
|
|
var m;
|
|
|
var m;
|
|
|
if (money == null || money == '' || (m = int.parse(money)) == 0) {
|
|
|
if (money == null || money == '' || (m = int.parse(money)) == 0) {
|
|
|
showToast(I18n.of(context).enter_num_qian);
|
|
|
|
|
|
|
|
|
showToast(I18n.of(context).enter_num_qian, position: ToastPosition.top);
|
|
|
return;
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
if (m > maxMoney) {
|
|
|
if (m > maxMoney) {
|
|
|
showToast(I18n.of(context).not_enough);
|
|
|
|
|
|
|
|
|
showToast(I18n.of(context).not_enough, position: ToastPosition.top);
|
|
|
return;
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
if (m < minMoney) {
|
|
|
if (m < minMoney) {
|
|
|
showToast(I18n.of(context)
|
|
|
|
|
|
.little_min
|
|
|
|
|
|
.replaceFirst('/s1', minMoney.toString()));
|
|
|
|
|
|
|
|
|
showToast(
|
|
|
|
|
|
I18n.of(context)
|
|
|
|
|
|
.little_min
|
|
|
|
|
|
.replaceFirst('/s1', minMoney.toString()),
|
|
|
|
|
|
position: ToastPosition.top);
|
|
|
return;
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
@@ -262,7 +269,7 @@ class MoneyPageState extends State<MoneyPage> |
|
|
Response res =
|
|
|
Response res =
|
|
|
await HttpUtil().post('/wallet/income/exchange', data: data);
|
|
|
await HttpUtil().post('/wallet/income/exchange', data: data);
|
|
|
Map resData = res.data;
|
|
|
Map resData = res.data;
|
|
|
showToast(resData['msg']);
|
|
|
|
|
|
|
|
|
showToast(resData['msg'], position: ToastPosition.top);
|
|
|
if (resData['code'] == 0) {
|
|
|
if (resData['code'] == 0) {
|
|
|
Navigator.of(context).pop();
|
|
|
Navigator.of(context).pop();
|
|
|
UserData().incomeMoney -= m;
|
|
|
UserData().incomeMoney -= m;
|
|
@@ -684,7 +691,6 @@ class MoneyPageState extends State<MoneyPage> |
|
|
],
|
|
|
],
|
|
|
),
|
|
|
),
|
|
|
InkWell(
|
|
|
InkWell(
|
|
|
|
|
|
|
|
|
onTap: () {
|
|
|
onTap: () {
|
|
|
launch(
|
|
|
launch(
|
|
|
"http://datechatagent.chengyouhd.com/zh-CN/Home/WithdrawalRole?language=${UserData().language}");
|
|
|
"http://datechatagent.chengyouhd.com/zh-CN/Home/WithdrawalRole?language=${UserData().language}");
|
|
|