diff --git a/lib/community/community_details.dart b/lib/community/community_details.dart index 1fb60389..f74a30d1 100644 --- a/lib/community/community_details.dart +++ b/lib/community/community_details.dart @@ -19,7 +19,6 @@ import 'package:huixiang/view_widget/tips_dialog.dart'; import 'package:huixiang/web/web_view/comment_list.dart'; import 'package:huixiang/web/web_view/input_comment.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; -import 'package:shared_preferences/shared_preferences.dart'; class CommunityDetails extends StatefulWidget { diff --git a/lib/home/help_farmers/help_farmers_page.dart b/lib/home/help_farmers/help_farmers_page.dart index a76f6e48..ddca54d7 100644 --- a/lib/home/help_farmers/help_farmers_page.dart +++ b/lib/home/help_farmers/help_farmers_page.dart @@ -68,7 +68,6 @@ class _HelpFarmersPage extends State { } } finally { setState(() {}); - SmartDialog.dismiss(); } } diff --git a/lib/home/home_page.dart b/lib/home/home_page.dart index 13373713..1f1d8c8c 100644 --- a/lib/home/home_page.dart +++ b/lib/home/home_page.dart @@ -192,7 +192,7 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { _loadCount += 1; if (_loadCount == 7) { _loadCount = 0; - SmartDialog.dismiss(); + SmartDialog.dismiss(status: SmartStatus.loading); String toastText = AppUtils.dioErrorTypeToString(dioErrorType); if (toastText.isNotEmpty) { SmartDialog.showToast(toastText, alignment: Alignment.center); @@ -266,7 +266,7 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { if (isRefresh) addLoadCount(); else { - SmartDialog.dismiss(); + SmartDialog.dismiss(status: SmartStatus.loading); setState(() {}); } } diff --git a/lib/home/huixiang_brand_page.dart b/lib/home/huixiang_brand_page.dart index e43d3b6c..a75d6972 100644 --- a/lib/home/huixiang_brand_page.dart +++ b/lib/home/huixiang_brand_page.dart @@ -88,7 +88,6 @@ class _BrandPage extends State with SingleTickerProviderStateMixin, A } else { refreshController.refreshFailed(); } - SmartDialog.dismiss(); refreshController.refreshCompleted(); if (mounted) setState(() {}); } diff --git a/lib/home/points_mall_page.dart b/lib/home/points_mall_page.dart index 42ae9b03..1600b7b8 100644 --- a/lib/home/points_mall_page.dart +++ b/lib/home/points_mall_page.dart @@ -132,7 +132,6 @@ class _PointsMallPage extends State _refreshController.refreshFailed(); return BaseData>()..isSuccess = false; }); - SmartDialog.dismiss(); if (baseData?.isSuccess ?? false) { if (pageNum == 1) { goods.clear(); diff --git a/lib/home/welfare_exchange.dart b/lib/home/welfare_exchange.dart index 6ae90e9a..be5fe472 100644 --- a/lib/home/welfare_exchange.dart +++ b/lib/home/welfare_exchange.dart @@ -150,7 +150,6 @@ class _WelfareExchange extends State refreshController.refreshFailed(); } } finally { - SmartDialog.dismiss(); setState(() {}); } } diff --git a/lib/home/welfare_page.dart b/lib/home/welfare_page.dart index 22b31fc9..dd2eab04 100644 --- a/lib/home/welfare_page.dart +++ b/lib/home/welfare_page.dart @@ -75,7 +75,6 @@ class _WelfarePage extends State { refreshController.refreshFailed(); return BaseData>()..isSuccess = false; }); - SmartDialog.dismiss(); if (pageGoods?.isSuccess ?? false) { goods.clear(); goods.addAll(pageGoods?.data?.list ?? []); @@ -129,7 +128,7 @@ class _WelfarePage extends State { _loadCount += 1; if (_loadCount == 2) { _loadCount = 0; - SmartDialog.dismiss(); + SmartDialog.dismiss(status: SmartStatus.loading); if (refreshController.isRefresh) refreshController.refreshCompleted(); if (mounted) setState(() {}); } diff --git a/lib/im/chat_details_page.dart b/lib/im/chat_details_page.dart index 8e8cd849..d3c4ddb4 100644 --- a/lib/im/chat_details_page.dart +++ b/lib/im/chat_details_page.dart @@ -130,7 +130,9 @@ class _ChatDetailsPage extends State }); if (scrollController.hasClients) { debugPrint("refresh-message-height: ${height} page: $page"); - scrollController.position.restoreOffset(height, initialRestore: true); + if (scrollController.position.maxScrollExtent > 0) { + scrollController.position.restoreOffset(height, initialRestore: true); + } } newmessages.addAll(messagePage.reversed.toList()); newanimatedListKey.currentState?.insertAllItems(0, messagePage.length); diff --git a/lib/im/im_view/im_page.dart b/lib/im/im_view/im_page.dart index 23322981..36a2f32d 100644 --- a/lib/im/im_view/im_page.dart +++ b/lib/im/im_view/im_page.dart @@ -240,7 +240,7 @@ class _IMPage extends State implements OnChatMessage { _refreshController.loadComplete(); _refreshController.refreshCompleted(); } - SmartDialog.dismiss(); + SmartDialog.dismiss(status: SmartStatus.loading); } @override diff --git a/lib/login/login_page.dart b/lib/login/login_page.dart index a9f6c1fd..0727e376 100644 --- a/lib/login/login_page.dart +++ b/lib/login/login_page.dart @@ -333,9 +333,7 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { "firstLoginCouponList": value.data?.firstLoginCouponList }, ); - SmartDialog.dismiss(); - } else { - SmartDialog.showToast("${value?.msg}", alignment: Alignment.center); + SmartDialog.dismiss(status: SmartStatus.loading); } }); } diff --git a/lib/login/new_login_page.dart b/lib/login/new_login_page.dart index 2c5a38f0..532a5a25 100644 --- a/lib/login/new_login_page.dart +++ b/lib/login/new_login_page.dart @@ -12,7 +12,9 @@ import 'package:get/get.dart'; import 'package:huixiang/data/base_data.dart'; import 'package:huixiang/data/channels.dart'; import 'package:huixiang/data/examine_instance.dart'; +import 'package:huixiang/data/login_info.dart'; import 'package:huixiang/data/user_entity.dart'; +import 'package:huixiang/data/user_info.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/main.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; @@ -212,27 +214,24 @@ class _NewLoginPage extends State { SmartDialog.showLoading( msg: S.of(context).zhengzaijiazai, ); - BaseData? value = await apiService?.memberLogin(param).catchError((error) { - return BaseData()..isSuccess = false; + BaseData? value = await apiService?.memberLogin(param).catchError((error) { + return BaseData()..isSuccess = false; }); // SmartDialog.showLoading(msg: S.of(context).zhengzaijiazai); if (value?.isSuccess ?? false) { var userInfo = value!.data; - ExamineInstance.instance.isExamine = userInfo.authInfo?.account == "13800138000"; - saveUserJson(userInfo.authInfo?.toJson()); + ExamineInstance.instance.isExamine = userInfo?.authInfo?.account == "13800138000"; + saveUserJson(userInfo?.authInfo?.toJson()); eventBus.fire(EventType(3)); Navigator.of(context).pushNamedAndRemoveUntil( '/router/main_page', (route) => false, arguments: { "invite": invite, - "interviewCouponList": userInfo.interviewCouponList, - "firstLoginCouponList": userInfo.firstLoginCouponList + "interviewCouponList": userInfo?.interviewCouponList, + "firstLoginCouponList": userInfo?.firstLoginCouponList }); - } else { - SmartDialog.showToast("${value?.msg}", alignment: Alignment.center); } - SmartDialog.dismiss(); } saveUserJson(userJson) { @@ -738,7 +737,6 @@ class _NewLoginPage extends State { ), GestureDetector( onTap: () { - print("11111"); // if (widget.arguments != null) { // Navigator.of(context).pop(); // } else { diff --git a/lib/message/system_message.dart b/lib/message/system_message.dart index 34735efc..66f0c8c2 100644 --- a/lib/message/system_message.dart +++ b/lib/message/system_message.dart @@ -110,7 +110,6 @@ class _SystemMessagePage extends State { _refreshController.loadComplete(); _refreshController.refreshCompleted(); } - SmartDialog.dismiss(); } RefreshController _refreshController = RefreshController(); diff --git a/lib/mine/invitation_record.dart b/lib/mine/invitation_record.dart index d930d158..78cc3d85 100644 --- a/lib/mine/invitation_record.dart +++ b/lib/mine/invitation_record.dart @@ -81,7 +81,6 @@ class _InvitationRecord extends State } else { _refreshController.refreshFailed(); } - SmartDialog.dismiss(); } @override diff --git a/lib/mine/mine_greenery.dart b/lib/mine/mine_greenery.dart index 9cceb8b2..1e23c07f 100644 --- a/lib/mine/mine_greenery.dart +++ b/lib/mine/mine_greenery.dart @@ -56,7 +56,6 @@ class _MineGreenery extends State { refreshController.refreshFailed(); return BaseData>()..isSuccess = false; }); - SmartDialog.dismiss(); if (pageGoods?.isSuccess ?? false) { if (pageGoods?.data?.list?.isNotEmpty ?? false) { setState(() { diff --git a/lib/mine/mine_page.dart b/lib/mine/mine_page.dart index 4974602f..b8d07ba4 100644 --- a/lib/mine/mine_page.dart +++ b/lib/mine/mine_page.dart @@ -208,7 +208,6 @@ class MinePageState extends State with AutomaticKeepAliveClientMixin, infoNumber = baseData?.data; _refreshController.refreshCompleted(); } - SmartDialog.dismiss(); } ///消息数量 @@ -224,7 +223,6 @@ class MinePageState extends State with AutomaticKeepAliveClientMixin, }); }); } - SmartDialog.dismiss(); } @override diff --git a/lib/mine/mine_shop_details.dart b/lib/mine/mine_shop_details.dart index f2f1a8e5..e6cbcbcd 100644 --- a/lib/mine/mine_shop_details.dart +++ b/lib/mine/mine_shop_details.dart @@ -93,11 +93,11 @@ class _MineShopDetails extends State { if (result?.latitude != null && result?.longitude != null) { vipDetail(result?.latitude, result?.longitude); } else { - SmartDialog.dismiss(); + SmartDialog.dismiss(status: SmartStatus.loading); } }).then((value) { if (!value) { - SmartDialog.dismiss(); + SmartDialog.dismiss(status: SmartStatus.loading); refreshController.refreshFailed(); } }); diff --git a/lib/mine/mine_shop_page.dart b/lib/mine/mine_shop_page.dart index 5225f40f..4c65d933 100644 --- a/lib/mine/mine_shop_page.dart +++ b/lib/mine/mine_shop_page.dart @@ -108,7 +108,6 @@ class _MineShopPage extends State with WidgetsBindingObserver { refreshController.refreshFailed(); } } finally { - SmartDialog.dismiss(); setState(() {}); } } diff --git a/lib/mine/mine_shop_recharge.dart b/lib/mine/mine_shop_recharge.dart index e562040f..1ccb6e7f 100644 --- a/lib/mine/mine_shop_recharge.dart +++ b/lib/mine/mine_shop_recharge.dart @@ -218,7 +218,7 @@ class _MineShopRecharge extends State { _loadCount += 1; if (_loadCount == 2) { _loadCount = 0; - SmartDialog.dismiss(); + SmartDialog.dismiss(status: SmartStatus.loading); if (refreshController.isRefresh) refreshController.refreshCompleted(); if (mounted) setState(() {}); } diff --git a/lib/mine/mine_view/community_follow.dart b/lib/mine/mine_view/community_follow.dart index 12428243..d87a3b85 100644 --- a/lib/mine/mine_view/community_follow.dart +++ b/lib/mine/mine_view/community_follow.dart @@ -44,14 +44,14 @@ class _CommunityFollow extends State apiService = ApiService(Dio(), context: context, token: SharedInstance.instance.token, showLoading: true); - BaseData? baseData = - await apiService?.socialInfo().catchError((onError) {}); + BaseData? baseData = await apiService?.socialInfo().catchError((onError) { + return BaseData()..isSuccess = false; + }); if (baseData?.isSuccess ?? false) { setState(() { infoNumber = baseData?.data; }); } - SmartDialog.dismiss(); } @override diff --git a/lib/mine/mine_vip/legal_right_details.dart b/lib/mine/mine_vip/legal_right_details.dart index 8d6834b1..a8aec7c9 100644 --- a/lib/mine/mine_vip/legal_right_details.dart +++ b/lib/mine/mine_vip/legal_right_details.dart @@ -64,7 +64,6 @@ class _LegalRightDetails extends State { } }); } - SmartDialog.dismiss(); } ///解绑副卡 diff --git a/lib/mine/mine_vip/mine_attainment_page.dart b/lib/mine/mine_vip/mine_attainment_page.dart index b1ef323c..c138d6d2 100644 --- a/lib/mine/mine_vip/mine_attainment_page.dart +++ b/lib/mine/mine_vip/mine_attainment_page.dart @@ -89,7 +89,6 @@ class _MineAttainmentPage extends State { showDeleteDialog(index); }); } - SmartDialog.dismiss(); } ///个人社交信息(粉丝/关注数量/成就数量) @@ -111,7 +110,6 @@ class _MineAttainmentPage extends State { refreshController.refreshCompleted(); }); } - SmartDialog.dismiss(); } _onRefresh() { diff --git a/lib/mine/mine_vip/mine_vip_core.dart b/lib/mine/mine_vip/mine_vip_core.dart index ccdd4370..999c9c82 100644 --- a/lib/mine/mine_vip/mine_vip_core.dart +++ b/lib/mine/mine_vip/mine_vip_core.dart @@ -136,7 +136,6 @@ class _MineVipCore extends State { refreshController.refreshCompleted(); refreshController.loadComplete(); } - SmartDialog.dismiss(); } ///会员权益介绍/规则/说明/储值说明 @@ -154,7 +153,6 @@ class _MineVipCore extends State { refreshController.refreshCompleted(); refreshController.loadComplete(); } - SmartDialog.dismiss(); } ///购买会员等级 diff --git a/lib/mine/recharge_page.dart b/lib/mine/recharge_page.dart index 2296a976..dc5e8938 100644 --- a/lib/mine/recharge_page.dart +++ b/lib/mine/recharge_page.dart @@ -153,7 +153,7 @@ class _RechargePage extends State { _loadCount += 1; if (_loadCount == 4) { _loadCount = 0; - SmartDialog.dismiss(); + SmartDialog.dismiss(status: SmartStatus.loading); if (refreshController.isRefresh) refreshController.refreshCompleted(); if (mounted) setState(() {}); } diff --git a/lib/mine/vip_detail_page.dart b/lib/mine/vip_detail_page.dart index e11576d6..c9a41d57 100644 --- a/lib/mine/vip_detail_page.dart +++ b/lib/mine/vip_detail_page.dart @@ -56,11 +56,11 @@ class _VipDetailPage extends State { if (result?.latitude != null && result?.longitude != null) { vipDetail(result?.latitude, result?.longitude); } else { - SmartDialog.dismiss(); + SmartDialog.dismiss(status: SmartStatus.loading); } }).then((value) { if (!value) { - SmartDialog.dismiss(); + SmartDialog.dismiss(status: SmartStatus.loading); refreshController.refreshFailed(); } }); diff --git a/lib/order/bargain_group_order.dart b/lib/order/bargain_group_order.dart index 2ca0bc91..ea2ccf3d 100644 --- a/lib/order/bargain_group_order.dart +++ b/lib/order/bargain_group_order.dart @@ -181,6 +181,7 @@ class _ExchangeHistoryList extends State ?.queryStoreInfo(activityOrderList[0].storeId ?? "") .catchError((error) { debugPrint(error.toString()); + return BaseData()..isSuccess = false; }); if (baseData?.isSuccess ?? false) { storeInfo = StoreInfo.fromJson(baseData!.data); @@ -191,7 +192,6 @@ class _ExchangeHistoryList extends State setState(() {}); } } - SmartDialog.dismiss(); } _refresh() { diff --git a/lib/order/exchange_history_page.dart b/lib/order/exchange_history_page.dart index 4437abca..964efc2c 100644 --- a/lib/order/exchange_history_page.dart +++ b/lib/order/exchange_history_page.dart @@ -183,7 +183,6 @@ class _ExchangeHistoryList extends State _refreshController.loadFailed(); } } finally { - SmartDialog.dismiss(); setState(() {}); } } diff --git a/lib/order/invoices_manage/add_invoices_title.dart b/lib/order/invoices_manage/add_invoices_title.dart index eb6024eb..f140dff8 100644 --- a/lib/order/invoices_manage/add_invoices_title.dart +++ b/lib/order/invoices_manage/add_invoices_title.dart @@ -109,17 +109,15 @@ class _AddInvoicesTitle extends State { }).catchError((error) { SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type), alignment: Alignment.center); + return BaseData()..isSuccess = false; }); if (baseData?.isSuccess ?? false) { Navigator.of(context).pop(); Future.delayed(Duration(milliseconds: 500), () { SmartDialog.showToast("添加抬头信息成功", alignment: Alignment.center); }); - } else { - SmartDialog.showToast("${baseData?.msg}", alignment: Alignment.center); } } finally { - SmartDialog.dismiss(); } } diff --git a/lib/order/invoices_manage/edit_invoices_info.dart b/lib/order/invoices_manage/edit_invoices_info.dart index a3806948..54a74cc0 100644 --- a/lib/order/invoices_manage/edit_invoices_info.dart +++ b/lib/order/invoices_manage/edit_invoices_info.dart @@ -3,13 +3,11 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/utils/shared_preference.dart'; -import 'package:shared_preferences/shared_preferences.dart'; import 'package:shimmer/shimmer.dart'; import '../../data/base_data.dart'; import '../../generated/l10n.dart'; import '../../retrofit/retrofit_api.dart'; -import '../../utils/flutter_utils.dart'; import '../../utils/font_weight.dart'; import '../../view_widget/my_appbar.dart'; @@ -95,16 +93,12 @@ class _EditInvoicesInfo extends State { ? mobile : editPhoneController.text, //申请人手机号码 }).catchError((error) { - SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type), - alignment: Alignment.center); + return BaseData()..isSuccess = false; }); if (baseData?.isSuccess ?? false) { Navigator.of(context).pop(1); - } else { - SmartDialog.showToast("${baseData?.msg}", alignment: Alignment.center); } } finally { - SmartDialog.dismiss(); } } @@ -243,11 +237,11 @@ class _EditInvoicesInfo extends State { arguments: { "enterType": 0, }).then((value) { - if (value != null) { - invoicesInfo = value as Map?; - headerId = (value as Map)['id']; - phone = (value as Map)['phone']; - name = (value as Map)['name']; + if (value != null && value is Map) { + invoicesInfo = value; + headerId = value['id']; + phone = value['phone']; + name = value['name']; setState(() {}); } }); diff --git a/lib/order/invoices_manage/invoices_history.dart b/lib/order/invoices_manage/invoices_history.dart index 0afc6ae4..91de1eb9 100644 --- a/lib/order/invoices_manage/invoices_history.dart +++ b/lib/order/invoices_manage/invoices_history.dart @@ -99,9 +99,8 @@ class _InvoicesHistory extends State { msg: S.current.zhengzaijiazai, ); await queryInvoiceList(); - SmartDialog.dismiss(); - if (!mounted) return; if (refreshController.isRefresh) refreshController.refreshCompleted(); + if (!mounted) return; setState(() {}); } diff --git a/lib/order/invoices_manage/invoices_manage_page.dart b/lib/order/invoices_manage/invoices_manage_page.dart index f7b10415..78681a66 100644 --- a/lib/order/invoices_manage/invoices_manage_page.dart +++ b/lib/order/invoices_manage/invoices_manage_page.dart @@ -88,9 +88,8 @@ class _InvoicesManagePage extends State { msg: S.current.zhengzaijiazai, ); await queryInvoiceList(); - SmartDialog.dismiss(); - if (!mounted) return; if (refreshController.isRefresh) refreshController.refreshCompleted(); + if (!mounted) return; setState(() {}); } diff --git a/lib/order/invoices_manage/invoices_title_info.dart b/lib/order/invoices_manage/invoices_title_info.dart index ba748520..0ffdde51 100644 --- a/lib/order/invoices_manage/invoices_title_info.dart +++ b/lib/order/invoices_manage/invoices_title_info.dart @@ -58,7 +58,6 @@ class _InvoicesTitleInfo extends State { msg: S.current.zhengzaijiazai, ); await queryInvoiceHeadersList(); - SmartDialog.dismiss(); if (!mounted) return; if (refreshController.isRefresh) refreshController.refreshCompleted(); setState(() {}); @@ -123,11 +122,8 @@ class _InvoicesTitleInfo extends State { SmartDialog.showToast("删除信息成功", alignment: Alignment.center); }); networkStatus = 1; - } else { - SmartDialog.showToast("${baseData?.msg}", alignment: Alignment.center); } } finally { - SmartDialog.dismiss(); } } diff --git a/lib/order/logistics_information_page.dart b/lib/order/logistics_information_page.dart index d4fe275f..59d9b3f4 100644 --- a/lib/order/logistics_information_page.dart +++ b/lib/order/logistics_information_page.dart @@ -13,8 +13,6 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:huixiang/view_widget/my_footer.dart'; import 'package:huixiang/view_widget/no_data_view.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; -import 'package:shared_preferences/shared_preferences.dart'; - class LogisticsInformationPage extends StatefulWidget { diff --git a/lib/order/order_detail_page.dart b/lib/order/order_detail_page.dart index a44b1922..9b6aa6fc 100644 --- a/lib/order/order_detail_page.dart +++ b/lib/order/order_detail_page.dart @@ -129,11 +129,9 @@ class _OrderDetailPage extends State { setState(() { statusTitle(); }); - SmartDialog.dismiss(); refreshController.refreshCompleted(); refreshController.loadComplete(); } else { - SmartDialog.dismiss(); refreshController.refreshFailed(); refreshController.loadFailed(); } @@ -256,7 +254,6 @@ class _OrderDetailPage extends State { payResult(BaseData baseData) async { await queryDetails(); Future.delayed(Duration(milliseconds: 800), () { - SmartDialog.dismiss(); SmartDialog.showToast(baseData.msg == "ok" ? "订单支付成功" : "${baseData.msg}", alignment: Alignment.center); }); diff --git a/lib/order/order_history_page.dart b/lib/order/order_history_page.dart index 44c4c8f9..1d7ea044 100644 --- a/lib/order/order_history_page.dart +++ b/lib/order/order_history_page.dart @@ -207,7 +207,6 @@ class _OrderHistoryList extends State refreshController.loadFailed(); } } finally { - SmartDialog.dismiss(); } } @@ -592,7 +591,7 @@ class _OrderHistoryList extends State SmartDialog.show( builder: (ctx) => Tips( () { - SmartDialog.dismiss(); + SmartDialog.dismiss(status: SmartStatus.dialog); }, text: "暂不支持此功能", )); diff --git a/lib/order/order_view/order_address.dart b/lib/order/order_view/order_address.dart index 46a2f9ad..71171af4 100644 --- a/lib/order/order_view/order_address.dart +++ b/lib/order/order_view/order_address.dart @@ -159,7 +159,7 @@ class _OrderAddress extends State { callMobile(mobile); } } - SmartDialog.dismiss(); + SmartDialog.dismiss(status: SmartStatus.dialog); }, leftText: S.of(context).quxiao, width: MediaQuery.of(context).size.width - 30.w, diff --git a/lib/qr/invite_friends.dart b/lib/qr/invite_friends.dart index db99b1c5..f7e8c77a 100644 --- a/lib/qr/invite_friends.dart +++ b/lib/qr/invite_friends.dart @@ -98,7 +98,6 @@ class _InviteFriends extends State { } else { refreshController.refreshFailed(); } - SmartDialog.dismiss(); } _onRefresh() { diff --git a/lib/qr/qr_share.dart b/lib/qr/qr_share.dart index 2bab09af..d3bf8c59 100644 --- a/lib/qr/qr_share.dart +++ b/lib/qr/qr_share.dart @@ -36,7 +36,6 @@ class _QrSharePage extends State { @override void dispose() { - SmartDialog.dismiss(); super.dispose(); } diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index 98af3c59..c7139ccc 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -100,9 +100,6 @@ abstract class MinApiService { p(jsonEncode(response.data)); Map map = response.data; - if (map["code"] != 0) { - SmartDialog.dismiss(); - } if (map["code"] == 40005 || map["code"] == 40001) { if (!LoginTipsDialog().isShow) { LoginTipsDialog().show(context); @@ -125,7 +122,7 @@ abstract class MinApiService { ErrorInterceptorHandler handler, ) { if (SmartDialog.checkExist(dialogTypes: {SmartAllDialogType.loading})) { - SmartDialog.dismiss(); + SmartDialog.dismiss(status: SmartStatus.loading); } debugPrint( "\n======================= Min_错误响应数据 ======================="); diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index 1f7a1503..4c902dc9 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -138,7 +138,7 @@ abstract class ApiService { if (showLoading && SmartDialog.checkExist( dialogTypes: {SmartAllDialogType.loading})) { - SmartDialog.dismiss(); + SmartDialog.dismiss(status: SmartStatus.loading); } debugPrint("code = ${response.statusCode}"); p(jsonEncode(response.data)); @@ -150,8 +150,7 @@ abstract class ApiService { LoginTipsDialog().show(context); } } - debugPrint( - "======================= 响应数据结束 =======================\n"); + debugPrint("======================= 响应数据结束 =======================\n"); if (map["code"] == 0 || map["code"] == 200) {} } } catch (e2) { @@ -162,12 +161,10 @@ abstract class ApiService { DioException e, ErrorInterceptorHandler handler, ) { - if (SmartDialog.checkExist( - dialogTypes: {SmartAllDialogType.loading})) { - SmartDialog.dismiss(); + if (SmartDialog.checkExist(dialogTypes: {SmartAllDialogType.loading})) { + SmartDialog.dismiss(status: SmartStatus.loading); } - debugPrint( - "\n======================= 错误响应数据 ======================="); + debugPrint("\n======================= 错误响应数据 ======================="); debugPrint("type = ${e.type}"); debugPrint("message = ${e.message}"); debugPrint("\n"); diff --git a/lib/settlement/settlement.dart b/lib/settlement/settlement.dart index b71f3362..7a8adc63 100644 --- a/lib/settlement/settlement.dart +++ b/lib/settlement/settlement.dart @@ -302,7 +302,6 @@ class _Settlement extends State { } } finally { setState(() {}); - SmartDialog.dismiss(); } } @@ -333,7 +332,6 @@ class _Settlement extends State { coupons = minOrderInfo?.couponName ?? ""; }); } - SmartDialog.dismiss(); } ///取消优惠券 @@ -694,15 +692,9 @@ class _Settlement extends State { queryOrderDetails(parentId); setState(() {}); } - } else { - // orderButton = false; - SmartDialog.showToast(baseData?.msg ?? "", - alignment: Alignment.center); } } - } finally { - SmartDialog.dismiss(); - } + } finally {} } ///结算 @@ -752,8 +744,6 @@ class _Settlement extends State { sign: wxPay.sign!, )); } else { - SmartDialog.dismiss(); - SmartDialog.showToast("${baseData?.msg}", alignment: Alignment.center); Future.delayed(Duration(seconds: 2), () { toOrderDetails(placeOrderFirst!.id); }); diff --git a/lib/store/shop_details_page.dart b/lib/store/shop_details_page.dart index 33029976..a62ee9ee 100644 --- a/lib/store/shop_details_page.dart +++ b/lib/store/shop_details_page.dart @@ -168,7 +168,6 @@ class _ShopDetailsPage extends State { } }); }); - SmartDialog.dismiss(); refreshController.refreshCompleted(); } else { refreshController.refreshFailed(); @@ -338,7 +337,6 @@ class _ShopDetailsPage extends State { if (baseData?.isSuccess ?? false) { showStoreSelector(baseData!.data, id, count); } - SmartDialog.dismiss(); } ///选规格弹窗 diff --git a/lib/store/shopping/activity_prefecture_details.dart b/lib/store/shopping/activity_prefecture_details.dart index d384ff0a..f62286b0 100644 --- a/lib/store/shopping/activity_prefecture_details.dart +++ b/lib/store/shopping/activity_prefecture_details.dart @@ -116,7 +116,6 @@ class _ActivityPrefectureDetails extends State { showLoading: false, ); queryFindActListByType(pageType == "2" ? false : true); - SmartDialog.dismiss(); } }); } @@ -136,7 +135,6 @@ class _ActivityPrefectureDetails extends State { setState(() {}); } } - SmartDialog.dismiss(); } ///秒杀/砍价/拼团列表 diff --git a/lib/store/shopping/shopping_goods_details.dart b/lib/store/shopping/shopping_goods_details.dart index 3620c2c0..d7325ec7 100644 --- a/lib/store/shopping/shopping_goods_details.dart +++ b/lib/store/shopping/shopping_goods_details.dart @@ -137,7 +137,6 @@ class _ShoppingGoodsDetails extends State { ); queryMemberInfo(); queryMiNiDetail(productId); - SmartDialog.dismiss(); } }); } @@ -166,7 +165,6 @@ class _ShoppingGoodsDetails extends State { setState(() {}); } } - SmartDialog.dismiss(); } ///商品详情 @@ -217,7 +215,6 @@ class _ShoppingGoodsDetails extends State { // miNiDetail.attrList[0].attrValueList.length == 1) { // _addShopCar(miNiDetail, [], count); // } else { - SmartDialog.dismiss(); dialogShowing = true; SmartDialog.show( builder: (ctx) { @@ -303,7 +300,6 @@ class _ShoppingGoodsDetails extends State { }, ], }).catchError((error) => BaseListData()..isSuccess = false); - SmartDialog.dismiss(); if (baseDate?.isSuccess ?? false) { SmartDialog.showToast("添加购物车成功", alignment: Alignment.center); } diff --git a/lib/store/shopping/shopping_mall_home.dart b/lib/store/shopping/shopping_mall_home.dart index fb356a68..d4cd1e3f 100644 --- a/lib/store/shopping/shopping_mall_home.dart +++ b/lib/store/shopping/shopping_mall_home.dart @@ -80,8 +80,6 @@ class _ShoppingMallHome extends State storeId: storeId, showLoading: false, ); - - SmartDialog.dismiss(); } }); } @@ -101,7 +99,6 @@ class _ShoppingMallHome extends State setState(() {}); } } - SmartDialog.dismiss(); } @override diff --git a/lib/store/store_order.dart b/lib/store/store_order.dart index c00005e3..69f3ba31 100644 --- a/lib/store/store_order.dart +++ b/lib/store/store_order.dart @@ -701,7 +701,6 @@ class _StoreOrderPage extends State return; } BaseData? baseData = await minService?.miNiDetail(id); - SmartDialog.dismiss(); if (baseData?.isSuccess ?? false) { miniDetail = baseData!.data; if (baseData.data != null) { @@ -862,10 +861,8 @@ class _StoreOrderPage extends State Map shopCarTemp = shopCarGoods?.toJson() ?? {}; cartSkuItem.buyNum = (cartSkuItem.buyNum ?? 0) - 1; shopCarTemp["shoppingCartSkuItemList"] = [cartSkuItem.toJson()]; - BaseListData? baseDate = - await minService?.shoppingCartSingle(shopCarTemp); + BaseListData? baseDate = await minService?.shoppingCartSingle(shopCarTemp); if (baseDate?.isSuccess ?? false) { - SmartDialog.dismiss(); this.shopCarGoods = await queryShopCar(); if (shopCartKey.currentState != null) { shopCartKey.currentState!.setState(() {}); diff --git a/lib/store/store_view/product_meals_sku.dart b/lib/store/store_view/product_meals_sku.dart index fcbb4a36..fcca38e6 100644 --- a/lib/store/store_view/product_meals_sku.dart +++ b/lib/store/store_view/product_meals_sku.dart @@ -120,7 +120,6 @@ class _ProductMealsSku extends State { BaseListData? baseDate = await minService ?.addShoppingCart(requestData) .catchError((error) => BaseListData()..isSuccess = false); - SmartDialog.dismiss(); if (baseDate?.isSuccess ?? false) { Navigator.of(context).pop(); } else { diff --git a/lib/union/union_details_page.dart b/lib/union/union_details_page.dart index 7b7b1fec..67256a05 100644 --- a/lib/union/union_details_page.dart +++ b/lib/union/union_details_page.dart @@ -298,7 +298,7 @@ class _UnionDetailsPage extends State { print("print 下载失败"); } Future.delayed(Duration(seconds: 1), () { - SmartDialog.dismiss(); + SmartDialog.dismiss(status: SmartStatus.loading); }); } } diff --git a/lib/union/union_list.dart b/lib/union/union_list.dart index 570a610b..358cb256 100644 --- a/lib/union/union_list.dart +++ b/lib/union/union_list.dart @@ -80,7 +80,6 @@ class _UnionList extends State with AutomaticKeepAliveClientMixin { _refreshController.refreshFailed(); SmartDialog.showToast(baseData?.msg ?? "", alignment: Alignment.center); } - SmartDialog.dismiss(); if (!mounted) return; setState(() {}); } diff --git a/lib/union/union_page.dart b/lib/union/union_page.dart index 84059a40..248eef23 100644 --- a/lib/union/union_page.dart +++ b/lib/union/union_page.dart @@ -215,8 +215,8 @@ class UnionPageState extends State } } finally { getLocation(showLoading: false); + SmartDialog.dismiss(); } - SmartDialog.dismiss(); } loadFinish({bool showLoading = true}) { diff --git a/lib/utils/upload_async.dart b/lib/utils/upload_async.dart index 718cba15..5dbf0e71 100644 --- a/lib/utils/upload_async.dart +++ b/lib/utils/upload_async.dart @@ -120,17 +120,12 @@ class UploadAsync { "location": addressText, "longitude": "", }).catchError((onError) { - SmartDialog.dismiss(); + }); if (baseData?.isSuccess ?? false) { SmartDialog.showToast("发布成功!"); UploadInstance.instance.notifyAllObservers(); - } else { - if (baseData.msg?.isNotEmpty ?? false) { - SmartDialog.showToast("${baseData.msg}", alignment: Alignment.center); - } } - SmartDialog.dismiss(); }); } diff --git a/lib/view_widget/vip_dialog.dart b/lib/view_widget/vip_dialog.dart index d4ae8032..f2049050 100644 --- a/lib/view_widget/vip_dialog.dart +++ b/lib/view_widget/vip_dialog.dart @@ -53,7 +53,6 @@ class _VipDialog extends State { } }); } - SmartDialog.dismiss(); } @override