Compare commits

...

3 Commits

Author SHA1 Message Date
dom
db30aa8041 tweaks
Signed-off-by: dom <githubaccount56556@proton.me>
2026-04-09 00:09:40 +08:00
dom
6f95456d20 fix vipStatus check
Signed-off-by: dom <githubaccount56556@proton.me>
2026-04-08 20:58:19 +08:00
HCha
de6e402d97 fix return button not working (#1883)
* fix: return button won't work #1

* feat: return horizontal | isPortrait

* revert: e85ccc7 onPopInvokedWithResult isPortrait

* revert: e85ccc7

* remove unused param

---------

Co-authored-by: dom <githubaccount56556@proton.me>
2026-04-08 20:40:26 +08:00
9 changed files with 17 additions and 24 deletions

View File

@@ -433,7 +433,9 @@ class _EpisodePanelState extends State<EpisodePanel>
type: MaterialType.transparency,
child: InkWell(
onTap: () {
if (episode.badge == "会员" && vipStatus != 1) {
if (episode.badge == "会员" &&
Accounts.mainEqVideo &&
vipStatus != 1) {
SmartDialog.showToast('需要大会员');
// return;
}

View File

@@ -346,8 +346,7 @@ class _LiveRoomPageState extends State<LiveRoomPage>
}
return popScope(
canPop: !isFullScreen && !plPlayerController.isDesktopPip,
onPopInvokedWithResult: (didPop, result) =>
plPlayerController.onPopInvokedWithResult(didPop, result, isPortrait),
onPopInvokedWithResult: plPlayerController.onPopInvokedWithResult,
child: player,
);
}

View File

@@ -221,10 +221,10 @@ class _MemberPageState extends State<MemberPage> {
isFollow: isFollow,
);
if (res.isSuccess) {
if (!context.mounted) return;
e
..total += isFollow ? -1 : 1
..isFollow = !isFollow;
if (!context.mounted) return;
(context as Element).markNeedsBuild();
} else {
res.toast();

View File

@@ -17,6 +17,7 @@ import 'package:PiliPlus/pages/video/controller.dart';
import 'package:PiliPlus/pages/video/introduction/ugc/controller.dart';
import 'package:PiliPlus/pages/video/introduction/ugc/widgets/page.dart';
import 'package:PiliPlus/services/download/download_service.dart';
import 'package:PiliPlus/utils/accounts.dart';
import 'package:PiliPlus/utils/date_utils.dart';
import 'package:PiliPlus/utils/duration_utils.dart';
import 'package:PiliPlus/utils/extension/num_ext.dart';
@@ -254,7 +255,7 @@ class _DownloadPanelState extends State<DownloadPanel> {
return false;
}
if (kReleaseMode && episode.badge == '会员') {
if (kReleaseMode && episode.badge == '会员' && Accounts.mainEqVideo) {
if (vipStatus != 1) {
if (!isDownloadAll) {
SmartDialog.showToast('需要大会员');

View File

@@ -6,6 +6,7 @@ import 'package:PiliPlus/models_new/pgc/pgc_info_model/new_ep.dart';
import 'package:PiliPlus/models_new/video/video_detail/episode.dart'
hide EpisodeItem;
import 'package:PiliPlus/pages/video/controller.dart';
import 'package:PiliPlus/utils/accounts.dart';
import 'package:PiliPlus/utils/extension/num_ext.dart';
import 'package:PiliPlus/utils/extension/theme_ext.dart';
import 'package:PiliPlus/utils/storage_pref.dart';
@@ -166,7 +167,7 @@ class _PgcPanelState extends State<PgcPanel> {
child: InkWell(
borderRadius: const BorderRadius.all(Radius.circular(6)),
onTap: () {
if (item.badge == '会员' && vipStatus) {
if (item.badge == '会员' && Accounts.mainEqVideo && vipStatus) {
SmartDialog.showToast('需要大会员');
}
widget.onChangeEpisode(item);

View File

@@ -1282,7 +1282,8 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
!isFullScreen &&
!videoDetailController.plPlayerController.isDesktopPip &&
(videoDetailController.horizontalScreen || isPortrait),
onPopInvokedWithResult: _onPopInvokedWithResult,
onPopInvokedWithResult:
videoDetailController.plPlayerController.onPopInvokedWithResult,
child: Obx(
() =>
!videoDetailController.videoState.value ||
@@ -2117,14 +2118,6 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
}
}
void _onPopInvokedWithResult(bool didPop, result) {
videoDetailController.plPlayerController.onPopInvokedWithResult(
didPop,
result,
isPortrait,
);
}
void onShowMemberPage(int? mid) {
videoDetailController.childKey.currentState?.showBottomSheet(
shape: const RoundedRectangleBorder(),

View File

@@ -1756,11 +1756,8 @@ class HeaderControlState extends State<HeaderControl>
size: 15,
color: Colors.white,
),
onPressed: () => plPlayerController.onPopInvokedWithResult(
false,
null,
videoDetailCtr.isPortrait,
),
onPressed: () =>
plPlayerController.onPopInvokedWithResult(false, null),
),
),
if (!plPlayerController.isDesktopPip &&

View File

@@ -1746,7 +1746,7 @@ class PlPlayerController with BlockConfigMixin {
});
}
void onPopInvokedWithResult(bool didPop, Object? result, bool isPortrait) {
void onPopInvokedWithResult(bool didPop, Object? result) {
if (didPop) {
if (Platform.isAndroid) {
_disableAutoEnterPipIfNeeded();
@@ -1765,8 +1765,6 @@ class PlPlayerController with BlockConfigMixin {
triggerFullScreen(status: false);
return;
}
if (!horizontalScreen && !isPortrait) {
Get.back();
}
Get.back();
}
}

View File

@@ -11,7 +11,9 @@ abstract final class Accounts {
AccountType.values.length,
AnonymousAccount(),
);
static bool get mainEqVideo => main == video;
static Account get main => accountMode[AccountType.main.index];
static Account get video => accountMode[AccountType.video.index];
static Account get heartbeat => accountMode[AccountType.heartbeat.index];
static Account get history {
final heartbeat = Accounts.heartbeat;