mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: bangumi cover showing
This commit is contained in:
@@ -114,7 +114,10 @@ class _ListSheetContentState extends State<ListSheetContent> {
|
|||||||
}
|
}
|
||||||
SmartDialog.showToast('切换到:$title');
|
SmartDialog.showToast('切换到:$title');
|
||||||
widget.onClose();
|
widget.onClose();
|
||||||
if (episode.runtimeType.toString() == "EpisodeItem") {
|
if (episode is bangumi.EpisodeItem && episode.cover != null) {
|
||||||
|
widget.changeFucCall(
|
||||||
|
episode.bvid, episode.cid, episode.aid, episode.cover);
|
||||||
|
} else if (episode.runtimeType.toString() == "EpisodeItem") {
|
||||||
widget.changeFucCall(episode.bvid, episode.cid, episode.aid);
|
widget.changeFucCall(episode.bvid, episode.cid, episode.aid);
|
||||||
} else {
|
} else {
|
||||||
widget.changeFucCall(widget.bvid!, episode.cid, widget.aid!);
|
widget.changeFucCall(widget.bvid!, episode.cid, widget.aid!);
|
||||||
|
|||||||
@@ -238,27 +238,44 @@ class BangumiIntroController extends CommonController {
|
|||||||
builder: (context) {
|
builder: (context) {
|
||||||
String videoUrl = '${HttpString.baseUrl}/video/$bvid';
|
String videoUrl = '${HttpString.baseUrl}/video/$bvid';
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
title: const Text('请选择'),
|
clipBehavior: Clip.hardEdge,
|
||||||
actions: [
|
contentPadding: const EdgeInsets.symmetric(vertical: 12),
|
||||||
TextButton(
|
content: Column(
|
||||||
onPressed: () {
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
ListTile(
|
||||||
|
title: const Text(
|
||||||
|
'复制链接',
|
||||||
|
style: TextStyle(fontSize: 14),
|
||||||
|
),
|
||||||
|
onTap: () {
|
||||||
|
Get.back();
|
||||||
Clipboard.setData(ClipboardData(text: videoUrl));
|
Clipboard.setData(ClipboardData(text: videoUrl));
|
||||||
SmartDialog.showToast('已复制');
|
SmartDialog.showToast('已复制');
|
||||||
},
|
},
|
||||||
child: const Text('复制链接到剪贴板')),
|
),
|
||||||
TextButton(
|
ListTile(
|
||||||
onPressed: () {
|
title: const Text(
|
||||||
|
'其它app打开',
|
||||||
|
style: TextStyle(fontSize: 14),
|
||||||
|
),
|
||||||
|
onTap: () {
|
||||||
|
Get.back();
|
||||||
launchUrl(Uri.parse(videoUrl));
|
launchUrl(Uri.parse(videoUrl));
|
||||||
},
|
},
|
||||||
child: const Text('其它app打开')),
|
),
|
||||||
TextButton(
|
ListTile(
|
||||||
onPressed: () async {
|
title: const Text(
|
||||||
var result =
|
'分享视频',
|
||||||
await Share.share(videoUrl).whenComplete(() {});
|
style: TextStyle(fontSize: 14),
|
||||||
return result;
|
),
|
||||||
|
onTap: () {
|
||||||
|
Get.back();
|
||||||
|
Share.share(videoUrl).whenComplete(() {});
|
||||||
},
|
},
|
||||||
child: const Text('分享视频')),
|
),
|
||||||
],
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -280,7 +297,7 @@ class BangumiIntroController extends CommonController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 修改分P或番剧分集
|
// 修改分P或番剧分集
|
||||||
Future changeSeasonOrbangu(bvid, cid, aid) async {
|
Future changeSeasonOrbangu(bvid, cid, aid, cover) async {
|
||||||
// 重新获取视频资源
|
// 重新获取视频资源
|
||||||
VideoDetailController videoDetailCtr =
|
VideoDetailController videoDetailCtr =
|
||||||
Get.find<VideoDetailController>(tag: Get.arguments['heroTag']);
|
Get.find<VideoDetailController>(tag: Get.arguments['heroTag']);
|
||||||
@@ -288,6 +305,9 @@ class BangumiIntroController extends CommonController {
|
|||||||
videoDetailCtr.cid.value = cid;
|
videoDetailCtr.cid.value = cid;
|
||||||
videoDetailCtr.danmakuCid.value = cid;
|
videoDetailCtr.danmakuCid.value = cid;
|
||||||
videoDetailCtr.queryVideoUrl();
|
videoDetailCtr.queryVideoUrl();
|
||||||
|
if (cover is String && cover.isNotEmpty) {
|
||||||
|
videoDetailCtr.videoItem['pic'] = cover;
|
||||||
|
}
|
||||||
// 重新请求评论
|
// 重新请求评论
|
||||||
try {
|
try {
|
||||||
/// 未渲染回复组件时可能异常
|
/// 未渲染回复组件时可能异常
|
||||||
@@ -342,7 +362,8 @@ class BangumiIntroController extends CommonController {
|
|||||||
int cid = episodes[prevIndex].cid!;
|
int cid = episodes[prevIndex].cid!;
|
||||||
String bvid = episodes[prevIndex].bvid!;
|
String bvid = episodes[prevIndex].bvid!;
|
||||||
int aid = episodes[prevIndex].aid!;
|
int aid = episodes[prevIndex].aid!;
|
||||||
changeSeasonOrbangu(bvid, cid, aid);
|
dynamic cover = episodes[prevIndex].cover;
|
||||||
|
changeSeasonOrbangu(bvid, cid, aid, cover);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -376,7 +397,8 @@ class BangumiIntroController extends CommonController {
|
|||||||
int cid = episodes[nextIndex].cid!;
|
int cid = episodes[nextIndex].cid!;
|
||||||
String bvid = episodes[nextIndex].bvid!;
|
String bvid = episodes[nextIndex].bvid!;
|
||||||
int aid = episodes[nextIndex].aid!;
|
int aid = episodes[nextIndex].aid!;
|
||||||
changeSeasonOrbangu(bvid, cid, aid);
|
dynamic cover = episodes[nextIndex].cover;
|
||||||
|
changeSeasonOrbangu(bvid, cid, aid, cover);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -161,6 +161,7 @@ class _BangumiPanelState extends State<BangumiPanel> {
|
|||||||
widget.pages[i].bvid,
|
widget.pages[i].bvid,
|
||||||
widget.pages[i].cid,
|
widget.pages[i].cid,
|
||||||
widget.pages[i].aid,
|
widget.pages[i].aid,
|
||||||
|
widget.pages[i].cover,
|
||||||
);
|
);
|
||||||
// currentIndex = i;
|
// currentIndex = i;
|
||||||
// setState(() {});
|
// setState(() {});
|
||||||
|
|||||||
@@ -379,9 +379,9 @@ class VideoIntroController extends GetxController {
|
|||||||
style: TextStyle(fontSize: 14),
|
style: TextStyle(fontSize: 14),
|
||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
|
Get.back();
|
||||||
Clipboard.setData(ClipboardData(text: videoUrl));
|
Clipboard.setData(ClipboardData(text: videoUrl));
|
||||||
SmartDialog.showToast('已复制');
|
SmartDialog.showToast('已复制');
|
||||||
Get.back();
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
@@ -390,8 +390,8 @@ class VideoIntroController extends GetxController {
|
|||||||
style: TextStyle(fontSize: 14),
|
style: TextStyle(fontSize: 14),
|
||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
launchUrl(Uri.parse(videoUrl));
|
|
||||||
Get.back();
|
Get.back();
|
||||||
|
launchUrl(Uri.parse(videoUrl));
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
@@ -399,11 +399,11 @@ class VideoIntroController extends GetxController {
|
|||||||
'分享视频',
|
'分享视频',
|
||||||
style: TextStyle(fontSize: 14),
|
style: TextStyle(fontSize: 14),
|
||||||
),
|
),
|
||||||
onTap: () async {
|
onTap: () {
|
||||||
await Share.share('${videoDetail.value.title} '
|
Get.back();
|
||||||
|
Share.share('${videoDetail.value.title} '
|
||||||
'UP主: ${videoDetail.value.owner!.name!}'
|
'UP主: ${videoDetail.value.owner!.name!}'
|
||||||
' - $videoUrl');
|
' - $videoUrl');
|
||||||
Get.back();
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user