mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-23 18:46:53 +08:00
feat: member cheese
feat: fav pugv Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -5,6 +5,7 @@ import 'package:PiliPlus/grpc/bilibili/app/viewunite/pgcanymodel.pb.dart'
|
||||
show ViewPgcAny;
|
||||
import 'package:PiliPlus/grpc/view.dart';
|
||||
import 'package:PiliPlus/http/constants.dart';
|
||||
import 'package:PiliPlus/http/fav.dart';
|
||||
import 'package:PiliPlus/http/search.dart';
|
||||
import 'package:PiliPlus/http/video.dart';
|
||||
import 'package:PiliPlus/models/common/video/source_type.dart';
|
||||
@@ -51,6 +52,7 @@ class PgcIntroController extends CommonIntroController {
|
||||
|
||||
late final RxBool isFollowed = false.obs;
|
||||
late final RxInt followStatus = (-1).obs;
|
||||
late final RxBool isFav = (pgcItem.userStatus?.favored == 1).obs;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
@@ -479,4 +481,16 @@ class PgcIntroController extends CommonIntroController {
|
||||
artist: pgcItem.title,
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> onFavPugv(bool isFav) async {
|
||||
final res = isFav
|
||||
? await FavHttp.delFavPugv(seasonId)
|
||||
: await FavHttp.addFavPugv(seasonId);
|
||||
if (res['status']) {
|
||||
this.isFav.value = !isFav;
|
||||
SmartDialog.showToast('${isFav ? '取消' : ''}收藏成功');
|
||||
} else {
|
||||
SmartDialog.showToast(res['msg']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user