mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-21 16:48:43 +00:00
opt: LoadingState (#1776)
This commit is contained in:
committed by
GitHub
parent
3741fe54ff
commit
17883eb77e
@@ -36,9 +36,11 @@ class HistoryBaseController extends GetxController {
|
||||
SmartDialog.showLoading(msg: '请求中');
|
||||
var res = await UserHttp.clearHistory(account: account);
|
||||
SmartDialog.dismiss();
|
||||
if (res.data['code'] == 0) {
|
||||
if (res.isSuccess) {
|
||||
SmartDialog.showToast('清空观看历史');
|
||||
onSuccess();
|
||||
} else {
|
||||
res.toast();
|
||||
}
|
||||
},
|
||||
child: const Text('确认清空'),
|
||||
@@ -74,13 +76,15 @@ class HistoryBaseController extends GetxController {
|
||||
account: account,
|
||||
);
|
||||
SmartDialog.dismiss();
|
||||
if (res.data['code'] == 0) {
|
||||
if (res.isSuccess) {
|
||||
SmartDialog.showToast(pauseStatus ? '暂停观看历史' : '恢复观看历史');
|
||||
this.pauseStatus.value = pauseStatus;
|
||||
GStorage.localCache.put(
|
||||
LocalCacheKey.historyPause,
|
||||
pauseStatus,
|
||||
);
|
||||
} else {
|
||||
res.toast();
|
||||
}
|
||||
Get.back();
|
||||
},
|
||||
|
||||
@@ -78,11 +78,11 @@ class HistoryController
|
||||
// 观看历史暂停状态
|
||||
Future<void> historyStatus() async {
|
||||
var res = await UserHttp.historyStatus(account: account);
|
||||
if (res['status']) {
|
||||
baseCtr.pauseStatus.value = res['data'];
|
||||
GStorage.localCache.put(LocalCacheKey.historyPause, res['data']);
|
||||
if (res case Success(:final response)) {
|
||||
baseCtr.pauseStatus.value = response;
|
||||
GStorage.localCache.put(LocalCacheKey.historyPause, response);
|
||||
} else {
|
||||
SmartDialog.showToast(res['msg']);
|
||||
res.toast();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,11 +111,13 @@ class HistoryController
|
||||
.join(','),
|
||||
account: account,
|
||||
);
|
||||
if (response['status']) {
|
||||
afterDelete(removeList);
|
||||
}
|
||||
SmartDialog.dismiss();
|
||||
SmartDialog.showToast(response['msg']);
|
||||
if (response.isSuccess) {
|
||||
afterDelete(removeList);
|
||||
SmartDialog.showToast('已删除');
|
||||
} else {
|
||||
response.toast();
|
||||
}
|
||||
}
|
||||
|
||||
// 删除选中的记录
|
||||
|
||||
Reference in New Issue
Block a user