opt models

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-06-04 15:20:35 +08:00
parent f50b1d2beb
commit b960359a39
858 changed files with 11000 additions and 12588 deletions

View File

@@ -4,14 +4,16 @@ import 'package:PiliPlus/grpc/bilibili/app/viewunite/pgcanymodel.pb.dart'
show ViewPgcAny;
import 'package:PiliPlus/grpc/view.dart';
import 'package:PiliPlus/http/constants.dart';
import 'package:PiliPlus/http/fav.dart';
import 'package:PiliPlus/http/user.dart';
import 'package:PiliPlus/http/video.dart';
import 'package:PiliPlus/models/pgc/pgc_info_model/episode.dart';
import 'package:PiliPlus/models/pgc/pgc_info_model/result.dart';
import 'package:PiliPlus/models/pgc_lcf.dart';
import 'package:PiliPlus/models/triple/pgc_triple.dart';
import 'package:PiliPlus/models/user/fav_folder.dart';
import 'package:PiliPlus/models/video_tag/data.dart';
import 'package:PiliPlus/models_new/fav/fav_video/data.dart';
import 'package:PiliPlus/models_new/fav/fav_video/list.dart';
import 'package:PiliPlus/models_new/pgc/pgc_info_model/episode.dart';
import 'package:PiliPlus/models_new/pgc/pgc_info_model/result.dart';
import 'package:PiliPlus/models_new/triple/pgc_triple.dart';
import 'package:PiliPlus/models_new/video/video_tag/data.dart';
import 'package:PiliPlus/pages/dynamics_repost/view.dart';
import 'package:PiliPlus/pages/video/controller.dart';
import 'package:PiliPlus/pages/video/introduction/ugc/controller.dart';
@@ -27,7 +29,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart';
class BangumiIntroController extends GetxController {
class PgcIntroController extends GetxController {
// 视频bvid
String bvid = Get.parameters['bvid'] ?? '';
var seasonId = Get.parameters['seasonId'] != null
@@ -42,7 +44,7 @@ class BangumiIntroController extends GetxController {
? '追番'
: '追剧';
final BangumiInfoModel bangumiItem = Get.arguments['bangumiItem'];
final PgcInfoModel pgcItem = Get.arguments['pgcItem'];
// 是否点赞
RxBool hasLike = false.obs;
@@ -56,7 +58,7 @@ class BangumiIntroController extends GetxController {
List<VideoTagItem>? videoTags;
List? favIds;
Rx<FavFolderData> favFolderData = FavFolderData().obs;
Rx<FavVideoData> favFolderData = FavVideoData().obs;
bool isLogin = Accounts.main.isLogin;
int mid = Accounts.main.mid;
@@ -72,7 +74,7 @@ class BangumiIntroController extends GetxController {
queryIsFollowed();
}
if (epId != null) {
queryBangumiLikeCoinFav();
queryPgcLikeCoinFav();
}
}
queryVideoTags();
@@ -86,8 +88,8 @@ class BangumiIntroController extends GetxController {
}
// 获取点赞/投币/收藏状态
Future<void> queryBangumiLikeCoinFav() async {
var result = await VideoHttp.bangumiLikeCoinFav(epId: epId);
Future<void> queryPgcLikeCoinFav() async {
var result = await VideoHttp.pgcLikeCoinFav(epId: epId);
if (result['status']) {
PgcLCF data = result['data'];
hasLike.value = data.like == 1;
@@ -103,8 +105,7 @@ class BangumiIntroController extends GetxController {
var result = await VideoHttp.likeVideo(bvid: bvid, type: !hasLike.value);
if (result['status']) {
SmartDialog.showToast(!hasLike.value ? result['data']['toast'] : '取消赞');
bangumiItem.stat!.likes =
bangumiItem.stat!.likes! + (!hasLike.value ? 1 : -1);
pgcItem.stat!.likes = pgcItem.stat!.likes! + (!hasLike.value ? 1 : -1);
hasLike.value = !hasLike.value;
} else {
SmartDialog.showToast(result['msg']);
@@ -119,10 +120,10 @@ class BangumiIntroController extends GetxController {
);
if (res['status']) {
SmartDialog.showToast('投币成功');
bangumiItem.stat!.coins = bangumiItem.stat!.coins! + coin;
pgcItem.stat!.coins = pgcItem.stat!.coins! + coin;
if (selectLike && !hasLike.value) {
hasLike.value = true;
bangumiItem.stat!.likes = bangumiItem.stat!.likes! + 1;
pgcItem.stat!.likes = pgcItem.stat!.likes! + 1;
}
_coinNum.value += coin;
GlobalData().afterCoin(coin);
@@ -154,8 +155,8 @@ class BangumiIntroController extends GetxController {
);
}
// (取消)收藏 bangumi
Future<void> actionFavVideo({type = 'choose'}) async {
// (取消)收藏 pgc
Future<void> actionFavVideo({String type = 'choose'}) async {
// 收藏至默认文件夹
if (type == 'default') {
SmartDialog.showLoading(msg: '请求中');
@@ -163,7 +164,7 @@ class BangumiIntroController extends GetxController {
if (res['status']) {
int defaultFolderId = favFolderData.value.list!.first.id!;
int favStatus = favFolderData.value.list!.first.favState!;
var result = await VideoHttp.favVideo(
var result = await FavHttp.favVideo(
aid: epId,
type: 24,
addIds: favStatus == 0 ? '$defaultFolderId' : '',
@@ -173,7 +174,7 @@ class BangumiIntroController extends GetxController {
if (result['status']) {
// 重新获取收藏状态
await Future.delayed(const Duration(milliseconds: 255));
await queryBangumiLikeCoinFav();
await queryPgcLikeCoinFav();
SmartDialog.showToast('✅ 快速收藏/取消收藏成功');
} else {
SmartDialog.showToast(result['msg']);
@@ -201,7 +202,7 @@ class BangumiIntroController extends GetxController {
}
}
} catch (_) {}
var result = await VideoHttp.favVideo(
var result = await FavHttp.favVideo(
aid: epId,
type: 24,
addIds: addMediaIdsNew.join(','),
@@ -211,7 +212,7 @@ class BangumiIntroController extends GetxController {
SmartDialog.showToast('操作成功');
Get.back();
Future.delayed(const Duration(milliseconds: 255), () {
queryBangumiLikeCoinFav();
queryPgcLikeCoinFav();
});
} else {
SmartDialog.showToast(result['msg']);
@@ -271,7 +272,7 @@ class BangumiIntroController extends GetxController {
),
onTap: () {
Get.back();
EpisodeItem? item = bangumiItem.episodes
EpisodeItem? item = pgcItem.episodes
?.firstWhereOrNull((item) => item.epId == epId);
showModalBottomSheet(
context: context,
@@ -296,9 +297,9 @@ class BangumiIntroController extends GetxController {
'5' || '7' => 4099,
_ => -1,
},
pic: bangumiItem.cover,
pic: pgcItem.cover,
title:
'${bangumiItem.title}${item != null ? '\n${item.showTitle}' : ''}',
'${pgcItem.title}${item != null ? '\n${item.showTitle}' : ''}',
uname: '',
),
);
@@ -313,9 +314,9 @@ class BangumiIntroController extends GetxController {
onTap: () {
Get.back();
try {
EpisodeItem item = bangumiItem.episodes!
EpisodeItem item = pgcItem.episodes!
.firstWhere((item) => item.epId == epId);
final title = '${bangumiItem.title!} ${item.showTitle}';
final title = '${item.title!} ${item.showTitle}';
PageUtils.pmShare(
context,
content: {
@@ -325,7 +326,7 @@ class BangumiIntroController extends GetxController {
"headline": title,
"source": 16,
"thumb": item.cover,
"source_desc": switch (bangumiItem.type) {
"source_desc": switch (pgcItem.type) {
1 => '番剧',
2 => '电影',
3 => '纪录片',
@@ -351,7 +352,7 @@ class BangumiIntroController extends GetxController {
// 选择文件夹
void onChoose(bool checkValue, int index) {
feedBack();
FavFolderItemData item = favFolderData.value.list![index];
FavVideoItemModel item = favFolderData.value.list![index];
item
..favState = checkValue ? 1 : 0
..mediaCount = checkValue ? item.mediaCount! + 1 : item.mediaCount! - 1;
@@ -388,7 +389,7 @@ class BangumiIntroController extends GetxController {
}
if (isLogin) {
queryBangumiLikeCoinFav();
queryPgcLikeCoinFav();
}
try {
@@ -401,8 +402,8 @@ class BangumiIntroController extends GetxController {
}
// 追番
Future<void> bangumiAdd() async {
var result = await VideoHttp.bangumiAdd(seasonId: bangumiItem.seasonId);
Future<void> pgcAdd() async {
var result = await VideoHttp.pgcAdd(seasonId: pgcItem.seasonId);
if (result['status']) {
isFollowed.value = true;
followStatus.value = 2;
@@ -411,17 +412,17 @@ class BangumiIntroController extends GetxController {
}
// 取消追番
Future<void> bangumiDel() async {
var result = await VideoHttp.bangumiDel(seasonId: bangumiItem.seasonId);
Future<void> pgcDel() async {
var result = await VideoHttp.pgcDel(seasonId: pgcItem.seasonId);
if (result['status']) {
isFollowed.value = false;
}
SmartDialog.showToast(result['msg']);
}
Future<void> bangumiUpdate(status) async {
var result = await VideoHttp.bangumiUpdate(
seasonId: [bangumiItem.seasonId],
Future<void> pgcUpdate(status) async {
var result = await VideoHttp.pgcUpdate(
seasonId: [pgcItem.seasonId],
status: status,
);
if (result['status']) {
@@ -432,10 +433,10 @@ class BangumiIntroController extends GetxController {
Future queryVideoInFolder() async {
favIds = null;
var result = await VideoHttp.videoInFolder(
var result = await FavHttp.videoInFolder(
mid: mid,
rid: epId, // bangumi
type: 24, // bangumi
rid: epId, // pgc
type: 24, // pgc
);
if (result['status']) {
favFolderData.value = result['data'];
@@ -448,7 +449,7 @@ class BangumiIntroController extends GetxController {
}
bool prevPlay() {
List episodes = bangumiItem.episodes!;
List episodes = pgcItem.episodes!;
VideoDetailController videoDetailCtr =
Get.find<VideoDetailController>(tag: Get.arguments['heroTag']);
int currentIndex =
@@ -474,7 +475,7 @@ class BangumiIntroController extends GetxController {
/// 列表循环或者顺序播放时,自动播放下一个;自动连播时,播放相关视频
bool nextPlay() {
try {
List episodes = bangumiItem.episodes!;
List episodes = pgcItem.episodes!;
VideoDetailController videoDetailCtr =
Get.find<VideoDetailController>(tag: Get.arguments['heroTag']);
PlayRepeat playRepeat = videoDetailCtr.plPlayerController.playRepeat;

View File

@@ -6,10 +6,10 @@ import 'package:PiliPlus/common/widgets/dialog/dialog.dart';
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
import 'package:PiliPlus/common/widgets/stat/stat.dart';
import 'package:PiliPlus/models/common/image_preview_type.dart';
import 'package:PiliPlus/models/pgc/pgc_info_model/result.dart';
import 'package:PiliPlus/models_new/pgc/pgc_info_model/result.dart';
import 'package:PiliPlus/pages/video/controller.dart';
import 'package:PiliPlus/pages/video/introduction/pgc/controller.dart';
import 'package:PiliPlus/pages/video/introduction/pgc/widgets/bangumi_panel.dart';
import 'package:PiliPlus/pages/video/introduction/pgc/widgets/pgc_panel.dart';
import 'package:PiliPlus/pages/video/introduction/ugc/widgets/action_item.dart';
import 'package:PiliPlus/pages/video/introduction/ugc/widgets/action_row_item.dart';
import 'package:PiliPlus/utils/extension.dart';
@@ -19,13 +19,13 @@ import 'package:flutter/services.dart' show HapticFeedback;
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:get/get.dart';
class BangumiIntroPanel extends StatefulWidget {
class PgcIntroPanel extends StatefulWidget {
final int? cid;
final String heroTag;
final Function showEpisodes;
final Function showIntroDetail;
const BangumiIntroPanel({
const PgcIntroPanel({
super.key,
this.cid,
required this.heroTag,
@@ -34,12 +34,12 @@ class BangumiIntroPanel extends StatefulWidget {
});
@override
State<BangumiIntroPanel> createState() => _BangumiIntroPanelState();
State<PgcIntroPanel> createState() => _PgcIntroPanelState();
}
class _BangumiIntroPanelState extends State<BangumiIntroPanel>
class _PgcIntroPanelState extends State<PgcIntroPanel>
with AutomaticKeepAliveClientMixin {
late BangumiIntroController bangumiIntroController;
late PgcIntroController pgcIntroController;
late VideoDetailController videoDetailCtr;
late final _coinKey = GlobalKey<ActionItemState>();
@@ -60,8 +60,7 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
@override
void initState() {
super.initState();
bangumiIntroController =
Get.put(BangumiIntroController(), tag: widget.heroTag);
pgcIntroController = Get.put(PgcIntroController(), tag: widget.heroTag);
videoDetailCtr = Get.find<VideoDetailController>(tag: widget.heroTag);
}
@@ -69,7 +68,7 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
Widget build(BuildContext context) {
super.build(context);
final ThemeData theme = Theme.of(context);
final bangumiItem = bangumiIntroController.bangumiItem;
final item = pgcIntroController.pgcItem;
final isLandscape =
MediaQuery.of(context).orientation == Orientation.landscape;
return SliverPadding(
@@ -96,25 +95,25 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
context.imageView(
imgList: [
SourceModel(
url: bangumiItem.cover!,
url: item.cover!,
)
],
onDismissed: videoDetailCtr.onDismissed,
);
},
child: Hero(
tag: bangumiItem.cover!,
tag: item.cover!,
child: NetworkImgLayer(
width: isLandscape ? 115 / 0.75 : 115,
height: isLandscape ? 115 : 115 / 0.75,
src: bangumiItem.cover!,
src: item.cover!,
semanticsLabel: '封面',
),
),
),
if (bangumiItem.rating != null)
if (item.rating != null)
PBadge(
text: '评分 ${bangumiItem.rating!.score!}',
text: '评分 ${item.rating!.score!}',
top: null,
right: 6,
bottom: 6,
@@ -125,7 +124,7 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
Expanded(
child: GestureDetector(
onTap: () => widget.showIntroDetail(
bangumiItem, bangumiIntroController.videoTags),
item, pgcIntroController.videoTags),
behavior: HitTestBehavior.opaque,
child: SizedBox(
height: isLandscape ? 115 : 115 / 0.75,
@@ -139,7 +138,7 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
children: [
Expanded(
child: Text(
bangumiItem.title!,
item.title!,
style: const TextStyle(
fontSize: 16,
),
@@ -158,46 +157,43 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
),
visualDensity: VisualDensity.compact,
foregroundColor:
bangumiIntroController.isFollowed.value
pgcIntroController.isFollowed.value
? theme.colorScheme.outline
: null,
backgroundColor:
bangumiIntroController.isFollowed.value
pgcIntroController.isFollowed.value
? theme.colorScheme.onInverseSurface
: null,
),
onPressed: bangumiIntroController
onPressed: pgcIntroController
.followStatus.value ==
-1
? null
: () {
if (bangumiIntroController
if (pgcIntroController
.isFollowed.value) {
showPgcFollowDialog(
context: context,
type: bangumiIntroController.type,
followStatus:
bangumiIntroController
.followStatus.value,
type: pgcIntroController.type,
followStatus: pgcIntroController
.followStatus.value,
onUpdateStatus: (followStatus) {
if (followStatus == -1) {
bangumiIntroController
.bangumiDel();
pgcIntroController.pgcDel();
} else {
bangumiIntroController
.bangumiUpdate(
followStatus);
pgcIntroController
.pgcUpdate(followStatus);
}
},
);
} else {
bangumiIntroController.bangumiAdd();
pgcIntroController.pgcAdd();
}
},
child: Text(
bangumiIntroController.isFollowed.value
? '${bangumiIntroController.type}'
: '${bangumiIntroController.type}',
pgcIntroController.isFollowed.value
? '${pgcIntroController.type}'
: '${pgcIntroController.type}',
),
),
),
@@ -209,28 +205,27 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
StatView(
context: context,
theme: 'gray',
value: Utils.numFormat(bangumiItem.stat!.views),
value: Utils.numFormat(item.stat!.views),
),
StatDanMu(
context: context,
theme: 'gray',
value:
Utils.numFormat(bangumiItem.stat!.danmakus),
value: Utils.numFormat(item.stat!.danmakus),
),
if (isLandscape) ...[
areasAndPubTime(theme, bangumiItem),
newEpDesc(theme, bangumiItem),
areasAndPubTime(theme, item),
newEpDesc(theme, item),
]
],
),
SizedBox(height: isLandscape ? 2 : 6),
if (!isLandscape) ...[
areasAndPubTime(theme, bangumiItem),
newEpDesc(theme, bangumiItem),
areasAndPubTime(theme, item),
newEpDesc(theme, item),
],
const Spacer(),
Text(
'简介:${bangumiItem.evaluate!}',
'简介:${item.evaluate!}',
maxLines: isLandscape ? 2 : 3,
overflow: TextOverflow.ellipsis,
style: TextStyle(
@@ -247,16 +242,16 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
),
const SizedBox(height: 6),
// 点赞收藏转发 布局样式2
actionGrid(theme, bangumiItem, bangumiIntroController),
actionGrid(theme, item, pgcIntroController),
// 番剧分p
if (bangumiItem.episodes!.isNotEmpty) ...[
BangumiPanel(
if (item.episodes!.isNotEmpty) ...[
PgcPanel(
heroTag: widget.heroTag,
pages: bangumiItem.episodes!,
pages: item.episodes!,
cid: videoDetailCtr.cid.value,
changeFuc: bangumiIntroController.changeSeasonOrbangu,
changeFuc: pgcIntroController.changeSeasonOrbangu,
showEpisodes: widget.showEpisodes,
newEp: bangumiItem.newEp,
newEp: item.newEp,
)
],
],
@@ -265,8 +260,8 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
);
}
Widget actionGrid(ThemeData theme, BangumiInfoModel bangumiItem,
BangumiIntroController bangumiIntroController) {
Widget actionGrid(ThemeData theme, PgcInfoModel item,
PgcIntroController pgcIntroController) {
return Material(
color: theme.colorScheme.surface,
child: Padding(
@@ -280,17 +275,16 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
() => ActionItem(
icon: const Icon(FontAwesomeIcons.thumbsUp),
selectIcon: const Icon(FontAwesomeIcons.solidThumbsUp),
onTap: () =>
handleState(bangumiIntroController.actionLikeVideo),
onLongPress: bangumiIntroController.actionOneThree,
selectStatus: bangumiIntroController.hasLike.value,
onTap: () => handleState(pgcIntroController.actionLikeVideo),
onLongPress: pgcIntroController.actionOneThree,
selectStatus: pgcIntroController.hasLike.value,
isLoading: false,
semanticsLabel: '点赞',
text: Utils.numFormat(bangumiItem.stat!.likes),
text: Utils.numFormat(item.stat!.likes),
needAnim: true,
hasTriple: bangumiIntroController.hasLike.value &&
bangumiIntroController.hasCoin &&
bangumiIntroController.hasFav.value,
hasTriple: pgcIntroController.hasLike.value &&
pgcIntroController.hasCoin &&
pgcIntroController.hasFav.value,
callBack: (start) {
if (start) {
HapticFeedback.lightImpact();
@@ -308,12 +302,11 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
key: _coinKey,
icon: const Icon(FontAwesomeIcons.b),
selectIcon: const Icon(FontAwesomeIcons.b),
onTap: () =>
handleState(bangumiIntroController.actionCoinVideo),
selectStatus: bangumiIntroController.hasCoin,
onTap: () => handleState(pgcIntroController.actionCoinVideo),
selectStatus: pgcIntroController.hasCoin,
isLoading: false,
semanticsLabel: '投币',
text: Utils.numFormat(bangumiItem.stat!.coins),
text: Utils.numFormat(item.stat!.coins),
needAnim: true,
),
),
@@ -322,14 +315,13 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
key: _favKey,
icon: const Icon(FontAwesomeIcons.star),
selectIcon: const Icon(FontAwesomeIcons.solidStar),
onTap: () =>
bangumiIntroController.showFavBottomSheet(context),
onLongPress: () => bangumiIntroController
onTap: () => pgcIntroController.showFavBottomSheet(context),
onLongPress: () => pgcIntroController
.showFavBottomSheet(context, type: 'longPress'),
selectStatus: bangumiIntroController.hasFav.value,
selectStatus: pgcIntroController.hasFav.value,
isLoading: false,
semanticsLabel: '收藏',
text: Utils.numFormat(bangumiItem.stat!.favorite),
text: Utils.numFormat(item.stat!.favorite),
needAnim: true,
),
),
@@ -340,15 +332,15 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
selectStatus: false,
isLoading: false,
semanticsLabel: '评论',
text: Utils.numFormat(bangumiItem.stat!.reply),
text: Utils.numFormat(item.stat!.reply),
),
ActionItem(
icon: const Icon(FontAwesomeIcons.shareFromSquare),
onTap: () => bangumiIntroController.actionShareVideo(context),
onTap: () => pgcIntroController.actionShareVideo(context),
selectStatus: false,
isLoading: false,
semanticsLabel: '转发',
text: Utils.numFormat(bangumiItem.stat!.share),
text: Utils.numFormat(item.stat!.share),
),
],
),
@@ -358,8 +350,8 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
}
Widget actionRow(
BangumiInfoModel bangumiItem,
BangumiIntroController bangumiIntroController,
PgcInfoModel item,
PgcIntroController pgcIntroController,
VideoDetailController videoDetailCtr,
) {
return Row(
@@ -368,30 +360,30 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
Obx(
() => ActionRowItem(
icon: const Icon(FontAwesomeIcons.thumbsUp),
onTap: () => handleState(bangumiIntroController.actionLikeVideo),
selectStatus: bangumiIntroController.hasLike.value,
onTap: () => handleState(pgcIntroController.actionLikeVideo),
selectStatus: pgcIntroController.hasLike.value,
isLoading: false,
text: bangumiItem.stat!.likes!.toString(),
text: item.stat!.likes!.toString(),
),
),
Obx(
() => ActionRowItem(
icon: const Icon(FontAwesomeIcons.b),
onTap: () => handleState(bangumiIntroController.actionCoinVideo),
selectStatus: bangumiIntroController.hasCoin,
onTap: () => handleState(pgcIntroController.actionCoinVideo),
selectStatus: pgcIntroController.hasCoin,
isLoading: false,
text: bangumiItem.stat!.coins!.toString(),
text: item.stat!.coins!.toString(),
),
),
Obx(
() => ActionRowItem(
icon: const Icon(FontAwesomeIcons.heart),
onTap: () => bangumiIntroController.showFavBottomSheet(context),
onLongPress: () => bangumiIntroController
.showFavBottomSheet(context, type: 'longPress'),
selectStatus: bangumiIntroController.hasFav.value,
onTap: () => pgcIntroController.showFavBottomSheet(context),
onLongPress: () => pgcIntroController.showFavBottomSheet(context,
type: 'longPress'),
selectStatus: pgcIntroController.hasFav.value,
isLoading: false,
text: bangumiItem.stat!.favorite!.toString(),
text: item.stat!.favorite!.toString(),
),
),
ActionRowItem(
@@ -399,11 +391,11 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
onTap: () => videoDetailCtr.tabCtr.animateTo(1),
selectStatus: false,
isLoading: false,
text: bangumiItem.stat!.reply!.toString(),
text: item.stat!.reply!.toString(),
),
ActionRowItem(
icon: const Icon(FontAwesomeIcons.share),
onTap: () => bangumiIntroController.actionShareVideo(context),
onTap: () => pgcIntroController.actionShareVideo(context),
selectStatus: false,
isLoading: false,
text: '转发',
@@ -412,20 +404,20 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
);
}
Widget areasAndPubTime(ThemeData theme, BangumiInfoModel bangumiItem) {
Widget areasAndPubTime(ThemeData theme, PgcInfoModel item) {
return Row(
spacing: 6,
children: [
if (bangumiItem.areas?.isNotEmpty == true)
if (item.areas?.isNotEmpty == true)
Text(
bangumiItem.areas!.first.name!,
item.areas!.first.name!,
style: TextStyle(
fontSize: 12,
color: theme.colorScheme.outline,
),
),
Text(
bangumiItem.publish!.pubTimeShow!,
item.publish!.pubTimeShow!,
style: TextStyle(
fontSize: 12,
color: theme.colorScheme.outline,
@@ -435,9 +427,9 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
);
}
Widget newEpDesc(ThemeData theme, BangumiInfoModel bangumiItem) {
Widget newEpDesc(ThemeData theme, PgcInfoModel item) {
return Text(
bangumiItem.newEp!.desc!,
item.newEp!.desc!,
style: TextStyle(
fontSize: 12,
color: theme.colorScheme.outline,

View File

@@ -3,8 +3,8 @@ import 'package:PiliPlus/common/widgets/keep_alive_wrapper.dart';
import 'package:PiliPlus/common/widgets/page/tabs.dart';
import 'package:PiliPlus/common/widgets/scroll_physics.dart';
import 'package:PiliPlus/common/widgets/stat/stat.dart';
import 'package:PiliPlus/models/pgc/pgc_info_model/result.dart';
import 'package:PiliPlus/models/video_tag/data.dart';
import 'package:PiliPlus/models_new/pgc/pgc_info_model/result.dart';
import 'package:PiliPlus/models_new/video/video_tag/data.dart';
import 'package:PiliPlus/pages/common/common_collapse_slide_page.dart';
import 'package:PiliPlus/pages/pgc_review/view.dart';
import 'package:PiliPlus/pages/search/widgets/search_text.dart';
@@ -14,12 +14,12 @@ import 'package:flutter/material.dart' hide TabBarView;
import 'package:get/get.dart';
class IntroDetail extends CommonCollapseSlidePage {
final BangumiInfoModel bangumiDetail;
final PgcInfoModel item;
final List<VideoTagItem>? videoTags;
const IntroDetail({
super.key,
required this.bangumiDetail,
required this.item,
super.enableSlide = false,
this.videoTags,
});
@@ -77,8 +77,8 @@ class _IntroDetailState extends CommonCollapseSlidePageState<IntroDetail> {
children: [
KeepAliveWrapper(builder: (context) => buildList(theme)),
PgcReviewPage(
name: widget.bangumiDetail.title!,
mediaId: widget.bangumiDetail.mediaId,
name: widget.item.title!,
mediaId: widget.item.mediaId,
),
],
);
@@ -101,7 +101,7 @@ class _IntroDetailState extends CommonCollapseSlidePageState<IntroDetail> {
),
children: [
SelectableText(
widget.bangumiDetail.title!,
widget.item.title!,
style: const TextStyle(fontSize: 16),
),
const SizedBox(height: 4),
@@ -110,13 +110,13 @@ class _IntroDetailState extends CommonCollapseSlidePageState<IntroDetail> {
StatView(
context: context,
theme: 'gray',
value: Utils.numFormat(widget.bangumiDetail.stat!.views),
value: Utils.numFormat(widget.item.stat!.views),
),
const SizedBox(width: 6),
StatDanMu(
context: context,
theme: 'gray',
value: Utils.numFormat(widget.bangumiDetail.stat!.danmakus),
value: Utils.numFormat(widget.item.stat!.danmakus),
),
],
),
@@ -124,17 +124,17 @@ class _IntroDetailState extends CommonCollapseSlidePageState<IntroDetail> {
Row(
children: [
Text(
widget.bangumiDetail.areas!.first.name!,
widget.item.areas!.first.name!,
style: smallTitle,
),
const SizedBox(width: 6),
Text(
widget.bangumiDetail.publish!.pubTimeShow!,
widget.item.publish!.pubTimeShow!,
style: smallTitle,
),
const SizedBox(width: 6),
Text(
widget.bangumiDetail.newEp!.desc!,
widget.item.newEp!.desc!,
style: smallTitle,
),
],
@@ -146,7 +146,7 @@ class _IntroDetailState extends CommonCollapseSlidePageState<IntroDetail> {
),
const SizedBox(height: 4),
SelectableText(
widget.bangumiDetail.evaluate!,
widget.item.evaluate!,
style: smallTitle.copyWith(fontSize: 14),
),
const SizedBox(height: 20),
@@ -156,7 +156,7 @@ class _IntroDetailState extends CommonCollapseSlidePageState<IntroDetail> {
),
const SizedBox(height: 4),
SelectableText(
widget.bangumiDetail.actors!,
widget.item.actors!,
style: smallTitle.copyWith(fontSize: 14),
),
if (widget.videoTags?.isNotEmpty == true) ...[

View File

@@ -1,7 +1,7 @@
import 'dart:async';
import 'package:PiliPlus/models/pgc/pgc_info_model/episode.dart';
import 'package:PiliPlus/models/pgc/pgc_info_model/new_ep.dart';
import 'package:PiliPlus/models_new/pgc/pgc_info_model/episode.dart';
import 'package:PiliPlus/models_new/pgc/pgc_info_model/new_ep.dart';
import 'package:PiliPlus/pages/video/controller.dart';
import 'package:PiliPlus/utils/storage.dart';
import 'package:PiliPlus/utils/utils.dart';
@@ -9,8 +9,8 @@ import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart';
class BangumiPanel extends StatefulWidget {
const BangumiPanel({
class PgcPanel extends StatefulWidget {
const PgcPanel({
super.key,
required this.pages,
this.cid,
@@ -28,10 +28,10 @@ class BangumiPanel extends StatefulWidget {
final NewEp? newEp;
@override
State<BangumiPanel> createState() => _BangumiPanelState();
State<PgcPanel> createState() => _PgcPanelState();
}
class _BangumiPanelState extends State<BangumiPanel> {
class _PgcPanelState extends State<PgcPanel> {
late int currentIndex;
final ScrollController listViewScrollCtr = ScrollController();
dynamic userInfo;