Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-07-22 21:13:16 +08:00
parent 55bed2e830
commit e770e39c8f
59 changed files with 1388 additions and 1265 deletions

View File

@@ -10,6 +10,7 @@ import 'package:PiliPlus/http/search.dart';
import 'package:PiliPlus/http/user.dart';
import 'package:PiliPlus/http/video.dart';
import 'package:PiliPlus/member_card_info/data.dart';
import 'package:PiliPlus/models_new/fav/fav_folder/data.dart';
import 'package:PiliPlus/models_new/triple/ugc_triple.dart';
import 'package:PiliPlus/models_new/video/video_ai_conclusion/data.dart';
import 'package:PiliPlus/models_new/video/video_ai_conclusion/model_result.dart';
@@ -145,10 +146,9 @@ class VideoIntroController extends CommonIntroController {
} catch (_) {}
}
} catch (_) {}
if (videoDetail.value.pages != null &&
videoDetail.value.pages!.isNotEmpty &&
lastPlayCid.value == 0) {
lastPlayCid.value = videoDetail.value.pages!.first.cid!;
final pages = videoDetail.value.pages;
if (pages != null && pages.isNotEmpty && lastPlayCid.value == 0) {
lastPlayCid.value = pages.first.cid!;
}
queryUserStat(data.staff);
} else {
@@ -338,8 +338,9 @@ class VideoIntroController extends CommonIntroController {
SmartDialog.showLoading(msg: '请求中');
queryVideoInFolder().then((res) async {
if (res['status']) {
int defaultFolderId = favFolderData.value.list!.first.id;
bool notInDefFolder = favFolderData.value.list!.first.favState! == 0;
final first = favFolderData.value.list!.first;
int defaultFolderId = first.id;
bool notInDefFolder = first.favState! == 0;
var result = await FavHttp.favVideo(
aid: IdUtils.bv2av(bvid),
addIds: notInDefFolder ? '$defaultFolderId' : '',
@@ -505,8 +506,9 @@ class VideoIntroController extends CommonIntroController {
rid: IdUtils.bv2av(bvid),
);
if (result['status']) {
favFolderData.value = result['data'];
favIds = favFolderData.value.list
FavFolderData data = result['data'];
favFolderData.value = data;
favIds = data.list
?.where((item) => item.favState == 1)
.map((item) => item.id)
.toSet();
@@ -516,11 +518,11 @@ class VideoIntroController extends CommonIntroController {
// 查询关注状态
Future<void> queryFollowStatus() async {
if (videoDetail.value.owner == null ||
videoDetail.value.staff?.isNotEmpty == true) {
final videoDetail = this.videoDetail.value;
if (videoDetail.owner == null || videoDetail.staff?.isNotEmpty == true) {
return;
}
var result = await UserHttp.hasFollow(videoDetail.value.owner!.mid!);
var result = await UserHttp.hasFollow(videoDetail.owner!.mid!);
if (result['status']) {
Map data = result['data'];
if (data['special'] == 1) data['attribute'] = -10;

View File

@@ -259,12 +259,11 @@ class _VideoIntroPanelState extends State<VideoIntroPanel>
),
],
Obx(() {
if (introController
.videoTags.value.isNullOrEmpty) {
final videoTags = introController.videoTags.value;
if (videoTags.isNullOrEmpty) {
return const SizedBox.shrink();
}
return _buildTags(
introController.videoTags.value!);
return _buildTags(videoTags!);
})
],
),
@@ -366,86 +365,90 @@ class _VideoIntroPanelState extends State<VideoIntroPanel>
Widget _buildVideoTitle(ThemeData theme, VideoDetailData videoDetail,
{bool isExpand = false}) {
late final isDark = theme.brightness == Brightness.dark;
Widget child() => Text.rich(
TextSpan(
children: [
if (videoDetailCtr.videoLabel.value.isNotEmpty) ...[
WidgetSpan(
alignment: PlaceholderAlignment.middle,
child: Container(
padding: const EdgeInsets.symmetric(
horizontal: 4,
vertical: 2,
),
decoration: BoxDecoration(
color: theme.colorScheme.secondaryContainer,
borderRadius: const BorderRadius.all(Radius.circular(4)),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Stack(
clipBehavior: Clip.none,
alignment: Alignment.center,
children: [
Icon(
Icons.shield_outlined,
size: 16,
color: theme.colorScheme.onSecondaryContainer,
),
Icon(
Icons.play_arrow_rounded,
size: 12,
color: theme.colorScheme.onSecondaryContainer,
),
],
),
Text(
videoDetailCtr.videoLabel.value,
textScaler: TextScaler.noScaling,
strutStyle: const StrutStyle(
leading: 0,
height: 1,
fontSize: 13,
),
style: TextStyle(
height: 1,
fontSize: 13,
Widget child() {
final videoLabel = videoDetailCtr.videoLabel.value;
return Text.rich(
TextSpan(
children: [
if (videoLabel.isNotEmpty) ...[
WidgetSpan(
alignment: PlaceholderAlignment.middle,
child: Container(
padding: const EdgeInsets.symmetric(
horizontal: 4,
vertical: 2,
),
decoration: BoxDecoration(
color: theme.colorScheme.secondaryContainer,
borderRadius: const BorderRadius.all(Radius.circular(4)),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Stack(
clipBehavior: Clip.none,
alignment: Alignment.center,
children: [
Icon(
Icons.shield_outlined,
size: 16,
color: theme.colorScheme.onSecondaryContainer,
),
Icon(
Icons.play_arrow_rounded,
size: 12,
color: theme.colorScheme.onSecondaryContainer,
),
],
),
Text(
videoLabel,
textScaler: TextScaler.noScaling,
strutStyle: const StrutStyle(
leading: 0,
height: 1,
fontSize: 13,
),
],
),
style: TextStyle(
height: 1,
fontSize: 13,
color: theme.colorScheme.onSecondaryContainer,
),
),
],
),
),
const TextSpan(text: ' '),
],
if (videoDetail.isUpowerExclusive == true) ...[
_labelWidget(
'充电专属',
isDark
? theme.colorScheme.error
: theme.colorScheme.errorContainer,
isDark
? theme.colorScheme.onError
: theme.colorScheme.onErrorContainer,
),
const TextSpan(text: ' '),
] else if (videoDetail.rights?.isSteinGate == 1) ...[
_labelWidget(
'互动视频',
theme.colorScheme.secondaryContainer,
theme.colorScheme.onSecondaryContainer,
),
const TextSpan(text: ' '),
],
TextSpan(text: videoDetail.title ?? ''),
),
const TextSpan(text: ' '),
],
),
maxLines: isExpand ? null : 2,
overflow: isExpand ? null : TextOverflow.ellipsis,
style: const TextStyle(fontSize: 16),
);
if (videoDetail.isUpowerExclusive == true) ...[
_labelWidget(
'充电专属',
isDark
? theme.colorScheme.error
: theme.colorScheme.errorContainer,
isDark
? theme.colorScheme.onError
: theme.colorScheme.onErrorContainer,
),
const TextSpan(text: ' '),
] else if (videoDetail.rights?.isSteinGate == 1) ...[
_labelWidget(
'互动视频',
theme.colorScheme.secondaryContainer,
theme.colorScheme.onSecondaryContainer,
),
const TextSpan(text: ' '),
],
TextSpan(text: videoDetail.title ?? ''),
],
),
maxLines: isExpand ? null : 2,
overflow: isExpand ? null : TextOverflow.ellipsis,
style: const TextStyle(fontSize: 16),
);
}
if (videoDetailCtr.plPlayerController.enableSponsorBlock) {
return Obx(child);
}