From 16bc249e331e49f67cf0603d0b0d562a9a264301 Mon Sep 17 00:00:00 2001 From: ZCM <772112648@qq.com> Date: Wed, 15 Apr 2020 09:37:54 +0800 Subject: [PATCH] 1 --- lib/home/MoneyPage.dart | 38 +++++++++++++++----------- lib/home/MoneyPageOld.dart | 2 +- lib/home/WhiteAndBlackList.dart | 4 +++ lib/home/homeMain.dart | 1 - lib/utils/local_notification_util.dart | 6 ++-- 5 files changed, 30 insertions(+), 21 deletions(-) diff --git a/lib/home/MoneyPage.dart b/lib/home/MoneyPage.dart index ab8f7e8..d753697 100644 --- a/lib/home/MoneyPage.dart +++ b/lib/home/MoneyPage.dart @@ -138,26 +138,31 @@ class MoneyPageState extends State CustomUI.buildConfirmBotton(I18n.of(context).determine, () async { var m; 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; } if (m > Provider.of(context).money) { - showToast(I18n.of(context).not_enough); + showToast(I18n.of(context).not_enough, position: ToastPosition.top); return; } 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; } 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; } @@ -170,7 +175,7 @@ class MoneyPageState extends State Response res = await HttpUtil().post('wallet/draw/order', data: data); Map resData = res.data; - showToast(resData['msg']); + showToast(resData['msg'], position: ToastPosition.top); if (resData['code'] == 0) { Navigator.of(context).pop(); UserData().incomeMoney -= m; @@ -237,19 +242,21 @@ class MoneyPageState extends State CustomUI.buildConfirmBotton(I18n.of(context).determine, () async { var m; 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; } if (m > maxMoney) { - showToast(I18n.of(context).not_enough); + showToast(I18n.of(context).not_enough, position: ToastPosition.top); return; } 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; } @@ -262,7 +269,7 @@ class MoneyPageState extends State Response res = await HttpUtil().post('/wallet/income/exchange', data: data); Map resData = res.data; - showToast(resData['msg']); + showToast(resData['msg'], position: ToastPosition.top); if (resData['code'] == 0) { Navigator.of(context).pop(); UserData().incomeMoney -= m; @@ -684,7 +691,6 @@ class MoneyPageState extends State ], ), InkWell( - onTap: () { launch( "http://datechatagent.chengyouhd.com/zh-CN/Home/WithdrawalRole?language=${UserData().language}"); diff --git a/lib/home/MoneyPageOld.dart b/lib/home/MoneyPageOld.dart index 8d50c30..aec1765 100644 --- a/lib/home/MoneyPageOld.dart +++ b/lib/home/MoneyPageOld.dart @@ -751,7 +751,7 @@ class MoneyPageOldState extends State data['Status'] == 1), money: isAdd(isMyself, data['DetailType']) ? data['Value'] : -data['Value'], - title: RichTitle.getRichTitleWidget(data, context, InfoType.Money, + title: RichTitle.getRichTitleWidget(data, context, InfoType.IncomeMoney, titleStyle: TextStyle(fontSize: 12, color: const Color(0XFF7F7F7F)), nameStyle: TextStyle( fontWeight: FontWeight.normal, diff --git a/lib/home/WhiteAndBlackList.dart b/lib/home/WhiteAndBlackList.dart index b6a732f..d3b5ed1 100644 --- a/lib/home/WhiteAndBlackList.dart +++ b/lib/home/WhiteAndBlackList.dart @@ -43,9 +43,13 @@ class _WhiteAndBlackPageState extends State { var item = list[i]; if (item['FollowUserId'] == data['UserId'] && data['flag'] != 0) { list.removeAt(i); + break; } } + if (list.length == 0) { + _refreshController.refreshCompleted(); + } setState(() {}); } diff --git a/lib/home/homeMain.dart b/lib/home/homeMain.dart index 9c396dc..a1cc433 100644 --- a/lib/home/homeMain.dart +++ b/lib/home/homeMain.dart @@ -6,7 +6,6 @@ import 'package:chat/data/translate_hk_data_mgr.dart'; import 'package:chat/generated/i18n.dart'; import 'package:chat/home/SystemEditPage.dart'; import 'package:chat/home/find_page.dart'; -import 'package:chat/home/realtimehelper/real_time_helper_page.dart'; import 'package:chat/home/unread_dot_widget.dart'; import 'package:chat/models/UserInfo.dart'; import 'package:chat/models/ref_name_provider.dart'; diff --git a/lib/utils/local_notification_util.dart b/lib/utils/local_notification_util.dart index 1ea3828..cdc4ca6 100644 --- a/lib/utils/local_notification_util.dart +++ b/lib/utils/local_notification_util.dart @@ -248,7 +248,7 @@ class LocalNotificationUtil { payload = PAYLOAD_OTHER + '@' + InfoType.Apply.toString(); break; case 4: - payload = PAYLOAD_OTHER + '@' + InfoType.Money.toString(); + payload = PAYLOAD_OTHER + '@' + InfoType.IncomeMoney.toString(); break; case 5: payload = PAYLOAD_OTHER + '@' + InfoType.System.toString(); @@ -296,7 +296,7 @@ class LocalNotificationUtil { title = I18n.of(mContext).application_notice; break; - case InfoType.Money: + case InfoType.IncomeMoney: title = I18n.of(mContext).wallet_reminder; break; @@ -351,7 +351,7 @@ class LocalNotificationUtil { break; case 4: needPush = UserData().checkPhotoSwitch; - payload = PAYLOAD_OTHER + '@' + InfoType.Money.toString(); + payload = PAYLOAD_OTHER + '@' + InfoType.IncomeMoney.toString(); break; case 5: needPush = UserData().codeSucessSwitch;