fix(player): 评论暂时隐藏举报与删除入口
This commit is contained in:
1 parent
838beaaa3e
commit
9bd46521aa
3 files changed
+45
-250
No files matched your search
@@ -17,7 +17,6 @@ import '../../../core/theme/app_colors.dart';
|
||||
import '../../../core/widgets/auth_gate.dart';
|
||||
import '../../../core/widgets/empty_state.dart';
|
||||
import '../../../l10n/app_localizations.dart';
|
||||
import '../../interaction/widgets/report_dialog.dart';
|
||||
import 'comment_tile.dart';
|
||||
|
||||
const double _minSheetHeight = 280;
|
||||
@@ -34,7 +33,7 @@ const double _replyBannerHeight = 46;
|
||||
const double _expandedInputRadius = 12;
|
||||
const double _postButtonHeight = 32;
|
||||
|
||||
/// 服务端评论底部弹窗:匿名列表、游标翻页、回复、举报和本人删除。
|
||||
/// 服务端评论底部弹窗:匿名列表、游标翻页、回复与登录发布。
|
||||
class DramaCommentsSheet extends StatefulWidget {
|
||||
const DramaCommentsSheet({super.key, required this.drama});
|
||||
|
||||
@@ -122,39 +121,6 @@ class _DramaCommentsSheetState extends State<DramaCommentsSheet> {
|
||||
_inputFocus.requestFocus();
|
||||
}
|
||||
|
||||
Future<void> _confirmDelete(DramaComment comment) async {
|
||||
final l10n = AppLocalizations.of(context)!;
|
||||
final confirmed = await showDialog<bool>(
|
||||
context: context,
|
||||
builder: (dialogContext) => AlertDialog(
|
||||
title: Text(l10n.deleteCommentTitle),
|
||||
content: Text(l10n.deleteCommentMessage),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(dialogContext).pop(false),
|
||||
child: Text(l10n.cancel),
|
||||
),
|
||||
FilledButton(
|
||||
key: const Key('comment-delete-confirm'),
|
||||
onPressed: () => Navigator.of(dialogContext).pop(true),
|
||||
child: Text(l10n.delete),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
if (confirmed != true || !mounted) return;
|
||||
final result = await _controller.delete(comment);
|
||||
if (!result.isSuccess) {
|
||||
if (!mounted) return;
|
||||
_showMessage(
|
||||
result.errorMessage ??
|
||||
AppLocalizations.of(context)!.commentDeleteFailed,
|
||||
);
|
||||
return;
|
||||
}
|
||||
await _refreshCount();
|
||||
}
|
||||
|
||||
Future<void> _refreshCount() async {
|
||||
final request = ++_countRequest;
|
||||
try {
|
||||
@@ -167,25 +133,6 @@ class _DramaCommentsSheetState extends State<DramaCommentsSheet> {
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _report(DramaComment comment) async {
|
||||
if (!await ensureSignedIn(context) || !mounted) return;
|
||||
final l10n = AppLocalizations.of(context)!;
|
||||
final draft = await showReportDialog(context, title: l10n.reportComment);
|
||||
if (draft == null || !mounted) return;
|
||||
unawaited(context.read<Haptics>().lightImpact());
|
||||
final result = await _controller.report(
|
||||
comment,
|
||||
reason: draft.reason,
|
||||
description: draft.description,
|
||||
);
|
||||
if (!mounted) return;
|
||||
_showMessage(
|
||||
result.isSuccess
|
||||
? l10n.reportSubmitted
|
||||
: result.errorMessage ?? l10n.reportFailed,
|
||||
);
|
||||
}
|
||||
|
||||
void _showMessage(String message) {
|
||||
ScaffoldMessenger.of(
|
||||
context,
|
||||
@@ -474,11 +421,7 @@ class _DramaCommentsSheetState extends State<DramaCommentsSheet> {
|
||||
return _CommentThread(
|
||||
comment: _controller.comments[index],
|
||||
controller: _controller,
|
||||
handlers: CommentInteractionHandlers(
|
||||
onReply: _beginReply,
|
||||
onDelete: _confirmDelete,
|
||||
onReport: _report,
|
||||
),
|
||||
handlers: CommentInteractionHandlers(onReply: _beginReply),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user