增加圈子下拉刷新圈子信息
This commit is contained in:
parent
6629751835
commit
f718bec18f
@ -57,6 +57,16 @@ class CircleLogic extends GetxController {
|
|||||||
showToast(bean.msg);
|
showToast(bean.msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateCircleInfo(Circle circleInfo) {
|
||||||
|
for(int i = 0; i < circle.lists.length; i++) {
|
||||||
|
Circle temp = circle.lists[i];
|
||||||
|
if (temp.id == circleInfo.id) {
|
||||||
|
circle.lists[i] = circleInfo;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
setCircle(String circleId){
|
setCircle(String circleId){
|
||||||
circle.lists.forEach((element) {
|
circle.lists.forEach((element) {
|
||||||
|
|||||||
@ -220,6 +220,7 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
|
|||||||
child: RefreshIndicator(
|
child: RefreshIndicator(
|
||||||
onRefresh: () async {
|
onRefresh: () async {
|
||||||
refreshData();
|
refreshData();
|
||||||
|
refreshCircleData();
|
||||||
},
|
},
|
||||||
child: lists.isEmpty
|
child: lists.isEmpty
|
||||||
? !callOutMore
|
? !callOutMore
|
||||||
@ -1262,4 +1263,19 @@ class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClie
|
|||||||
return calculateTextHeight(
|
return calculateTextHeight(
|
||||||
content, 14.sp, FontWeight.w300, Get.width - 64.sp, 100);
|
content, 14.sp, FontWeight.w300, Get.width - 64.sp, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void refreshCircleData() async {
|
||||||
|
var routePath = Get.currentRoute;
|
||||||
|
if (routePath == AppRoutes.Signal_circle_list) return;
|
||||||
|
|
||||||
|
var data = await DioManager.instance
|
||||||
|
.get(url: 'up-service/interest/${widget.bean.id}');
|
||||||
|
if (data['code'] == 200) {
|
||||||
|
widget.bean = Circle.fromJson(data['data']);
|
||||||
|
widget.logic.updateCircleInfo(widget.bean);
|
||||||
|
setState(() {
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -67,4 +67,15 @@ class MyCircleLogic extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
updateCircleInfo(Circle circleInfo) {
|
||||||
|
for(int i = 0; i < circle.lists.length; i++) {
|
||||||
|
Circle temp = circle.lists[i];
|
||||||
|
if (temp.id == circleInfo.id) {
|
||||||
|
circle.lists[i] = circleInfo;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user