mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-24 01:58:36 +00:00
opt: LoadingState (#1776)
This commit is contained in:
committed by
GitHub
parent
3741fe54ff
commit
17883eb77e
@@ -69,34 +69,34 @@ class FollowController extends GetxController with GetTickerProviderStateMixin {
|
||||
|
||||
Future<void> onCreateTag(String tagName) async {
|
||||
final res = await MemberHttp.createFollowTag(tagName);
|
||||
if (res['status']) {
|
||||
if (res.isSuccess) {
|
||||
followState.value = LoadingState.loading();
|
||||
queryFollowUpTags();
|
||||
SmartDialog.showToast('创建成功');
|
||||
} else {
|
||||
SmartDialog.showToast(res['msg']);
|
||||
res.toast();
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> onUpdateTag(MemberTagItemModel item, String tagName) async {
|
||||
final res = await MemberHttp.updateFollowTag(item.tagid, tagName);
|
||||
if (res['status']) {
|
||||
final res = await MemberHttp.updateFollowTag(item.tagid!, tagName);
|
||||
if (res.isSuccess) {
|
||||
item.name = tagName;
|
||||
tabs.refresh();
|
||||
SmartDialog.showToast('修改成功');
|
||||
} else {
|
||||
SmartDialog.showToast(res['msg']);
|
||||
res.toast();
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> onDelTag(int? tagid) async {
|
||||
Future<void> onDelTag(int tagid) async {
|
||||
final res = await MemberHttp.delFollowTag(tagid);
|
||||
if (res['status']) {
|
||||
if (res.isSuccess) {
|
||||
followState.value = LoadingState.loading();
|
||||
queryFollowUpTags();
|
||||
SmartDialog.showToast('删除成功');
|
||||
} else {
|
||||
SmartDialog.showToast(res['msg']);
|
||||
res.toast();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -220,7 +220,7 @@ class _FollowPageState extends State<FollowPage> {
|
||||
context: context,
|
||||
title: '删除分组',
|
||||
content: '删除后,该分组下的用户依旧保留?',
|
||||
onConfirm: () => _followController.onDelTag(item.tagid),
|
||||
onConfirm: () => _followController.onDelTag(item.tagid!),
|
||||
);
|
||||
},
|
||||
dense: true,
|
||||
|
||||
Reference in New Issue
Block a user