From bf7667faee5b2829b571c3ff04cecfbf5481bf59 Mon Sep 17 00:00:00 2001 From: orz12 Date: Sun, 18 Feb 2024 20:04:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=94=B6=E8=97=8F?= =?UTF-8?q?=E5=B7=B2=E5=85=B3=E6=B3=A8up=E8=A7=86=E9=A2=91=E6=97=A0?= =?UTF-8?q?=E5=8F=98=E5=8C=96=EF=BC=9B=E5=BF=AB=E9=80=9F=E6=94=B6=E8=97=8F?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=8A=A0=E8=BD=BD=E5=BC=B9=E7=AA=97=EF=BC=9B?= =?UTF-8?q?=E5=BF=AB=E9=80=9F=E6=94=B6=E8=97=8F=E4=B8=8D=E8=83=BD=E5=BF=AB?= =?UTF-8?q?=E9=80=9F=E5=8F=96=E6=B6=88=EF=BC=9B=E5=BF=AB=E9=80=9F=E6=94=B6?= =?UTF-8?q?=E8=97=8F=E4=B8=93=E5=B1=9E=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../video/detail/introduction/controller.dart | 24 +++++++++---------- lib/pages/video/detail/introduction/view.dart | 13 +--------- 2 files changed, 12 insertions(+), 25 deletions(-) diff --git a/lib/pages/video/detail/introduction/controller.dart b/lib/pages/video/detail/introduction/controller.dart index 5dd5c81c..e68e3da4 100644 --- a/lib/pages/video/detail/introduction/controller.dart +++ b/lib/pages/video/detail/introduction/controller.dart @@ -296,6 +296,7 @@ class VideoIntroController extends GetxController { Future actionFavVideo({type = 'choose'}) async { // 收藏至默认文件夹 if (type == 'default') { + SmartDialog.showLoading(msg: '请求中'); await queryVideoInFolder(); int defaultFolderId = favFolderData.value.list!.first.id!; int favStatus = favFolderData.value.list!.first.favState!; @@ -304,12 +305,11 @@ class VideoIntroController extends GetxController { addIds: favStatus == 0 ? '$defaultFolderId' : '', delIds: favStatus == 1 ? '$defaultFolderId' : '', ); + SmartDialog.dismiss(); if (result['status']) { - if (result['data']['prompt']) { - // 重新获取收藏状态 - await queryHasFavVideo(); - SmartDialog.showToast('✅ 操作成功'); - } + // 重新获取收藏状态 + await queryHasFavVideo(); + SmartDialog.showToast('✅ 快速收藏/取消收藏成功'); } else { SmartDialog.showToast(result['msg']); } @@ -334,14 +334,12 @@ class VideoIntroController extends GetxController { delIds: delMediaIdsNew.join(',')); SmartDialog.dismiss(); if (result['status']) { - if (result['data']['prompt']) { - addMediaIdsNew = []; - delMediaIdsNew = []; - Get.back(); - // 重新获取收藏状态 - await queryHasFavVideo(); - SmartDialog.showToast('✅ 操作成功'); - } + addMediaIdsNew = []; + delMediaIdsNew = []; + Get.back(); + // 重新获取收藏状态 + await queryHasFavVideo(); + SmartDialog.showToast('✅ 操作成功'); } else { SmartDialog.showToast(result['msg']); } diff --git a/lib/pages/video/detail/introduction/view.dart b/lib/pages/video/detail/introduction/view.dart index 4098bc0d..63f9d651 100644 --- a/lib/pages/video/detail/introduction/view.dart +++ b/lib/pages/video/detail/introduction/view.dart @@ -175,18 +175,7 @@ class _VideoInfoState extends State with TickerProviderStateMixin { // 长按选择文件夹 if (enableDragQuickFav) { if (type == 'tap') { - if (!videoIntroController.hasFav.value) { - videoIntroController.actionFavVideo(type: 'default'); - } else { - showModalBottomSheet( - context: context, - useRootNavigator: true, - isScrollControlled: true, - builder: (BuildContext context) { - return FavPanel(ctr: videoIntroController); - }, - ); - } + videoIntroController.actionFavVideo(type: 'default'); } else { showModalBottomSheet( context: context,