|
|
@ -33,6 +33,8 @@ class CommunityChildPageState extends State<CommunityChildPage> with AutomaticKe |
|
|
|
int pageNum = 1; |
|
|
|
int pageNum = 1; |
|
|
|
String userId; |
|
|
|
String userId; |
|
|
|
bool isLoadMore = false; |
|
|
|
bool isLoadMore = false; |
|
|
|
|
|
|
|
bool isRefresh = true; |
|
|
|
|
|
|
|
bool isLoadingData = false; |
|
|
|
ScrollController sc = ScrollController(); |
|
|
|
ScrollController sc = ScrollController(); |
|
|
|
|
|
|
|
|
|
|
|
List<Article> articles = []; |
|
|
|
List<Article> articles = []; |
|
|
@ -52,6 +54,14 @@ class CommunityChildPageState extends State<CommunityChildPage> with AutomaticKe |
|
|
|
|
|
|
|
|
|
|
|
///动态列表 |
|
|
|
///动态列表 |
|
|
|
queryCommunity() async { |
|
|
|
queryCommunity() async { |
|
|
|
|
|
|
|
if(!isRefresh){ |
|
|
|
|
|
|
|
isRefresh = true; |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(isLoadingData){ |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
isLoadingData = true; |
|
|
|
if (apiService == null) { |
|
|
|
if (apiService == null) { |
|
|
|
SharedPreferences value = await SharedPreferences.getInstance(); |
|
|
|
SharedPreferences value = await SharedPreferences.getInstance(); |
|
|
|
userId = value.getString('userId'); |
|
|
|
userId = value.getString('userId'); |
|
|
@ -107,6 +117,8 @@ class CommunityChildPageState extends State<CommunityChildPage> with AutomaticKe |
|
|
|
refreshController.loadNoData(); |
|
|
|
refreshController.loadNoData(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
isLoadingData = false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
@ -191,6 +203,7 @@ class CommunityChildPageState extends State<CommunityChildPage> with AutomaticKe |
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
this.articles.forEach((element) { |
|
|
|
this.articles.forEach((element) { |
|
|
|
if(element.id == id){ |
|
|
|
if(element.id == id){ |
|
|
|
|
|
|
|
isRefresh = false; |
|
|
|
setState(() { |
|
|
|
setState(() { |
|
|
|
element.likes = baseData.data.likes; |
|
|
|
element.likes = baseData.data.likes; |
|
|
|
element.viewers = baseData.data.viewers; |
|
|
|
element.viewers = baseData.data.viewers; |
|
|
|