mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
view later (#419)
This commit is contained in:
committed by
GitHub
parent
59797a2f5f
commit
99cdec62a1
@@ -59,6 +59,8 @@ class VideoIntroController extends GetxController
|
||||
RxBool hasCoin = false.obs;
|
||||
// 是否收藏
|
||||
RxBool hasFav = false.obs;
|
||||
// 是否稍后再看
|
||||
RxBool hasLater = false.obs;
|
||||
bool isLogin = false;
|
||||
Rx<FavFolderData> favFolderData = FavFolderData().obs;
|
||||
List? favIds;
|
||||
@@ -308,6 +310,14 @@ class VideoIntroController extends GetxController
|
||||
}
|
||||
}
|
||||
|
||||
Future viewLater() async {
|
||||
var res = await (hasLater.value
|
||||
? UserHttp.toViewDel(aids: [IdUtils.bv2av(bvid)])
|
||||
: await UserHttp.toViewLater(bvid: bvid));
|
||||
if (res['status']) hasLater.value = !hasLater.value;
|
||||
SmartDialog.showToast(res['msg']);
|
||||
}
|
||||
|
||||
void coinVideo(int coin, [bool selectLike = false]) async {
|
||||
if (videoDetail.value.stat?.coin == null) {
|
||||
// not init
|
||||
|
||||
@@ -889,12 +889,6 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
|
||||
text: "点踩",
|
||||
),
|
||||
),
|
||||
// ActionItem(
|
||||
// icon: const Icon(FontAwesomeIcons.clock),
|
||||
// onTap: () => videoIntroController.actionShareVideo(),
|
||||
// selectStatus: false,
|
||||
// loadingStatus: loadingStatus,
|
||||
// text: '稍后再看'),
|
||||
Obx(
|
||||
() => ActionItem(
|
||||
key: _coinKey,
|
||||
@@ -927,16 +921,16 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
|
||||
needAnim: true,
|
||||
),
|
||||
),
|
||||
ActionItem(
|
||||
icon: const Icon(FontAwesomeIcons.comment),
|
||||
onTap: () => videoDetailCtr.tabCtr
|
||||
.animateTo(videoDetailCtr.tabCtr.index == 1 ? 0 : 1),
|
||||
selectStatus: false,
|
||||
loadingStatus: widget.loadingStatus,
|
||||
semanticsLabel: '评论',
|
||||
text: !widget.loadingStatus
|
||||
? Utils.numFormat(videoDetail.stat!.reply!)
|
||||
: '评论',
|
||||
Obx(
|
||||
() => ActionItem(
|
||||
icon: const Icon(FontAwesomeIcons.clock),
|
||||
selectIcon: const Icon(FontAwesomeIcons.solidClock),
|
||||
onTap: () => handleState(videoIntroController.viewLater),
|
||||
selectStatus: videoIntroController.hasLater.value,
|
||||
loadingStatus: widget.loadingStatus,
|
||||
semanticsLabel: '再看',
|
||||
text: '再看',
|
||||
),
|
||||
),
|
||||
ActionItem(
|
||||
icon: const Icon(FontAwesomeIcons.shareFromSquare),
|
||||
|
||||
@@ -1058,9 +1058,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
onSelected: (String type) async {
|
||||
switch (type) {
|
||||
case 'later':
|
||||
var res = await UserHttp.toViewLater(
|
||||
bvid: videoDetailController.bvid);
|
||||
SmartDialog.showToast(res['msg']);
|
||||
await videoIntroController.viewLater();
|
||||
break;
|
||||
case 'report':
|
||||
if (videoDetailController.userInfo == null) {
|
||||
|
||||
@@ -881,13 +881,8 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
onSelected: (String type) async {
|
||||
switch (type) {
|
||||
case 'later':
|
||||
var res = await UserHttp
|
||||
.toViewLater(
|
||||
bvid:
|
||||
videoDetailController
|
||||
.bvid);
|
||||
SmartDialog.showToast(
|
||||
res['msg']);
|
||||
await videoIntroController
|
||||
.viewLater();
|
||||
break;
|
||||
case 'report':
|
||||
if (videoDetailController
|
||||
@@ -1449,9 +1444,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
onSelected: (String type) async {
|
||||
switch (type) {
|
||||
case 'later':
|
||||
var res = await UserHttp.toViewLater(
|
||||
bvid: videoDetailController.bvid);
|
||||
SmartDialog.showToast(res['msg']);
|
||||
await videoIntroController.viewLater();
|
||||
break;
|
||||
case 'report':
|
||||
if (videoDetailController.userInfo == null) {
|
||||
|
||||
Reference in New Issue
Block a user