mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-22 01:56:47 +08:00
show dyn pugv
Closes #1064 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -953,7 +953,7 @@ class DynamicMajorModel {
|
||||
// MAJOR_TYPE_ARCHIVE 视频
|
||||
// MAJOR_TYPE_OPUS 图文/文章
|
||||
String? type;
|
||||
Map? courses;
|
||||
DynamicArchiveModel? courses;
|
||||
Common? common;
|
||||
Map? music;
|
||||
ModuleBlocked? blocked;
|
||||
@@ -987,7 +987,9 @@ class DynamicMajorModel {
|
||||
? DynamicNoneModel.fromJson(json['none'])
|
||||
: null;
|
||||
type = json['type'];
|
||||
courses = json['courses'];
|
||||
courses = json['courses'] == null
|
||||
? null
|
||||
: DynamicArchiveModel.fromJson(json['courses']);
|
||||
common = json['common'] == null ? null : Common.fromJson(json['common']);
|
||||
music = json['music'];
|
||||
blocked = json['blocked'] == null
|
||||
|
||||
@@ -56,6 +56,7 @@ class DynamicPanel extends StatelessWidget {
|
||||
'DYNAMIC_TYPE_LIVE',
|
||||
'DYNAMIC_TYPE_LIVE_RCMD',
|
||||
'DYNAMIC_TYPE_MEDIALIST',
|
||||
'DYNAMIC_TYPE_COURSES_SEASON',
|
||||
}.contains(item.type)
|
||||
? null
|
||||
: () => PageUtils.pushDynDetail(item, 1),
|
||||
@@ -152,6 +153,10 @@ class DynamicPanel extends StatelessWidget {
|
||||
title = major?.live?.title;
|
||||
cover = major?.live?.cover;
|
||||
break;
|
||||
case 'DYNAMIC_TYPE_COURSES_SEASON':
|
||||
title = major?.courses?.title;
|
||||
cover = major?.courses?.cover;
|
||||
break;
|
||||
default:
|
||||
morePanel(context);
|
||||
return;
|
||||
|
||||
@@ -38,13 +38,16 @@ Widget module(
|
||||
return const SizedBox.shrink();
|
||||
// 视频
|
||||
case 'DYNAMIC_TYPE_AV':
|
||||
case 'DYNAMIC_TYPE_UGC_SEASON':
|
||||
case 'DYNAMIC_TYPE_PGC':
|
||||
case 'DYNAMIC_TYPE_PGC_UNION':
|
||||
case 'DYNAMIC_TYPE_COURSES_SEASON':
|
||||
return videoSeasonWidget(
|
||||
theme,
|
||||
isSave,
|
||||
isDetail,
|
||||
item,
|
||||
context,
|
||||
'archive',
|
||||
callback,
|
||||
floor: floor,
|
||||
maxWidth: maxWidth,
|
||||
@@ -200,42 +203,6 @@ Widget module(
|
||||
// 直播
|
||||
case 'DYNAMIC_TYPE_LIVE':
|
||||
return livePanel(theme, isDetail, item, context, floor: floor);
|
||||
// 合集
|
||||
case 'DYNAMIC_TYPE_UGC_SEASON':
|
||||
return videoSeasonWidget(
|
||||
theme,
|
||||
isSave,
|
||||
isDetail,
|
||||
item,
|
||||
context,
|
||||
'ugcSeason',
|
||||
callback,
|
||||
maxWidth: maxWidth,
|
||||
);
|
||||
case 'DYNAMIC_TYPE_PGC':
|
||||
return videoSeasonWidget(
|
||||
theme,
|
||||
isSave,
|
||||
isDetail,
|
||||
item,
|
||||
context,
|
||||
'pgc',
|
||||
callback,
|
||||
floor: floor,
|
||||
maxWidth: maxWidth,
|
||||
);
|
||||
case 'DYNAMIC_TYPE_PGC_UNION':
|
||||
return videoSeasonWidget(
|
||||
theme,
|
||||
isSave,
|
||||
isDetail,
|
||||
item,
|
||||
context,
|
||||
'pgc',
|
||||
callback,
|
||||
floor: floor,
|
||||
maxWidth: maxWidth,
|
||||
);
|
||||
case 'DYNAMIC_TYPE_NONE':
|
||||
return Row(
|
||||
spacing: 4,
|
||||
@@ -244,19 +211,6 @@ Widget module(
|
||||
Text(item.modules.moduleDynamic!.major!.none!.tips!),
|
||||
],
|
||||
);
|
||||
// 课堂
|
||||
case 'DYNAMIC_TYPE_COURSES_SEASON':
|
||||
return SizedBox(
|
||||
width: double.infinity,
|
||||
child: Padding(
|
||||
padding: floor == 1
|
||||
? const EdgeInsets.symmetric(horizontal: 12)
|
||||
: EdgeInsets.zero,
|
||||
child: Text(
|
||||
"课堂:${item.modules.moduleDynamic!.major!.courses!['title']}",
|
||||
),
|
||||
),
|
||||
);
|
||||
// 活动
|
||||
case 'DYNAMIC_TYPE_COMMON_SQUARE':
|
||||
return Material(
|
||||
|
||||
@@ -13,7 +13,6 @@ Widget videoSeasonWidget(
|
||||
bool isDetail,
|
||||
DynamicItemModel item,
|
||||
BuildContext context,
|
||||
String type,
|
||||
Function(List<String>, int)? callback, {
|
||||
floor = 1,
|
||||
required double maxWidth,
|
||||
@@ -45,10 +44,12 @@ Widget videoSeasonWidget(
|
||||
// 1 投稿视频 铺满 borderRadius 0
|
||||
// 2 转发视频 铺满 borderRadius 6
|
||||
|
||||
DynamicArchiveModel? itemContent = switch (type) {
|
||||
'ugcSeason' => item.modules.moduleDynamic?.major?.ugcSeason,
|
||||
'archive' => item.modules.moduleDynamic?.major?.archive,
|
||||
'pgc' => item.modules.moduleDynamic?.major?.pgc,
|
||||
DynamicArchiveModel? itemContent = switch (item.type) {
|
||||
'DYNAMIC_TYPE_AV' => item.modules.moduleDynamic?.major?.archive,
|
||||
'DYNAMIC_TYPE_UGC_SEASON' => item.modules.moduleDynamic?.major?.ugcSeason,
|
||||
'DYNAMIC_TYPE_PGC' ||
|
||||
'DYNAMIC_TYPE_PGC_UNION' => item.modules.moduleDynamic?.major?.pgc,
|
||||
'DYNAMIC_TYPE_COURSES_SEASON' => item.modules.moduleDynamic?.major?.courses,
|
||||
_ => null,
|
||||
};
|
||||
|
||||
@@ -121,9 +122,11 @@ Widget videoSeasonWidget(
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
],
|
||||
Text('${NumUtil.numFormat(itemContent.stat?.play)}次围观'),
|
||||
if (itemContent.stat != null) ...[
|
||||
Text('${NumUtil.numFormat(itemContent.stat!.play)}次围观'),
|
||||
const SizedBox(width: 6),
|
||||
Text('${NumUtil.numFormat(itemContent.stat?.danmu)}条弹幕'),
|
||||
Text('${NumUtil.numFormat(itemContent.stat!.danmu)}条弹幕'),
|
||||
],
|
||||
const Spacer(),
|
||||
Image.asset(
|
||||
'assets/images/play.png',
|
||||
|
||||
@@ -73,11 +73,11 @@ class MemberAudioItem extends StatelessWidget {
|
||||
children: [
|
||||
StatWidget(
|
||||
type: StatType.listen,
|
||||
value: item.statistic?.play,
|
||||
value: item.statistic!.play,
|
||||
),
|
||||
StatWidget(
|
||||
type: StatType.reply,
|
||||
value: item.statistic?.comment,
|
||||
value: item.statistic!.comment,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -518,7 +518,10 @@ class PageUtils {
|
||||
}
|
||||
break;
|
||||
|
||||
// case 'DYNAMIC_TYPE_COURSES_SEASON':
|
||||
case 'DYNAMIC_TYPE_COURSES_SEASON':
|
||||
PageUtils.viewPugv(seasonId: item.basic?.ridStr);
|
||||
break;
|
||||
|
||||
// 纯文字动态查看
|
||||
// case 'DYNAMIC_TYPE_WORD':
|
||||
// # 装扮/剧集点评/普通分享
|
||||
|
||||
Reference in New Issue
Block a user