mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
@@ -100,14 +100,14 @@ class _FollowChildPageState extends State<FollowChildPage>
|
||||
if (index == response.length - 1) {
|
||||
_followController.onLoadMore();
|
||||
}
|
||||
final item = response[index];
|
||||
return FollowItem(
|
||||
item: response[index],
|
||||
item: item,
|
||||
isOwner: widget.controller?.isOwner,
|
||||
onSelect: widget.onSelect,
|
||||
callback: (attr) {
|
||||
_followController.loadingState
|
||||
..value.data![index].attribute = attr == 0 ? -1 : 0
|
||||
..refresh();
|
||||
item.attribute = attr == 0 ? -1 : 0;
|
||||
_followController.loadingState.refresh();
|
||||
},
|
||||
);
|
||||
},
|
||||
|
||||
@@ -70,12 +70,11 @@ class FollowController extends GetxController with GetTickerProviderStateMixin {
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> onUpdateTag(int index, tagid, String tagName) async {
|
||||
final res = await MemberHttp.updateFollowTag(tagid, tagName);
|
||||
Future<void> onUpdateTag(MemberTagItemModel item, String tagName) async {
|
||||
final res = await MemberHttp.updateFollowTag(item.tagid, tagName);
|
||||
if (res['status']) {
|
||||
tabs
|
||||
..[index].name = tagName
|
||||
..refresh();
|
||||
item.name = tagName;
|
||||
tabs.refresh();
|
||||
SmartDialog.showToast('修改成功');
|
||||
} else {
|
||||
SmartDialog.showToast(res['msg']);
|
||||
|
||||
@@ -179,8 +179,7 @@ class _FollowPageState extends State<FollowPage> {
|
||||
),
|
||||
onConfirm: () {
|
||||
if (tagName.isNotEmpty) {
|
||||
_followController.onUpdateTag(
|
||||
index, item.tagid, tagName);
|
||||
_followController.onUpdateTag(item, tagName);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user