mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
report panel (#385)
This commit is contained in:
committed by
GitHub
parent
bf4ecc85dd
commit
5cc9c59c76
@@ -2,11 +2,14 @@ import 'dart:math';
|
||||
|
||||
import 'package:PiliPlus/common/constants.dart';
|
||||
import 'package:PiliPlus/common/widgets/imageview.dart';
|
||||
import 'package:PiliPlus/common/widgets/report.dart';
|
||||
import 'package:PiliPlus/http/init.dart';
|
||||
import 'package:PiliPlus/http/video.dart';
|
||||
import 'package:PiliPlus/models/dynamics/result.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:PiliPlus/utils/global_data.dart';
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
@@ -1034,16 +1037,24 @@ class MorePanel extends StatelessWidget {
|
||||
switch (type) {
|
||||
case 'report':
|
||||
Get.back();
|
||||
dynamic result = await Get.toNamed(
|
||||
'/webview',
|
||||
parameters: {
|
||||
'url':
|
||||
'https://www.bilibili.com/h5/comment/report?mid=${item.mid}&oid=${item.oid}&pageType=1&rpid=${item.rpid}&platform=android',
|
||||
},
|
||||
);
|
||||
if (result == true) {
|
||||
onDelete?.call(item.rpid!);
|
||||
}
|
||||
autoWrapReportDialog(Get.context!, ReportOptions.commentReport,
|
||||
(reasonType, reasonDesc, banUid) async {
|
||||
final res = await Request().post('/x/v2/reply/report',
|
||||
data: {
|
||||
'add_blacklist': banUid.toString(),
|
||||
'csrf': await Request.getCsrf(),
|
||||
'gaia_source': 'main_h5',
|
||||
'oid': item.oid.toString(),
|
||||
'platform': 'android',
|
||||
'reason': reasonType.toString(),
|
||||
'rpid': item.rpid.toString(),
|
||||
'scene': 'main',
|
||||
'type': '1',
|
||||
if (reasonType == 0) 'content': reasonDesc!
|
||||
},
|
||||
options: Options(contentType: Headers.formUrlEncodedContentType));
|
||||
return res.data as Map;
|
||||
});
|
||||
break;
|
||||
case 'copyAll':
|
||||
Get.back();
|
||||
|
||||
@@ -3,13 +3,16 @@ import 'dart:math';
|
||||
import 'package:PiliPlus/common/constants.dart';
|
||||
import 'package:PiliPlus/common/widgets/badge.dart';
|
||||
import 'package:PiliPlus/common/widgets/imageview.dart';
|
||||
import 'package:PiliPlus/common/widgets/report.dart';
|
||||
import 'package:PiliPlus/grpc/app/main/community/reply/v1/reply.pb.dart';
|
||||
import 'package:PiliPlus/http/init.dart';
|
||||
import 'package:PiliPlus/http/video.dart';
|
||||
import 'package:PiliPlus/models/dynamics/result.dart';
|
||||
import 'package:PiliPlus/pages/video/detail/reply/widgets/zan_grpc.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:PiliPlus/utils/global_data.dart';
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
@@ -1074,16 +1077,25 @@ class ReplyItemGrpc extends StatelessWidget {
|
||||
switch (type) {
|
||||
case 'report':
|
||||
Get.back();
|
||||
dynamic result = await Get.toNamed(
|
||||
'/webview',
|
||||
parameters: {
|
||||
'url':
|
||||
'https://www.bilibili.com/h5/comment/report?mid=${item.mid}&oid=${item.oid}&pageType=1&rpid=${item.id}&platform=android',
|
||||
},
|
||||
);
|
||||
if (result == true) {
|
||||
onDelete?.call(item.id.toInt());
|
||||
}
|
||||
autoWrapReportDialog(context, ReportOptions.commentReport,
|
||||
(reasonType, reasonDesc, banUid) async {
|
||||
final res = await Request().post('/x/v2/reply/report',
|
||||
data: {
|
||||
'add_blacklist': banUid.toString(),
|
||||
'csrf': await Request.getCsrf(),
|
||||
'gaia_source': 'main_h5',
|
||||
'oid': item.oid.toString(),
|
||||
'platform': 'android',
|
||||
'reason': reasonType.toString(),
|
||||
'rpid': item.id.toString(),
|
||||
'scene': 'main',
|
||||
'type': '1',
|
||||
if (reasonType == 0) 'content': reasonDesc!
|
||||
},
|
||||
options:
|
||||
Options(contentType: Headers.formUrlEncodedContentType));
|
||||
return res.data as Map;
|
||||
});
|
||||
break;
|
||||
case 'copyAll':
|
||||
Get.back();
|
||||
|
||||
Reference in New Issue
Block a user