Merge branch 'fix-favBangumiPushError'

This commit is contained in:
guozhigq
2024-02-10 19:24:54 +08:00

View File

@ -9,6 +9,7 @@ import 'package:pilipala/models/common/search_type.dart';
import 'package:pilipala/utils/id_utils.dart'; import 'package:pilipala/utils/id_utils.dart';
import 'package:pilipala/utils/utils.dart'; import 'package:pilipala/utils/utils.dart';
import 'package:pilipala/common/widgets/network_img_layer.dart'; import 'package:pilipala/common/widgets/network_img_layer.dart';
import '../../../common/widgets/badge.dart';
// 收藏视频卡片 - 水平布局 // 收藏视频卡片 - 水平布局
class FavVideoCardH extends StatelessWidget { class FavVideoCardH extends StatelessWidget {
@ -27,7 +28,9 @@ class FavVideoCardH extends StatelessWidget {
onTap: () async { onTap: () async {
// int? seasonId; // int? seasonId;
String? epId; String? epId;
if (videoItem.ogv != null && videoItem.ogv['type_name'] == '番剧') { if (videoItem.ogv != null &&
(videoItem.ogv['type_name'] == '番剧' ||
videoItem.ogv['type_name'] == '国创')) {
videoItem.cid = await SearchHttp.ab2c(bvid: bvid); videoItem.cid = await SearchHttp.ab2c(bvid: bvid);
// seasonId = videoItem.ogv['season_id']; // seasonId = videoItem.ogv['season_id'];
epId = videoItem.epId; epId = videoItem.epId;
@ -84,22 +87,21 @@ class FavVideoCardH extends StatelessWidget {
height: maxHeight, height: maxHeight,
), ),
), ),
Positioned( PBadge(
right: 4, text: Utils.timeFormat(videoItem.duration!),
bottom: 4, right: 6.0,
child: Container( bottom: 6.0,
padding: const EdgeInsets.symmetric( type: 'gray',
vertical: 1, horizontal: 6),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4),
color: Colors.black54.withOpacity(0.4)),
child: Text(
Utils.timeFormat(videoItem.duration!),
style: const TextStyle(
fontSize: 11, color: Colors.white),
), ),
if (videoItem.ogv != null) ...[
PBadge(
text: videoItem.ogv['type_name'],
top: 6.0,
right: 6.0,
bottom: null,
left: null,
), ),
) ],
], ],
); );
}, },
@ -141,12 +143,22 @@ class VideoContent extends StatelessWidget {
maxLines: 2, maxLines: 2,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
if (videoItem.ogv != null) ...[
Text(
videoItem.intro,
style: TextStyle(
fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
color: Theme.of(context).colorScheme.outline,
),
),
],
const Spacer(), const Spacer(),
Text( Text(
Utils.dateFormat(videoItem.ctime!), Utils.dateFormat(videoItem.favTime),
style: TextStyle( style: TextStyle(
fontSize: 11, color: Theme.of(context).colorScheme.outline), fontSize: 11, color: Theme.of(context).colorScheme.outline),
), ),
if (videoItem.owner.name != '') ...[
Text( Text(
videoItem.owner.name, videoItem.owner.name,
style: TextStyle( style: TextStyle(
@ -154,6 +166,7 @@ class VideoContent extends StatelessWidget {
color: Theme.of(context).colorScheme.outline, color: Theme.of(context).colorScheme.outline,
), ),
), ),
],
Row( Row(
children: [ children: [
StatView( StatView(