mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-22 19:51:11 +08:00
opt: LoadingState (#1776)
This commit is contained in:
committed by
GitHub
parent
3741fe54ff
commit
17883eb77e
@@ -64,7 +64,7 @@ class PgcReviewController
|
||||
mediaId: mediaId,
|
||||
reviewId: reviewId,
|
||||
);
|
||||
if (res['status']) {
|
||||
if (res.isSuccess) {
|
||||
int likes = item.stat?.likes ?? 0;
|
||||
item.stat
|
||||
?..liked = isLike ? 0 : 1
|
||||
@@ -74,7 +74,7 @@ class PgcReviewController
|
||||
}
|
||||
loadingState.refresh();
|
||||
} else {
|
||||
SmartDialog.showToast(res['msg']);
|
||||
res.toast();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ class PgcReviewController
|
||||
mediaId: mediaId,
|
||||
reviewId: reviewId,
|
||||
);
|
||||
if (res['status']) {
|
||||
if (res.isSuccess) {
|
||||
item.stat?.disliked = isDislike ? 0 : 1;
|
||||
if (!isDislike) {
|
||||
if (item.stat?.liked == 1) {
|
||||
@@ -97,22 +97,22 @@ class PgcReviewController
|
||||
}
|
||||
loadingState.refresh();
|
||||
} else {
|
||||
SmartDialog.showToast(res['msg']);
|
||||
res.toast();
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> onDel(int index, int? reviewId) async {
|
||||
Future<void> onDel(int index, int reviewId) async {
|
||||
var res = await PgcHttp.pgcReviewDel(
|
||||
mediaId: mediaId,
|
||||
reviewId: reviewId,
|
||||
);
|
||||
if (res['status']) {
|
||||
if (res.isSuccess) {
|
||||
loadingState
|
||||
..value.data!.removeAt(index)
|
||||
..refresh();
|
||||
SmartDialog.showToast('删除成功');
|
||||
} else {
|
||||
SmartDialog.showToast(res['msg']);
|
||||
res.toast();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user