mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
feat: report video
This commit is contained in:
@@ -5,6 +5,7 @@ import 'dart:math';
|
||||
import 'package:PiliPalaX/common/constants.dart';
|
||||
import 'package:PiliPalaX/http/loading_state.dart';
|
||||
import 'package:PiliPalaX/utils/extension.dart';
|
||||
import 'package:PiliPalaX/utils/id_utils.dart';
|
||||
import 'package:auto_orientation/auto_orientation.dart';
|
||||
import 'package:floating/floating.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
@@ -557,17 +558,37 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
elevation: 0,
|
||||
scrolledUnderElevation: 0,
|
||||
backgroundColor: Colors.transparent,
|
||||
actions: [
|
||||
IconButton(
|
||||
tooltip: '稍后再看',
|
||||
onPressed: () async {
|
||||
actions: (videoDetailController.userInfo == null)
|
||||
? null
|
||||
: [
|
||||
PopupMenuButton<String>(
|
||||
onSelected: (String type) async {
|
||||
switch (type) {
|
||||
case 'later':
|
||||
var res = await UserHttp.toViewLater(
|
||||
bvid: videoDetailController.bvid);
|
||||
SmartDialog.showToast(res['msg']);
|
||||
break;
|
||||
case 'report':
|
||||
Get.toNamed('/webviewnew', parameters: {
|
||||
'url':
|
||||
'https://www.bilibili.com/appeal/?avid=${IdUtils.bv2av(videoDetailController.bvid)}&bvid=${videoDetailController.bvid}'
|
||||
});
|
||||
break;
|
||||
}
|
||||
},
|
||||
icon: const Icon(Icons.history_outlined),
|
||||
itemBuilder: (BuildContext context) =>
|
||||
<PopupMenuEntry<String>>[
|
||||
const PopupMenuItem<String>(
|
||||
value: 'later',
|
||||
child: Text('稍后再看'),
|
||||
),
|
||||
const PopupMenuItem<String>(
|
||||
value: 'report',
|
||||
child: Text('举报'),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(width: 14)
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user