opt: reply del

This commit is contained in:
guozhigq
2024-11-14 00:19:05 +08:00
parent 0009630639
commit b93a3d08cc
5 changed files with 29 additions and 6 deletions

View File

@ -145,7 +145,15 @@ class VideoReplyController extends GetxController {
if (frpid != 0 && frpid != null) {
replyList.value = replyList.map((item) {
if (item.rpid! == frpid) {
return item..replies!.removeWhere((reply) => reply.rpid == rpid);
item.replies!.removeWhere((reply) => reply.rpid == rpid);
// 【共xx条回复】
if (item.replyControl != null &&
item.replyControl!.entryTextNum! >= 1) {
item.replyControl!.entryTextNum =
item.replyControl!.entryTextNum! - 1;
item.rcount = item.replyControl!.entryTextNum;
}
return item;
} else {
return item;
}

View File

@ -503,7 +503,7 @@ class ReplyItemRow extends StatelessWidget {
if (replyControl!.upReply!)
const TextSpan(text: 'up主等人 '),
TextSpan(
text: replyControl!.entryText!,
text: '查看${replyControl!.entryTextNum}条回复',
style: TextStyle(
color: colorScheme.primary,
),
@ -1089,16 +1089,12 @@ class MorePanel extends StatelessWidget {
TextButton(
onPressed: () async {
Get.back();
print('item.rpid: ${item.rpid}');
onDelete?.call(item.rpid!, item.root);
return;
var result = await ReplyHttp.replyDel(
type: item.type!,
oid: item.oid!,
rpid: item.rpid!,
);
if (result['status']) {
// SmartDialog.showToast('评论删除成功,需手动刷新');
onDelete?.call(item.rpid!, item.root);
Get.back();
} else {