mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: episodes showing
This commit is contained in:
@@ -467,13 +467,16 @@ class VideoIntroController extends GetxController {
|
||||
}
|
||||
|
||||
// 修改分P或番剧分集
|
||||
Future changeSeasonOrbangu(bvid, cid, aid) async {
|
||||
Future changeSeasonOrbangu(bvid, cid, aid, cover) async {
|
||||
// 重新获取视频资源
|
||||
final VideoDetailController videoDetailCtr =
|
||||
Get.find<VideoDetailController>(tag: heroTag);
|
||||
videoDetailCtr.bvid = bvid;
|
||||
videoDetailCtr.oid.value = aid ?? IdUtils.bv2av(bvid);
|
||||
videoDetailCtr.cid.value = cid;
|
||||
if (cover is String && cover.isNotEmpty) {
|
||||
videoItem!['pic'] = cover;
|
||||
}
|
||||
videoDetailCtr.danmakuCid.value = cid;
|
||||
videoDetailCtr.queryVideoUrl();
|
||||
// 重新请求相关视频
|
||||
@@ -559,7 +562,7 @@ class VideoIntroController extends GetxController {
|
||||
final int cid = episodes[prevIndex].cid!;
|
||||
final String rBvid = isPages ? bvid : episodes[prevIndex].bvid;
|
||||
final int rAid = isPages ? IdUtils.bv2av(bvid) : episodes[prevIndex].aid!;
|
||||
changeSeasonOrbangu(rBvid, cid, rAid);
|
||||
changeSeasonOrbangu(rBvid, cid, rAid, null);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -607,7 +610,7 @@ class VideoIntroController extends GetxController {
|
||||
final int cid = episodes[nextIndex].cid!;
|
||||
final String rBvid = isPages ? bvid : episodes[nextIndex].bvid;
|
||||
final int rAid = isPages ? IdUtils.bv2av(bvid) : episodes[nextIndex].aid!;
|
||||
changeSeasonOrbangu(rBvid, cid, rAid);
|
||||
changeSeasonOrbangu(rBvid, cid, rAid, null);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@ import 'package:material_design_icons_flutter/material_design_icons_flutter.dart
|
||||
import 'widgets/action_item.dart';
|
||||
import 'widgets/action_row_item.dart';
|
||||
import 'widgets/fav_panel.dart';
|
||||
import 'widgets/intro_detail.dart';
|
||||
import 'widgets/page.dart';
|
||||
import 'widgets/season.dart';
|
||||
|
||||
@@ -30,10 +29,12 @@ class VideoIntroPanel extends StatefulWidget {
|
||||
required this.heroTag,
|
||||
required this.showAiBottomSheet,
|
||||
required this.showIntroDetail,
|
||||
required this.showEpisodes,
|
||||
});
|
||||
final String heroTag;
|
||||
final Function showAiBottomSheet;
|
||||
final Function showIntroDetail;
|
||||
final Function showEpisodes;
|
||||
|
||||
@override
|
||||
State<VideoIntroPanel> createState() => _VideoIntroPanelState();
|
||||
@@ -82,6 +83,7 @@ class _VideoIntroPanelState extends State<VideoIntroPanel>
|
||||
heroTag: heroTag,
|
||||
showAiBottomSheet: widget.showAiBottomSheet,
|
||||
showIntroDetail: widget.showIntroDetail,
|
||||
showEpisodes: widget.showEpisodes,
|
||||
)
|
||||
: VideoInfo(
|
||||
//key:herotag
|
||||
@@ -91,6 +93,7 @@ class _VideoIntroPanelState extends State<VideoIntroPanel>
|
||||
heroTag: heroTag,
|
||||
showAiBottomSheet: widget.showAiBottomSheet,
|
||||
showIntroDetail: widget.showIntroDetail,
|
||||
showEpisodes: widget.showEpisodes,
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -101,6 +104,7 @@ class VideoInfo extends StatefulWidget {
|
||||
final String? heroTag;
|
||||
final Function showAiBottomSheet;
|
||||
final Function showIntroDetail;
|
||||
final Function showEpisodes;
|
||||
|
||||
const VideoInfo({
|
||||
Key? key,
|
||||
@@ -109,6 +113,7 @@ class VideoInfo extends StatefulWidget {
|
||||
this.heroTag,
|
||||
required this.showAiBottomSheet,
|
||||
required this.showIntroDetail,
|
||||
required this.showEpisodes,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
@@ -433,6 +438,7 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
|
||||
? videoIntroController.lastPlayCid.value
|
||||
: widget.videoDetail!.pages!.first.cid,
|
||||
changeFuc: videoIntroController.changeSeasonOrbangu,
|
||||
showEpisodes: widget.showEpisodes,
|
||||
),
|
||||
)
|
||||
],
|
||||
@@ -445,6 +451,7 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
|
||||
cid: videoIntroController.lastPlayCid.value,
|
||||
bvid: videoIntroController.bvid,
|
||||
changeFuc: videoIntroController.changeSeasonOrbangu,
|
||||
showEpisodes: widget.showEpisodes,
|
||||
))
|
||||
],
|
||||
],
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:PiliPalaX/common/widgets/list_sheet.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:PiliPalaX/models/video_detail_res.dart';
|
||||
@@ -16,12 +15,14 @@ class PagesPanel extends StatefulWidget {
|
||||
required this.bvid,
|
||||
required this.changeFuc,
|
||||
required this.heroTag,
|
||||
required this.showEpisodes,
|
||||
});
|
||||
final List<Part> pages;
|
||||
final int? cid;
|
||||
final String bvid;
|
||||
final Function changeFuc;
|
||||
final String heroTag;
|
||||
final Function showEpisodes;
|
||||
|
||||
@override
|
||||
State<PagesPanel> createState() => _PagesPanelState();
|
||||
@@ -94,16 +95,8 @@ class _PagesPanelState extends State<PagesPanel> {
|
||||
style: ButtonStyle(
|
||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||
),
|
||||
onPressed: () {
|
||||
ListSheet(
|
||||
episodes: episodes,
|
||||
bvid: widget.bvid,
|
||||
aid: IdUtils.bv2av(widget.bvid),
|
||||
currentCid: cid,
|
||||
changeFucCall: widget.changeFuc,
|
||||
context: context,
|
||||
).buildShowBottomSheet();
|
||||
},
|
||||
onPressed: () => widget.showEpisodes(
|
||||
episodes, widget.bvid, IdUtils.bv2av(widget.bvid), cid),
|
||||
child: Text(
|
||||
'共${widget.pages.length}集',
|
||||
style: const TextStyle(fontSize: 13),
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import 'package:PiliPalaX/common/widgets/list_sheet.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:PiliPalaX/models/video_detail_res.dart';
|
||||
@@ -11,11 +10,13 @@ class SeasonPanel extends StatefulWidget {
|
||||
this.cid,
|
||||
required this.changeFuc,
|
||||
required this.heroTag,
|
||||
required this.showEpisodes,
|
||||
});
|
||||
final UgcSeason ugcSeason;
|
||||
final int? cid;
|
||||
final Function changeFuc;
|
||||
final String heroTag;
|
||||
final Function showEpisodes;
|
||||
|
||||
@override
|
||||
State<SeasonPanel> createState() => _SeasonPanelState();
|
||||
@@ -102,16 +103,7 @@ class _SeasonPanelState extends State<SeasonPanel> {
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
clipBehavior: Clip.hardEdge,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
ListSheet(
|
||||
episodes: episodes,
|
||||
// bvid: IdUtils.av2bv(episodes!.first.aid!),
|
||||
// aid: episodes!.first.aid!,
|
||||
currentCid: cid,
|
||||
changeFucCall: widget.changeFuc,
|
||||
context: context)
|
||||
.buildShowBottomSheet();
|
||||
},
|
||||
onTap: () => widget.showEpisodes(episodes, null, null, cid),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.fromLTRB(8, 12, 8, 12),
|
||||
child: Row(
|
||||
|
||||
Reference in New Issue
Block a user