mod: 番剧样式修改
This commit is contained in:
@ -36,7 +36,6 @@ class BangumiIntroController extends GetxController {
|
||||
RxBool isLoading = false.obs;
|
||||
|
||||
// 视频详情 请求返回
|
||||
Rx<VideoDetailData> videoDetail = VideoDetailData().obs;
|
||||
Rx<BangumiInfoModel> bangumiDetail = BangumiInfoModel().obs;
|
||||
|
||||
// 请求返回的信息
|
||||
@ -89,11 +88,6 @@ class BangumiIntroController extends GetxController {
|
||||
|
||||
// 获取番剧简介&选集
|
||||
Future queryBangumiIntro() async {
|
||||
var result = await SearchHttp.bangumiInfo(seasonId: seasonId, epId: epId);
|
||||
if (result['status']) {
|
||||
bangumiDetail.value = result['data'];
|
||||
epId = bangumiDetail.value.episodes!.first.id;
|
||||
}
|
||||
if (userLogin) {
|
||||
// 获取点赞状态
|
||||
queryHasLikeVideo();
|
||||
@ -102,6 +96,11 @@ class BangumiIntroController extends GetxController {
|
||||
// 获取收藏状态
|
||||
queryHasFavVideo();
|
||||
}
|
||||
var result = await SearchHttp.bangumiInfo(seasonId: seasonId, epId: epId);
|
||||
if (result['status']) {
|
||||
bangumiDetail.value = result['data'];
|
||||
epId = bangumiDetail.value.episodes!.first.id;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -132,15 +131,10 @@ class BangumiIntroController extends GetxController {
|
||||
Future actionLikeVideo() async {
|
||||
var result = await VideoHttp.likeVideo(bvid: bvid, type: !hasLike.value);
|
||||
if (result['status']) {
|
||||
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;
|
||||
}
|
||||
SmartDialog.showToast(!hasLike.value ? '点赞成功 👍' : '取消赞');
|
||||
hasLike.value = !hasLike.value;
|
||||
bangumiDetail.value.stat!['likes'] =
|
||||
bangumiDetail.value.stat!['likes'] + (!hasLike.value ? 1 : -1);
|
||||
hasLike.refresh();
|
||||
} else {
|
||||
SmartDialog.showToast(result['msg']);
|
||||
@ -193,8 +187,8 @@ class BangumiIntroController extends GetxController {
|
||||
if (res['status']) {
|
||||
SmartDialog.showToast('投币成功 👏');
|
||||
hasCoin.value = true;
|
||||
videoDetail.value.stat!.coin =
|
||||
videoDetail.value.stat!.coin! + _tempThemeValue;
|
||||
bangumiDetail.value.stat!['coins'] =
|
||||
bangumiDetail.value.stat!['coins'] + _tempThemeValue;
|
||||
} else {
|
||||
SmartDialog.showToast(res['msg']);
|
||||
}
|
||||
@ -287,4 +281,13 @@ class BangumiIntroController extends GetxController {
|
||||
await VideoHttp.bangumiDel(seasonId: bangumiDetail.value.seasonId);
|
||||
SmartDialog.showToast(result['msg']);
|
||||
}
|
||||
|
||||
Future queryVideoInFolder() async {
|
||||
var result = await VideoHttp.videoInFolder(
|
||||
mid: user.get(UserBoxKey.userMid), rid: IdUtils.bv2av(bvid));
|
||||
if (result['status']) {
|
||||
favFolderData.value = result['data'];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,6 +33,7 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
|
||||
final BangumiIntroController bangumiIntroController =
|
||||
Get.put(BangumiIntroController(), tag: Get.arguments['heroTag']);
|
||||
BangumiInfoModel? bangumiDetail;
|
||||
late Future _futureBuilderFuture;
|
||||
|
||||
// 添加页面缓存
|
||||
@override
|
||||
@ -44,13 +45,14 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
|
||||
bangumiIntroController.bangumiDetail.listen((value) {
|
||||
bangumiDetail = value;
|
||||
});
|
||||
_futureBuilderFuture = bangumiIntroController.queryBangumiIntro();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
super.build(context);
|
||||
return FutureBuilder(
|
||||
future: bangumiIntroController.queryBangumiIntro(),
|
||||
future: _futureBuilderFuture,
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.done) {
|
||||
if (snapshot.data['status']) {
|
||||
@ -356,10 +358,10 @@ class _BangumiInfoState extends State<BangumiInfo> {
|
||||
selectIcon: const Icon(FontAwesomeIcons.solidThumbsUp),
|
||||
onTap: () => bangumiIntroController.actionLikeVideo(),
|
||||
selectStatus: bangumiIntroController.hasLike.value,
|
||||
loadingStatus: widget.loadingStatus,
|
||||
loadingStatus: false,
|
||||
text: !widget.loadingStatus
|
||||
? widget.bangumiDetail!.stat!['likes']!.toString()
|
||||
: '-'),
|
||||
: bangumiItem!.stat!['likes']!.toString()),
|
||||
),
|
||||
Obx(
|
||||
() => ActionItem(
|
||||
@ -367,10 +369,10 @@ class _BangumiInfoState extends State<BangumiInfo> {
|
||||
selectIcon: const Icon(FontAwesomeIcons.b),
|
||||
onTap: () => bangumiIntroController.actionCoinVideo(),
|
||||
selectStatus: bangumiIntroController.hasCoin.value,
|
||||
loadingStatus: widget.loadingStatus,
|
||||
loadingStatus: false,
|
||||
text: !widget.loadingStatus
|
||||
? widget.bangumiDetail!.stat!['coins']!.toString()
|
||||
: '-'),
|
||||
: bangumiItem!.stat!['coins']!.toString()),
|
||||
),
|
||||
Obx(
|
||||
() => ActionItem(
|
||||
@ -378,29 +380,29 @@ class _BangumiInfoState extends State<BangumiInfo> {
|
||||
selectIcon: const Icon(FontAwesomeIcons.solidStar),
|
||||
onTap: () => showFavBottomSheet(),
|
||||
selectStatus: bangumiIntroController.hasFav.value,
|
||||
loadingStatus: widget.loadingStatus,
|
||||
loadingStatus: false,
|
||||
text: !widget.loadingStatus
|
||||
? widget.bangumiDetail!.stat!['favorite']!.toString()
|
||||
: '-'),
|
||||
: bangumiItem!.stat!['favorite']!.toString()),
|
||||
),
|
||||
ActionItem(
|
||||
icon: const Icon(FontAwesomeIcons.comment),
|
||||
selectIcon: const Icon(FontAwesomeIcons.reply),
|
||||
onTap: () => videoDetailCtr!.tabCtr!.animateTo(1),
|
||||
onTap: () => videoDetailCtr.tabCtr!.animateTo(1),
|
||||
selectStatus: false,
|
||||
loadingStatus: widget.loadingStatus,
|
||||
loadingStatus: false,
|
||||
text: !widget.loadingStatus
|
||||
? widget.bangumiDetail!.stat!['reply']!.toString()
|
||||
: '-',
|
||||
: bangumiItem!.stat!['reply']!.toString(),
|
||||
),
|
||||
ActionItem(
|
||||
icon: const Icon(FontAwesomeIcons.shareFromSquare),
|
||||
onTap: () => bangumiIntroController.actionShareVideo(),
|
||||
selectStatus: false,
|
||||
loadingStatus: widget.loadingStatus,
|
||||
loadingStatus: false,
|
||||
text: !widget.loadingStatus
|
||||
? widget.bangumiDetail!.stat!['share']!.toString()
|
||||
: '-'),
|
||||
: bangumiItem!.stat!['share']!.toString()),
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -464,9 +466,6 @@ class _BangumiInfoState extends State<BangumiInfo> {
|
||||
onTap: () => videoIntroController.actionShareVideo(),
|
||||
selectStatus: false,
|
||||
loadingStatus: widget.loadingStatus,
|
||||
// text: !widget.loadingStatus
|
||||
// ? widget.videoDetail!.stat!.share!.toString()
|
||||
// : '-',
|
||||
text: '转发'),
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user