From 70fd2c2e9dbc4648e41e3795b37ad845358f7f24 Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Mon, 14 Mar 2022 19:31:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=9B=B4=E6=94=B92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/community/headlines/article_page.dart | 12 +++++++++++- lib/main_page.dart | 4 +++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/community/headlines/article_page.dart b/lib/community/headlines/article_page.dart index 9412717d..445cafcd 100644 --- a/lib/community/headlines/article_page.dart +++ b/lib/community/headlines/article_page.dart @@ -44,6 +44,7 @@ class _ArticlePage extends State List
articleTop = []; List headlines = []; int pageNum = 1; + bool isLoading = false; @override void initState() { @@ -95,6 +96,11 @@ class _ArticlePage extends State ///文章列表 queryArticleList(bool isHot) async { + if(!isHot && isLoading){ + return; + }else if(!isHot && !isLoading){ + isLoading = true; + } if (apiService == null) { SharedPreferences value = await SharedPreferences.getInstance(); apiService = ApiService( @@ -132,7 +138,9 @@ class _ArticlePage extends State refreshController.loadNoData(); } else { pageNum += 1; + refreshController.loadComplete(); } + isLoading = false; setState(() {}); } else { refreshController.refreshFailed(); @@ -165,6 +173,8 @@ class _ArticlePage extends State } _onRefresh() { + isLoading = true; + pageNum = 1; queryHeadlinesBanner(); queryHeadlinesList(); //分类列表 queryArticleList(false); @@ -180,7 +190,7 @@ class _ArticlePage extends State child: Container( child: SmartRefresher( controller: refreshController, - enablePullDown: false, + enablePullDown: true, enablePullUp:true, header: MyHeader(), footer: CustomFooter( diff --git a/lib/main_page.dart b/lib/main_page.dart index c2922ea6..b3367e5e 100644 --- a/lib/main_page.dart +++ b/lib/main_page.dart @@ -190,7 +190,9 @@ class _MainPage extends State with WidgetsBindingObserver { SharedPreferences sharedPreferences = await SharedPreferences.getInstance(); if (sharedPreferences.getString("token") == null || sharedPreferences.getString("token") == "") return; - String startIntent = await Bridge.getStartIntent(); + String startIntent; + if(Platform.isAndroid) + startIntent = await Bridge.getStartIntent(); print("intent:$startIntent"); String pushData = ""; if (startIntent != null && startIntent != "") {