Merge branch 'fix' into alpha

This commit is contained in:
guozhigq
2023-09-18 23:52:14 +08:00
4 changed files with 47 additions and 38 deletions

View File

@ -238,7 +238,7 @@ class UserHttp {
var res = await Request().post( var res = await Request().post(
Api.delHistory, Api.delHistory,
queryParameters: { queryParameters: {
'kid': 'archive_$kid', 'kid': kid,
'jsonp': 'jsonp', 'jsonp': 'jsonp',
'csrf': await Request.getCsrf(), 'csrf': await Request.getCsrf(),
}, },

View File

@ -123,8 +123,15 @@ class HistoryController extends GetxController {
} }
// 删除某条历史记录 // 删除某条历史记录
Future delHistory(kid) async { Future delHistory(kid, business) async {
var res = await UserHttp.delHistory(kid); String resKid = 'archive_$kid';
if (business == 'live') {
resKid = 'live_$kid';
} else if (business.contains('article')) {
resKid = 'article_$kid';
}
var res = await UserHttp.delHistory(resKid);
if (res['status']) { if (res['status']) {
historyList.removeWhere((e) => e.kid == kid); historyList.removeWhere((e) => e.kid == kid);
SmartDialog.showToast(res['msg']); SmartDialog.showToast(res['msg']);
@ -136,7 +143,8 @@ class HistoryController extends GetxController {
List<HisListItem> result = List<HisListItem> result =
historyList.where((e) => e.progress == -1).toList(); historyList.where((e) => e.progress == -1).toList();
for (HisListItem i in result) { for (HisListItem i in result) {
await UserHttp.delHistory(i.kid); String resKid = 'archive_${i.kid}';
await UserHttp.delHistory(resKid);
historyList.removeWhere((e) => e.kid == i.kid); historyList.removeWhere((e) => e.kid == i.kid);
} }
SmartDialog.showToast('操作完成'); SmartDialog.showToast('操作完成');

View File

@ -247,26 +247,26 @@ class VideoContent extends StatelessWidget {
Theme.of(context).textTheme.labelMedium!.fontSize, Theme.of(context).textTheme.labelMedium!.fontSize,
color: Theme.of(context).colorScheme.outline), color: Theme.of(context).colorScheme.outline),
), ),
if (videoItem.badge != '番剧' && SizedBox(
!videoItem.tagName.contains('动画') && width: 24,
videoItem.history.business != 'live' && height: 24,
!videoItem.history.business.contains('article')) child: PopupMenuButton<String>(
SizedBox( padding: EdgeInsets.zero,
width: 24, tooltip: '功能菜单',
height: 24, icon: Icon(
child: PopupMenuButton<String>( Icons.more_vert_outlined,
padding: EdgeInsets.zero, color: Theme.of(context).colorScheme.outline,
tooltip: '功能菜单', size: 14,
icon: Icon( ),
Icons.more_vert_outlined, position: PopupMenuPosition.under,
color: Theme.of(context).colorScheme.outline, // constraints: const BoxConstraints(maxHeight: 35),
size: 14, onSelected: (String type) {},
), itemBuilder: (BuildContext context) =>
position: PopupMenuPosition.under, <PopupMenuEntry<String>>[
// constraints: const BoxConstraints(maxHeight: 35), if (videoItem.badge != '番剧' &&
onSelected: (String type) {}, !videoItem.tagName.contains('动画') &&
itemBuilder: (BuildContext context) => videoItem.history.business != 'live' &&
<PopupMenuEntry<String>>[ !videoItem.history.business.contains('article'))
PopupMenuItem<String>( PopupMenuItem<String>(
onTap: () async { onTap: () async {
var res = await UserHttp.toViewLater( var res = await UserHttp.toViewLater(
@ -283,21 +283,22 @@ class VideoContent extends StatelessWidget {
], ],
), ),
), ),
PopupMenuItem<String>( PopupMenuItem<String>(
onTap: () => ctr!.delHistory(videoItem.kid), onTap: () => ctr!.delHistory(
value: 'pause', videoItem.kid, videoItem.history.business),
height: 35, value: 'pause',
child: const Row( height: 35,
children: [ child: const Row(
Icon(Icons.close_outlined, size: 16), children: [
SizedBox(width: 6), Icon(Icons.close_outlined, size: 16),
Text('删除记录', style: TextStyle(fontSize: 13)) SizedBox(width: 6),
], Text('删除记录', style: TextStyle(fontSize: 13))
), ],
), ),
], ),
), ],
), ),
),
], ],
), ),
], ],

View File

@ -294,7 +294,7 @@ class _MinePageState extends State<MinePage> {
), ),
), ),
InkWell( InkWell(
onTap: () => _mineController.pushFollow(), onTap: () => _mineController.pushFans(),
borderRadius: StyleString.mdRadius, borderRadius: StyleString.mdRadius,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,