Skip to content

Commit

Permalink
fix: 修复收藏已关注up视频无变化;快速收藏没有加载弹窗;快速收藏不能快速取消;快速收藏专属提示
Browse files Browse the repository at this point in the history
  • Loading branch information
orz12 committed Feb 18, 2024
1 parent b4452fd commit bf7667f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 25 deletions.
24 changes: 11 additions & 13 deletions lib/pages/video/detail/introduction/controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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!;
Expand All @@ -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']);
}
Expand All @@ -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']);
}
Expand Down
13 changes: 1 addition & 12 deletions lib/pages/video/detail/introduction/view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -175,18 +175,7 @@ class _VideoInfoState extends State<VideoInfo> 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,
Expand Down

0 comments on commit bf7667f

Please sign in to comment.