mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-07-15 13:50:14 +08:00
feat: video download
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -15,7 +15,6 @@ import 'package:PiliPlus/http/video.dart';
|
||||
import 'package:PiliPlus/models/common/badge_type.dart';
|
||||
import 'package:PiliPlus/models/common/episode_panel_type.dart';
|
||||
import 'package:PiliPlus/models/common/stat_type.dart';
|
||||
import 'package:PiliPlus/models/user/info.dart';
|
||||
import 'package:PiliPlus/models_new/pgc/pgc_info_model/episode.dart' as pgc;
|
||||
import 'package:PiliPlus/models_new/video/video_detail/episode.dart' as ugc;
|
||||
import 'package:PiliPlus/models_new/video/video_detail/page.dart';
|
||||
@@ -158,7 +157,9 @@ class _EpisodePanelState extends State<EpisodePanel>
|
||||
widget.list.length,
|
||||
(i) => ScrollController(
|
||||
initialScrollOffset: i == widget.initialTabIndex
|
||||
? _calcItemOffset(_currentItemIndex)
|
||||
? _currentItemIndex == 0
|
||||
? 0
|
||||
: _calcItemOffset(_currentItemIndex)
|
||||
: 0,
|
||||
),
|
||||
growable: false,
|
||||
@@ -365,6 +366,7 @@ class _EpisodePanelState extends State<EpisodePanel>
|
||||
);
|
||||
}
|
||||
|
||||
late final int? vipStatus = Pref.userInfoCache?.vipStatus;
|
||||
Widget _buildEpisodeItem({
|
||||
required ThemeData theme,
|
||||
required ugc.BaseEpisodeItem episode,
|
||||
@@ -384,7 +386,7 @@ class _EpisodePanelState extends State<EpisodePanel>
|
||||
switch (episode) {
|
||||
case Part part:
|
||||
cover = part.firstFrame ?? widget.cover;
|
||||
title = part.pagePart!;
|
||||
title = part.part!;
|
||||
duration = part.duration;
|
||||
pubdate = part.ctime;
|
||||
break;
|
||||
@@ -429,13 +431,9 @@ class _EpisodePanelState extends State<EpisodePanel>
|
||||
type: MaterialType.transparency,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
if (episode.badge == "会员") {
|
||||
UserInfoData? userInfo = Pref.userInfoCache;
|
||||
int vipStatus = userInfo?.vipStatus ?? 0;
|
||||
if (vipStatus != 1) {
|
||||
SmartDialog.showToast('需要大会员');
|
||||
// return;
|
||||
}
|
||||
if (episode.badge == "会员" && vipStatus != 1) {
|
||||
SmartDialog.showToast('需要大会员');
|
||||
// return;
|
||||
}
|
||||
SmartDialog.showToast('切换到:$title');
|
||||
widget.onClose?.call();
|
||||
|
||||
Reference in New Issue
Block a user