mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-21 01:26:59 +08:00
fix reply action
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -14,6 +14,7 @@ import 'package:PiliPlus/http/video.dart';
|
|||||||
import 'package:PiliPlus/models/common/badge_type.dart';
|
import 'package:PiliPlus/models/common/badge_type.dart';
|
||||||
import 'package:PiliPlus/models/common/image_type.dart';
|
import 'package:PiliPlus/models/common/image_type.dart';
|
||||||
import 'package:PiliPlus/pages/dynamics/widgets/vote.dart';
|
import 'package:PiliPlus/pages/dynamics/widgets/vote.dart';
|
||||||
|
import 'package:PiliPlus/pages/save_panel/view.dart';
|
||||||
import 'package:PiliPlus/pages/video/controller.dart';
|
import 'package:PiliPlus/pages/video/controller.dart';
|
||||||
import 'package:PiliPlus/pages/video/reply/widgets/zan_grpc.dart';
|
import 'package:PiliPlus/pages/video/reply/widgets/zan_grpc.dart';
|
||||||
import 'package:PiliPlus/utils/accounts.dart';
|
import 'package:PiliPlus/utils/accounts.dart';
|
||||||
@@ -920,6 +921,7 @@ class ReplyItemGrpc extends StatelessWidget {
|
|||||||
if (ownerMid == upMid || ownerMid == item.member.mid)
|
if (ownerMid == upMid || ownerMid == item.member.mid)
|
||||||
ListTile(
|
ListTile(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
|
Get.back();
|
||||||
bool? isDelete = await showDialog<bool>(
|
bool? isDelete = await showDialog<bool>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
@@ -1061,64 +1063,9 @@ class ReplyItemGrpc extends StatelessWidget {
|
|||||||
title: Text('自由复制', style: style),
|
title: Text('自由复制', style: style),
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
onTap: () async {
|
onTap: () {
|
||||||
Get.back();
|
Get.back();
|
||||||
bool? isDelete = await showDialog<bool>(
|
SavePanel.toSavePanel(upMid: upMid, item: item);
|
||||||
context: context,
|
|
||||||
builder: (context) {
|
|
||||||
final theme = Theme.of(context);
|
|
||||||
return AlertDialog(
|
|
||||||
title: const Text('删除评论'),
|
|
||||||
content: Text.rich(
|
|
||||||
TextSpan(
|
|
||||||
children: [
|
|
||||||
const TextSpan(text: '确定删除这条评论吗?\n\n'),
|
|
||||||
if (ownerMid != item.member.mid.toInt()) ...[
|
|
||||||
TextSpan(
|
|
||||||
text: '@${item.member.name}',
|
|
||||||
style: TextStyle(
|
|
||||||
color: theme.colorScheme.primary,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const TextSpan(text: ':\n'),
|
|
||||||
],
|
|
||||||
TextSpan(text: message),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
actions: <Widget>[
|
|
||||||
TextButton(
|
|
||||||
onPressed: () => Get.back(result: false),
|
|
||||||
child: Text(
|
|
||||||
'取消',
|
|
||||||
style: TextStyle(
|
|
||||||
color: theme.colorScheme.outline,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
TextButton(
|
|
||||||
onPressed: () => Get.back(result: true),
|
|
||||||
child: const Text('确定'),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
if (isDelete == true) {
|
|
||||||
SmartDialog.showLoading(msg: '删除中...');
|
|
||||||
var result = await VideoHttp.replyDel(
|
|
||||||
type: item.type.toInt(),
|
|
||||||
oid: item.oid.toInt(),
|
|
||||||
rpid: item.id.toInt(),
|
|
||||||
);
|
|
||||||
SmartDialog.dismiss();
|
|
||||||
if (result['status']) {
|
|
||||||
SmartDialog.showToast('删除成功');
|
|
||||||
onDelete();
|
|
||||||
} else {
|
|
||||||
SmartDialog.showToast('删除失败, ${result["msg"]}');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
minLeadingWidth: 0,
|
minLeadingWidth: 0,
|
||||||
leading: const Icon(Icons.save_alt, size: 19),
|
leading: const Icon(Icons.save_alt, size: 19),
|
||||||
|
|||||||
Reference in New Issue
Block a user