mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-21 08:38:37 +00:00
opt account
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -20,6 +20,7 @@ import 'package:PiliPlus/pages/video/introduction/ugc/controller.dart';
|
||||
import 'package:PiliPlus/pages/video/pay_coins/view.dart';
|
||||
import 'package:PiliPlus/pages/video/reply/controller.dart';
|
||||
import 'package:PiliPlus/plugin/pl_player/models/play_repeat.dart';
|
||||
import 'package:PiliPlus/services/account_service.dart';
|
||||
import 'package:PiliPlus/utils/feed_back.dart';
|
||||
import 'package:PiliPlus/utils/global_data.dart';
|
||||
import 'package:PiliPlus/utils/page_utils.dart';
|
||||
@@ -60,8 +61,7 @@ class PgcIntroController extends GetxController {
|
||||
List? favIds;
|
||||
Rx<FavVideoData> favFolderData = FavVideoData().obs;
|
||||
|
||||
bool isLogin = Accounts.main.isLogin;
|
||||
int mid = Accounts.main.mid;
|
||||
AccountService accountService = Get.find<AccountService>();
|
||||
|
||||
late final enableQuickFav =
|
||||
GStorage.setting.get(SettingBoxKey.enableQuickFav, defaultValue: false);
|
||||
@@ -69,7 +69,7 @@ class PgcIntroController extends GetxController {
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
if (isLogin) {
|
||||
if (accountService.isLogin.value) {
|
||||
if (seasonId != null) {
|
||||
queryIsFollowed();
|
||||
}
|
||||
@@ -134,7 +134,7 @@ class PgcIntroController extends GetxController {
|
||||
|
||||
// 投币
|
||||
void actionCoinVideo() {
|
||||
if (!isLogin) {
|
||||
if (!accountService.isLogin.value) {
|
||||
SmartDialog.showToast('账号未登录');
|
||||
return;
|
||||
}
|
||||
@@ -388,7 +388,7 @@ class PgcIntroController extends GetxController {
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
if (isLogin) {
|
||||
if (accountService.isLogin.value) {
|
||||
queryPgcLikeCoinFav();
|
||||
}
|
||||
|
||||
@@ -434,7 +434,7 @@ class PgcIntroController extends GetxController {
|
||||
Future queryVideoInFolder() async {
|
||||
favIds = null;
|
||||
var result = await FavHttp.videoInFolder(
|
||||
mid: mid,
|
||||
mid: accountService.mid,
|
||||
rid: epId, // pgc
|
||||
type: 24, // pgc
|
||||
);
|
||||
@@ -508,7 +508,7 @@ class PgcIntroController extends GetxController {
|
||||
// 一键三连
|
||||
Future<void> actionOneThree() async {
|
||||
feedBack();
|
||||
if (!isLogin) {
|
||||
if (!accountService.isLogin.value) {
|
||||
SmartDialog.showToast('账号未登录');
|
||||
return;
|
||||
}
|
||||
@@ -562,7 +562,7 @@ class PgcIntroController extends GetxController {
|
||||
|
||||
// 收藏
|
||||
void showFavBottomSheet(BuildContext context, {type = 'tap'}) {
|
||||
if (!isLogin) {
|
||||
if (!accountService.isLogin.value) {
|
||||
SmartDialog.showToast('账号未登录');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:PiliPlus/models/user/info.dart';
|
||||
import 'package:PiliPlus/models_new/pgc/pgc_info_model/episode.dart';
|
||||
import 'package:PiliPlus/models_new/pgc/pgc_info_model/new_ep.dart';
|
||||
import 'package:PiliPlus/pages/video/controller.dart';
|
||||
@@ -34,9 +35,8 @@ class PgcPanel extends StatefulWidget {
|
||||
class _PgcPanelState extends State<PgcPanel> {
|
||||
late int currentIndex;
|
||||
final ScrollController listViewScrollCtr = ScrollController();
|
||||
dynamic userInfo;
|
||||
// 默认未开通
|
||||
int vipStatus = 0;
|
||||
late int vipStatus;
|
||||
late int cid;
|
||||
late final VideoDetailController videoDetailCtr;
|
||||
StreamSubscription? _listener;
|
||||
@@ -47,10 +47,10 @@ class _PgcPanelState extends State<PgcPanel> {
|
||||
cid = widget.cid!;
|
||||
currentIndex = widget.pages.indexWhere((e) => e.cid == cid);
|
||||
scrollToIndex();
|
||||
userInfo = GStorage.userInfo.get('userInfoCache');
|
||||
if (userInfo != null) {
|
||||
vipStatus = userInfo.vipStatus;
|
||||
}
|
||||
|
||||
UserInfoData? userInfo = GStorage.userInfo.get('userInfoCache');
|
||||
vipStatus = userInfo?.vipStatus ?? 0;
|
||||
|
||||
videoDetailCtr = Get.find<VideoDetailController>(tag: widget.heroTag);
|
||||
|
||||
_listener = videoDetailCtr.cid.listen((int p0) {
|
||||
|
||||
Reference in New Issue
Block a user