mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-31 16:18:22 +08:00
opt: view later from dyn
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -72,36 +72,36 @@ void imageSaveDialog({
|
|||||||
style: Theme.of(context).textTheme.titleSmall,
|
style: Theme.of(context).textTheme.titleSmall,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 4),
|
if (cover?.isNotEmpty == true) ...[
|
||||||
iconButton(
|
const SizedBox(width: 4),
|
||||||
context: context,
|
iconButton(
|
||||||
tooltip: '分享',
|
context: context,
|
||||||
onPressed: () {
|
tooltip: '分享',
|
||||||
DownloadUtils.onShareImg(cover ?? '');
|
onPressed: () {
|
||||||
},
|
|
||||||
iconSize: 20,
|
|
||||||
icon: Icons.share,
|
|
||||||
bgColor: Colors.transparent,
|
|
||||||
iconColor: Theme.of(context).colorScheme.onSurfaceVariant,
|
|
||||||
),
|
|
||||||
iconButton(
|
|
||||||
context: context,
|
|
||||||
tooltip: '保存封面图',
|
|
||||||
onPressed: () async {
|
|
||||||
bool saveStatus = await DownloadUtils.downloadImg(
|
|
||||||
context,
|
|
||||||
[cover ?? ''],
|
|
||||||
);
|
|
||||||
// 保存成功,自动关闭弹窗
|
|
||||||
if (saveStatus) {
|
|
||||||
SmartDialog.dismiss();
|
SmartDialog.dismiss();
|
||||||
}
|
DownloadUtils.onShareImg(cover!);
|
||||||
},
|
},
|
||||||
iconSize: 20,
|
iconSize: 20,
|
||||||
icon: Icons.download,
|
icon: Icons.share,
|
||||||
bgColor: Colors.transparent,
|
bgColor: Colors.transparent,
|
||||||
iconColor: Theme.of(context).colorScheme.onSurfaceVariant,
|
iconColor: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||||
),
|
),
|
||||||
|
iconButton(
|
||||||
|
context: context,
|
||||||
|
tooltip: '保存封面图',
|
||||||
|
onPressed: () async {
|
||||||
|
bool saveStatus =
|
||||||
|
await DownloadUtils.downloadImg(context, [cover!]);
|
||||||
|
if (saveStatus) {
|
||||||
|
SmartDialog.dismiss();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
iconSize: 20,
|
||||||
|
icon: Icons.download,
|
||||||
|
bgColor: Colors.transparent,
|
||||||
|
iconColor: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||||
|
),
|
||||||
|
],
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -245,6 +245,15 @@ class AuthorPanel extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
|
|
||||||
Widget morePanel(context) {
|
Widget morePanel(context) {
|
||||||
|
String? bvid;
|
||||||
|
try {
|
||||||
|
bvid = switch (item.type) {
|
||||||
|
'DYNAMIC_TYPE_AV' => item.modules.moduleDynamic.major.archive.bvid,
|
||||||
|
'DYNAMIC_TYPE_UGC_SEASON' =>
|
||||||
|
item.modules.moduleDynamic.major.ugcSeason.bvid,
|
||||||
|
_ => null,
|
||||||
|
};
|
||||||
|
} catch (_) {}
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom),
|
padding: EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom),
|
||||||
child: Column(
|
child: Column(
|
||||||
@@ -270,14 +279,13 @@ class AuthorPanel extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (item.type == 'DYNAMIC_TYPE_AV')
|
if (bvid != null)
|
||||||
ListTile(
|
ListTile(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
|
Get.back();
|
||||||
try {
|
try {
|
||||||
String bvid = item.modules.moduleDynamic.major.archive.bvid;
|
|
||||||
var res = await UserHttp.toViewLater(bvid: bvid);
|
var res = await UserHttp.toViewLater(bvid: bvid);
|
||||||
SmartDialog.showToast(res['msg']);
|
SmartDialog.showToast(res['msg']);
|
||||||
Get.back();
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
SmartDialog.showToast('出错了:${err.toString()}');
|
SmartDialog.showToast('出错了:${err.toString()}');
|
||||||
}
|
}
|
||||||
@@ -303,6 +311,15 @@ class AuthorPanel extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
minLeadingWidth: 0,
|
minLeadingWidth: 0,
|
||||||
),
|
),
|
||||||
|
ListTile(
|
||||||
|
onTap: () {
|
||||||
|
Get.back();
|
||||||
|
SavePanel.toSavePanel(item: item);
|
||||||
|
},
|
||||||
|
minLeadingWidth: 0,
|
||||||
|
leading: const Icon(Icons.save_alt, size: 19),
|
||||||
|
title: Text('保存动态', style: Theme.of(context).textTheme.titleSmall!),
|
||||||
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text(
|
title: Text(
|
||||||
'临时屏蔽:${item.modules.moduleAuthor.name}',
|
'临时屏蔽:${item.modules.moduleAuthor.name}',
|
||||||
@@ -320,15 +337,6 @@ class AuthorPanel extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
minLeadingWidth: 0,
|
minLeadingWidth: 0,
|
||||||
),
|
),
|
||||||
ListTile(
|
|
||||||
onTap: () {
|
|
||||||
Get.back();
|
|
||||||
SavePanel.toSavePanel(item: item);
|
|
||||||
},
|
|
||||||
minLeadingWidth: 0,
|
|
||||||
leading: const Icon(Icons.save_alt, size: 19),
|
|
||||||
title: Text('保存动态', style: Theme.of(context).textTheme.titleSmall!),
|
|
||||||
),
|
|
||||||
if (item.modules.moduleAuthor.mid == Accounts.main.mid) ...[
|
if (item.modules.moduleAuthor.mid == Accounts.main.mid) ...[
|
||||||
ListTile(
|
ListTile(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
|
|||||||
Reference in New Issue
Block a user