mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-31 16:18:22 +08:00
fix: bangumi
This commit is contained in:
@@ -43,7 +43,6 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
|
|||||||
late BangumiIntroController bangumiIntroController;
|
late BangumiIntroController bangumiIntroController;
|
||||||
late VideoDetailController videoDetailCtr;
|
late VideoDetailController videoDetailCtr;
|
||||||
late int cid;
|
late int cid;
|
||||||
late String heroTag;
|
|
||||||
|
|
||||||
// 添加页面缓存
|
// 添加页面缓存
|
||||||
@override
|
@override
|
||||||
@@ -52,11 +51,10 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
// heroTag = Get.arguments['heroTag'];
|
|
||||||
heroTag = widget.heroTag;
|
|
||||||
cid = widget.cid!;
|
cid = widget.cid!;
|
||||||
bangumiIntroController = Get.put(BangumiIntroController(), tag: heroTag);
|
bangumiIntroController =
|
||||||
videoDetailCtr = Get.find<VideoDetailController>(tag: heroTag);
|
Get.put(BangumiIntroController(), tag: widget.heroTag);
|
||||||
|
videoDetailCtr = Get.find<VideoDetailController>(tag: widget.heroTag);
|
||||||
videoDetailCtr.cid.listen((int p0) {
|
videoDetailCtr.cid.listen((int p0) {
|
||||||
cid = p0;
|
cid = p0;
|
||||||
if (!mounted) return;
|
if (!mounted) return;
|
||||||
@@ -73,6 +71,7 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
|
|||||||
_buildBody(LoadingState loadingState) {
|
_buildBody(LoadingState loadingState) {
|
||||||
return loadingState is Success
|
return loadingState is Success
|
||||||
? BangumiInfo(
|
? BangumiInfo(
|
||||||
|
heroTag: widget.heroTag,
|
||||||
loadingStatus: false,
|
loadingStatus: false,
|
||||||
bangumiDetail: loadingState.response,
|
bangumiDetail: loadingState.response,
|
||||||
cid: cid,
|
cid: cid,
|
||||||
@@ -88,6 +87,7 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
|
|||||||
fn: bangumiIntroController.onReload,
|
fn: bangumiIntroController.onReload,
|
||||||
)
|
)
|
||||||
: BangumiInfo(
|
: BangumiInfo(
|
||||||
|
heroTag: widget.heroTag,
|
||||||
loadingStatus: true,
|
loadingStatus: true,
|
||||||
bangumiDetail: null,
|
bangumiDetail: null,
|
||||||
cid: cid,
|
cid: cid,
|
||||||
@@ -105,6 +105,7 @@ class BangumiInfo extends StatefulWidget {
|
|||||||
this.cid,
|
this.cid,
|
||||||
required this.showEpisodes,
|
required this.showEpisodes,
|
||||||
required this.showIntroDetail,
|
required this.showIntroDetail,
|
||||||
|
required this.heroTag,
|
||||||
});
|
});
|
||||||
|
|
||||||
final bool loadingStatus;
|
final bool loadingStatus;
|
||||||
@@ -112,14 +113,14 @@ class BangumiInfo extends StatefulWidget {
|
|||||||
final int? cid;
|
final int? cid;
|
||||||
final Function showEpisodes;
|
final Function showEpisodes;
|
||||||
final Function showIntroDetail;
|
final Function showIntroDetail;
|
||||||
|
final String heroTag;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<BangumiInfo> createState() => _BangumiInfoState();
|
State<BangumiInfo> createState() => _BangumiInfoState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _BangumiInfoState extends State<BangumiInfo>
|
class _BangumiInfoState extends State<BangumiInfo>
|
||||||
with SingleTickerProviderStateMixin {
|
with TickerProviderStateMixin {
|
||||||
String heroTag = Get.arguments['heroTag'];
|
|
||||||
late final BangumiIntroController bangumiIntroController;
|
late final BangumiIntroController bangumiIntroController;
|
||||||
late final VideoDetailController videoDetailCtr;
|
late final VideoDetailController videoDetailCtr;
|
||||||
late final BangumiInfoModel? bangumiItem;
|
late final BangumiInfoModel? bangumiItem;
|
||||||
@@ -141,8 +142,9 @@ class _BangumiInfoState extends State<BangumiInfo>
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
bangumiIntroController = Get.put(BangumiIntroController(), tag: heroTag);
|
bangumiIntroController =
|
||||||
videoDetailCtr = Get.find<VideoDetailController>(tag: heroTag);
|
Get.put(BangumiIntroController(), tag: widget.heroTag);
|
||||||
|
videoDetailCtr = Get.find<VideoDetailController>(tag: widget.heroTag);
|
||||||
bangumiItem = bangumiIntroController.bangumiItem;
|
bangumiItem = bangumiIntroController.bangumiItem;
|
||||||
cid = widget.cid!;
|
cid = widget.cid!;
|
||||||
print('cid: $cid');
|
print('cid: $cid');
|
||||||
@@ -365,6 +367,7 @@ class _BangumiInfoState extends State<BangumiInfo>
|
|||||||
bangumiItem != null &&
|
bangumiItem != null &&
|
||||||
bangumiItem!.episodes!.isNotEmpty) ...[
|
bangumiItem!.episodes!.isNotEmpty) ...[
|
||||||
BangumiPanel(
|
BangumiPanel(
|
||||||
|
heroTag: widget.heroTag,
|
||||||
pages: bangumiItem != null
|
pages: bangumiItem != null
|
||||||
? bangumiItem!.episodes!
|
? bangumiItem!.episodes!
|
||||||
: widget.bangumiDetail!.episodes!,
|
: widget.bangumiDetail!.episodes!,
|
||||||
|
|||||||
@@ -14,12 +14,14 @@ class BangumiPanel extends StatefulWidget {
|
|||||||
this.cid,
|
this.cid,
|
||||||
required this.changeFuc,
|
required this.changeFuc,
|
||||||
required this.showEpisodes,
|
required this.showEpisodes,
|
||||||
|
required this.heroTag,
|
||||||
});
|
});
|
||||||
|
|
||||||
final List<EpisodeItem> pages;
|
final List<EpisodeItem> pages;
|
||||||
final int? cid;
|
final int? cid;
|
||||||
final Function changeFuc;
|
final Function changeFuc;
|
||||||
final Function showEpisodes;
|
final Function showEpisodes;
|
||||||
|
final String heroTag;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<BangumiPanel> createState() => _BangumiPanelState();
|
State<BangumiPanel> createState() => _BangumiPanelState();
|
||||||
@@ -34,7 +36,6 @@ class _BangumiPanelState extends State<BangumiPanel> {
|
|||||||
// 默认未开通
|
// 默认未开通
|
||||||
int vipStatus = 0;
|
int vipStatus = 0;
|
||||||
late int cid;
|
late int cid;
|
||||||
String heroTag = Get.arguments['heroTag'];
|
|
||||||
late final VideoDetailController videoDetailCtr;
|
late final VideoDetailController videoDetailCtr;
|
||||||
final ItemScrollController itemScrollController = ItemScrollController();
|
final ItemScrollController itemScrollController = ItemScrollController();
|
||||||
|
|
||||||
@@ -48,7 +49,7 @@ class _BangumiPanelState extends State<BangumiPanel> {
|
|||||||
if (userInfo != null) {
|
if (userInfo != null) {
|
||||||
vipStatus = userInfo.vipStatus;
|
vipStatus = userInfo.vipStatus;
|
||||||
}
|
}
|
||||||
videoDetailCtr = Get.find<VideoDetailController>(tag: heroTag);
|
videoDetailCtr = Get.find<VideoDetailController>(tag: widget.heroTag);
|
||||||
|
|
||||||
videoDetailCtr.cid.listen((int p0) {
|
videoDetailCtr.cid.listen((int p0) {
|
||||||
cid = p0;
|
cid = p0;
|
||||||
|
|||||||
@@ -35,8 +35,7 @@ class ActionItem extends StatefulWidget {
|
|||||||
State<ActionItem> createState() => ActionItemState();
|
State<ActionItem> createState() => ActionItemState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class ActionItemState extends State<ActionItem>
|
class ActionItemState extends State<ActionItem> with TickerProviderStateMixin {
|
||||||
with SingleTickerProviderStateMixin {
|
|
||||||
AnimationController? controller;
|
AnimationController? controller;
|
||||||
Animation<double>? _animation;
|
Animation<double>? _animation;
|
||||||
|
|
||||||
@@ -58,7 +57,7 @@ class ActionItemState extends State<ActionItem>
|
|||||||
controller?.reverse();
|
controller?.reverse();
|
||||||
widget.callBack!(false);
|
widget.callBack!(false);
|
||||||
}
|
}
|
||||||
if (duration <= 500 && !isCancel) {
|
if (duration <= 50 && !isCancel) {
|
||||||
feedBack();
|
feedBack();
|
||||||
widget.onTap!();
|
widget.onTap!();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1229,7 +1229,6 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
Widget videoIntro([bool needRelated = true]) {
|
Widget videoIntro([bool needRelated = true]) {
|
||||||
return CustomScrollView(
|
return CustomScrollView(
|
||||||
controller: _introController,
|
controller: _introController,
|
||||||
key: PageStorageKey<String>('简介${videoDetailController.bvid}'),
|
|
||||||
slivers: [
|
slivers: [
|
||||||
if (videoDetailController.videoType == SearchType.video) ...[
|
if (videoDetailController.videoType == SearchType.video) ...[
|
||||||
VideoIntroPanel(
|
VideoIntroPanel(
|
||||||
|
|||||||
Reference in New Issue
Block a user