feat: 点赞投币状态刷新

This commit is contained in:
guozhigq
2023-07-26 00:16:42 +08:00
parent 7745ea076b
commit 9e5b7a405f
3 changed files with 23 additions and 11 deletions

View File

@ -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('确定'))
],