diff --git a/lib/http/video.dart b/lib/http/video.dart index 37522d4f..1de728cb 100644 --- a/lib/http/video.dart +++ b/lib/http/video.dart @@ -199,7 +199,7 @@ class VideoHttp { if (res.data['code'] == 0) { return {'status': true, 'data': res.data['data']}; } else { - return {'status': true, 'data': [], 'msg': ''}; + return {'status': false, 'data': [], 'msg': res.data['message']}; } } diff --git a/lib/pages/video/detail/introduction/controller.dart b/lib/pages/video/detail/introduction/controller.dart index ffc13d7c..bb208b3b 100644 --- a/lib/pages/video/detail/introduction/controller.dart +++ b/lib/pages/video/detail/introduction/controller.dart @@ -184,9 +184,11 @@ class VideoIntroController extends GetxController { if (!hasLike.value) { SmartDialog.showToast('į‚ščĩžæˆåŠŸ 👍'); hasLike.value = true; + videoDetail.value.stat!.like = videoDetail.value.stat!.like! + 1; } else if (hasLike.value) { SmartDialog.showToast('取æļˆčĩž'); hasLike.value = false; + videoDetail.value.stat!.like = videoDetail.value.stat!.like! - 1; } hasLike.refresh(); } else { @@ -238,12 +240,14 @@ class VideoIntroController extends GetxController { var res = await VideoHttp.coinVideo( bvid: bvid, multiply: _tempThemeValue); if (res['status']) { - SmartDialog.showToast('投币成功'); + SmartDialog.showToast('投币成功 👏'); + hasCoin.value = true; + videoDetail.value.stat!.coin = + videoDetail.value.stat!.coin! + _tempThemeValue; } else { SmartDialog.showToast(res['msg']); } Get.back(); - queryHasCoinVideo(); }, child: const Text('įĄŽåŽš')) ], diff --git a/lib/pages/video/detail/introduction/widgets/action_row_item.dart b/lib/pages/video/detail/introduction/widgets/action_row_item.dart index 0d3f2bd7..254d7bcd 100644 --- a/lib/pages/video/detail/introduction/widgets/action_row_item.dart +++ b/lib/pages/video/detail/introduction/widgets/action_row_item.dart @@ -44,14 +44,22 @@ class ActionRowItem extends StatelessWidget { AnimatedOpacity( opacity: loadingStatus! ? 0 : 1, duration: const Duration(milliseconds: 200), - child: Text( - text ?? '', - style: TextStyle( - color: selectStatus - ? Theme.of(context).colorScheme.primary - : null, - fontSize: - Theme.of(context).textTheme.labelMedium?.fontSize), + child: AnimatedSwitcher( + duration: const Duration(milliseconds: 300), + transitionBuilder: + (Widget child, Animation animation) { + return ScaleTransition(scale: animation, child: child); + }, + child: Text( + text ?? '', + key: ValueKey(text ?? ''), + style: TextStyle( + color: selectStatus + ? Theme.of(context).colorScheme.primary + : null, + fontSize: + Theme.of(context).textTheme.labelSmall!.fontSize), + ), ), ), ],