mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-06 10:07:48 +08:00
@@ -157,56 +157,39 @@ class _HistoryPageState extends State<HistoryPage>
|
||||
onPressed: () => Get.toNamed('/historySearch'),
|
||||
icon: const Icon(Icons.search_outlined),
|
||||
),
|
||||
PopupMenuButton<String>(
|
||||
onSelected: (String type) {
|
||||
switch (type) {
|
||||
case 'pause':
|
||||
_historyController.baseCtr.onPauseHistory(
|
||||
context,
|
||||
);
|
||||
break;
|
||||
case 'clear':
|
||||
_historyController.baseCtr.onClearHistory(
|
||||
context,
|
||||
() {
|
||||
_historyController.loadingState.value = const Success(
|
||||
null,
|
||||
);
|
||||
if (_historyController.tabController != null) {
|
||||
for (final item in _historyController.tabs) {
|
||||
try {
|
||||
Get.find<HistoryController>(
|
||||
tag: item.type,
|
||||
).loadingState.value = const Success(
|
||||
null,
|
||||
);
|
||||
} catch (_) {}
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
break;
|
||||
case 'viewed':
|
||||
currCtr().onDelViewedHistory();
|
||||
break;
|
||||
}
|
||||
},
|
||||
itemBuilder: (BuildContext context) => <PopupMenuEntry<String>>[
|
||||
PopupMenuItem<String>(
|
||||
value: 'pause',
|
||||
PopupMenuButton(
|
||||
itemBuilder: (_) => [
|
||||
PopupMenuItem(
|
||||
onTap: () => _historyController.baseCtr.onPauseHistory(context),
|
||||
child: Text(
|
||||
!_historyController.baseCtr.pauseStatus.value
|
||||
? '暂停观看记录'
|
||||
: '恢复观看记录',
|
||||
),
|
||||
),
|
||||
const PopupMenuItem<String>(
|
||||
value: 'clear',
|
||||
child: Text('清空观看记录'),
|
||||
PopupMenuItem(
|
||||
onTap: () => _historyController.baseCtr.onClearHistory(
|
||||
context,
|
||||
() {
|
||||
_historyController.loadingState.value = const Success(null);
|
||||
if (_historyController.tabController != null) {
|
||||
for (final item in _historyController.tabs) {
|
||||
try {
|
||||
Get.find<HistoryController>(
|
||||
tag: item.type,
|
||||
).loadingState.value = const Success(
|
||||
null,
|
||||
);
|
||||
} catch (_) {}
|
||||
}
|
||||
}
|
||||
},
|
||||
),
|
||||
child: const Text('清空观看记录'),
|
||||
),
|
||||
const PopupMenuItem<String>(
|
||||
value: 'viewed',
|
||||
child: Text('删除已看记录'),
|
||||
PopupMenuItem(
|
||||
onTap: currCtr().onDelViewedHistory,
|
||||
child: const Text('删除已看记录'),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -182,7 +182,7 @@ class HistoryItem extends StatelessWidget {
|
||||
child: SizedBox(
|
||||
width: 29,
|
||||
height: 29,
|
||||
child: PopupMenuButton<String>(
|
||||
child: PopupMenuButton(
|
||||
padding: EdgeInsets.zero,
|
||||
tooltip: '功能菜单',
|
||||
icon: Icon(
|
||||
@@ -191,61 +191,60 @@ class HistoryItem extends StatelessWidget {
|
||||
size: 18,
|
||||
),
|
||||
position: PopupMenuPosition.under,
|
||||
itemBuilder: (BuildContext context) =>
|
||||
<PopupMenuEntry<String>>[
|
||||
if (item.authorMid != null &&
|
||||
item.authorName?.isNotEmpty == true)
|
||||
PopupMenuItem<String>(
|
||||
onTap: () =>
|
||||
Get.toNamed('/member?mid=${item.authorMid}'),
|
||||
height: 35,
|
||||
child: Row(
|
||||
children: [
|
||||
const Icon(
|
||||
MdiIcons.accountCircleOutline,
|
||||
size: 16,
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
Text(
|
||||
'访问:${item.authorName}',
|
||||
style: const TextStyle(fontSize: 13),
|
||||
),
|
||||
],
|
||||
itemBuilder: (_) => [
|
||||
if (item.authorMid != null &&
|
||||
item.authorName?.isNotEmpty == true)
|
||||
PopupMenuItem(
|
||||
onTap: () =>
|
||||
Get.toNamed('/member?mid=${item.authorMid}'),
|
||||
height: 38,
|
||||
child: Row(
|
||||
children: [
|
||||
const Icon(
|
||||
MdiIcons.accountCircleOutline,
|
||||
size: 16,
|
||||
),
|
||||
),
|
||||
if (business != 'pgc' &&
|
||||
item.badge != '番剧' &&
|
||||
item.tagName?.contains('动画') != true &&
|
||||
business != 'live' &&
|
||||
business?.contains('article') != true)
|
||||
PopupMenuItem<String>(
|
||||
onTap: () async {
|
||||
final res = await UserHttp.toViewLater(
|
||||
bvid: item.history.bvid,
|
||||
);
|
||||
SmartDialog.showToast(res['msg']);
|
||||
},
|
||||
height: 35,
|
||||
child: const Row(
|
||||
children: [
|
||||
Icon(Icons.watch_later_outlined, size: 16),
|
||||
SizedBox(width: 6),
|
||||
Text('稍后再看', style: TextStyle(fontSize: 13)),
|
||||
],
|
||||
const SizedBox(width: 6),
|
||||
Text(
|
||||
'访问:${item.authorName}',
|
||||
style: const TextStyle(fontSize: 13),
|
||||
),
|
||||
),
|
||||
PopupMenuItem<String>(
|
||||
onTap: () => onDelete(item.kid!, business!),
|
||||
height: 35,
|
||||
child: const Row(
|
||||
children: [
|
||||
Icon(Icons.close_outlined, size: 16),
|
||||
SizedBox(width: 6),
|
||||
Text('删除记录', style: TextStyle(fontSize: 13)),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
if (business != 'pgc' &&
|
||||
item.badge != '番剧' &&
|
||||
item.tagName?.contains('动画') != true &&
|
||||
business != 'live' &&
|
||||
business?.contains('article') != true)
|
||||
PopupMenuItem(
|
||||
onTap: () async {
|
||||
final res = await UserHttp.toViewLater(
|
||||
bvid: item.history.bvid,
|
||||
);
|
||||
SmartDialog.showToast(res['msg']);
|
||||
},
|
||||
height: 38,
|
||||
child: const Row(
|
||||
children: [
|
||||
Icon(Icons.watch_later_outlined, size: 16),
|
||||
SizedBox(width: 6),
|
||||
Text('稍后再看', style: TextStyle(fontSize: 13)),
|
||||
],
|
||||
),
|
||||
),
|
||||
PopupMenuItem(
|
||||
onTap: () => onDelete(item.kid!, business!),
|
||||
height: 38,
|
||||
child: const Row(
|
||||
children: [
|
||||
Icon(Icons.close_outlined, size: 16),
|
||||
SizedBox(width: 6),
|
||||
Text('删除记录', style: TextStyle(fontSize: 13)),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user