diff --git a/lib/pages/home/home_page.dart b/lib/pages/home/home_page.dart index ff01804..69c057d 100644 --- a/lib/pages/home/home_page.dart +++ b/lib/pages/home/home_page.dart @@ -243,11 +243,21 @@ class _HomePageState extends BaseStoreState super.dispose(); } + bool _updateTag = false; + @override void didChangeAppLifecycleState(AppLifecycleState state) { + if (state == AppLifecycleState.paused) _updateTag = true; if (state == AppLifecycleState.resumed) { - DPrint.printf("后台返回前台"); - _updateSource(); + //TODO 修复订单无法下单的问题,该问题只在华为设备中发生, + // Set native info: isAppForeground(true) + // Set native info: isAppForeground(false) + // 不停的在前后台切换,原因未知 + if (_updateTag) { + _updateSource(); + _updateTag = false; + } + // _handleOpenInstallEvents(); } } @@ -596,7 +606,7 @@ class _HomePageState extends BaseStoreState padding: EdgeInsets.only(bottom: 5), color: AppColor.frenchColor, child: GoodsItemWidget.rowGoods( - isSingleDayGoods: true, + isSingleDayGoods: false, onBrandClick: () { AppRouter.push(context, RouteName.BRANDGOODS_LIST_PAGE, arguments: BrandGoodsListPage.setArguments( @@ -1355,8 +1365,8 @@ class _HomePageState extends BaseStoreState _mobShareInit() { ShareSDKRegister register = ShareSDKRegister(); - register.setupSinaWeibo("3484799074", "0cc08d31b4d63dc81fbb7a2559999fb3", - "https://reecook.cn"); + register.setupSinaWeibo( + "3484799074", "0cc08d31b4d63dc81fbb7a2559999fb3", "https://reecook.cn"); register.setupQQ("101876843", "6f367bfad98978e22c2e11897dd74f00"); SharesdkPlugin.regist(register); } diff --git a/pubspec.lock b/pubspec.lock index 65c8b2d..680045d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1162,7 +1162,7 @@ packages: source: hosted version: "0.2.7" wakelock: - dependency: "direct main" + dependency: transitive description: name: wakelock url: "https://pub.flutter-io.cn" diff --git a/pubspec.yaml b/pubspec.yaml index b6e0d12..3f7698b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -86,7 +86,7 @@ dependencies: path: # 网络请求 - dio: ^3.0.9 + dio: ^3.0.10 # loading界面 flutter_spinkit: ^3.1.0 @@ -204,7 +204,6 @@ dependencies: flutter_markdown: - wakelock: dropdown_search: ^0.4.5