mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-22 03:31:09 +08:00
@@ -298,108 +298,106 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
|
||||
// 分享视频
|
||||
@override
|
||||
void actionShareVideo(BuildContext context) {
|
||||
final videoDetail = this.videoDetail.value;
|
||||
String videoUrl =
|
||||
'${HttpString.baseUrl}/video/$bvid${videoDetailCtr.playedTimePos}';
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (_) {
|
||||
final videoDetail = this.videoDetail.value;
|
||||
String videoUrl =
|
||||
'${HttpString.baseUrl}/video/$bvid${videoDetailCtr.playedTimePos}';
|
||||
return AlertDialog(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 12),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
ListTile(
|
||||
dense: true,
|
||||
title: const Text(
|
||||
'复制链接',
|
||||
style: TextStyle(fontSize: 14),
|
||||
),
|
||||
onTap: () {
|
||||
Get.back();
|
||||
Utils.copyText(videoUrl);
|
||||
},
|
||||
builder: (_) => AlertDialog(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 12),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
ListTile(
|
||||
dense: true,
|
||||
title: const Text(
|
||||
'复制链接',
|
||||
style: TextStyle(fontSize: 14),
|
||||
),
|
||||
ListTile(
|
||||
dense: true,
|
||||
title: const Text(
|
||||
'其它app打开',
|
||||
style: TextStyle(fontSize: 14),
|
||||
),
|
||||
onTap: () {
|
||||
Get.back();
|
||||
PageUtils.launchURL(videoUrl);
|
||||
},
|
||||
onTap: () {
|
||||
Get.back();
|
||||
Utils.copyText(videoUrl);
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
dense: true,
|
||||
title: const Text(
|
||||
'其它app打开',
|
||||
style: TextStyle(fontSize: 14),
|
||||
),
|
||||
if (PlatformUtils.isMobile)
|
||||
ListTile(
|
||||
dense: true,
|
||||
title: const Text(
|
||||
'分享视频',
|
||||
style: TextStyle(fontSize: 14),
|
||||
),
|
||||
onTap: () {
|
||||
Get.back();
|
||||
Utils.shareText(
|
||||
'${videoDetail.title} '
|
||||
'UP主: ${videoDetail.owner!.name!}'
|
||||
' - $videoUrl',
|
||||
);
|
||||
},
|
||||
),
|
||||
onTap: () {
|
||||
Get.back();
|
||||
PageUtils.launchURL(videoUrl);
|
||||
},
|
||||
),
|
||||
if (PlatformUtils.isMobile)
|
||||
ListTile(
|
||||
dense: true,
|
||||
title: const Text(
|
||||
'分享至动态',
|
||||
'分享视频',
|
||||
style: TextStyle(fontSize: 14),
|
||||
),
|
||||
onTap: () {
|
||||
Get.back();
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
isScrollControlled: true,
|
||||
useSafeArea: true,
|
||||
builder: (context) => RepostPanel(
|
||||
rid: videoDetail.aid,
|
||||
dynType: 8,
|
||||
pic: videoDetail.pic,
|
||||
title: videoDetail.title,
|
||||
uname: videoDetail.owner?.name,
|
||||
),
|
||||
Utils.shareText(
|
||||
'${videoDetail.title} '
|
||||
'UP主: ${videoDetail.owner!.name!}'
|
||||
' - $videoUrl',
|
||||
);
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
dense: true,
|
||||
title: const Text(
|
||||
'分享至消息',
|
||||
style: TextStyle(fontSize: 14),
|
||||
),
|
||||
onTap: () {
|
||||
Get.back();
|
||||
try {
|
||||
PageUtils.pmShare(
|
||||
context,
|
||||
content: {
|
||||
"id": videoDetail.aid!.toString(),
|
||||
"title": videoDetail.title!,
|
||||
"headline": videoDetail.title!,
|
||||
"source": 5,
|
||||
"thumb": videoDetail.pic!,
|
||||
"author": videoDetail.owner!.name!,
|
||||
"author_id": videoDetail.owner!.mid!.toString(),
|
||||
},
|
||||
);
|
||||
} catch (e) {
|
||||
SmartDialog.showToast(e.toString());
|
||||
}
|
||||
},
|
||||
ListTile(
|
||||
dense: true,
|
||||
title: const Text(
|
||||
'分享至动态',
|
||||
style: TextStyle(fontSize: 14),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
onTap: () {
|
||||
Get.back();
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
isScrollControlled: true,
|
||||
useSafeArea: true,
|
||||
builder: (context) => RepostPanel(
|
||||
rid: videoDetail.aid,
|
||||
dynType: 8,
|
||||
pic: videoDetail.pic,
|
||||
title: videoDetail.title,
|
||||
uname: videoDetail.owner?.name,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
dense: true,
|
||||
title: const Text(
|
||||
'分享至消息',
|
||||
style: TextStyle(fontSize: 14),
|
||||
),
|
||||
onTap: () {
|
||||
Get.back();
|
||||
try {
|
||||
PageUtils.pmShare(
|
||||
context,
|
||||
content: {
|
||||
"id": videoDetail.aid!.toString(),
|
||||
"title": videoDetail.title!,
|
||||
"headline": videoDetail.title!,
|
||||
"source": 5,
|
||||
"thumb": videoDetail.pic!,
|
||||
"author": videoDetail.owner!.name!,
|
||||
"author_id": videoDetail.owner!.mid!.toString(),
|
||||
},
|
||||
);
|
||||
} catch (e) {
|
||||
SmartDialog.showToast(e.toString());
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user