mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
mod: fetch only-fans dyn
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -14,7 +14,7 @@ class DynamicsHttp {
|
||||
'type': type ?? 'all',
|
||||
'timezone_offset': '-480',
|
||||
'offset': offset,
|
||||
'features': 'itemOpusStyle'
|
||||
'features': 'itemOpusStyle,listOnlyfans'
|
||||
};
|
||||
if (mid != -1) {
|
||||
data['host_mid'] = mid;
|
||||
|
||||
@@ -404,7 +404,7 @@ class MemberHttp {
|
||||
'offset': offset ?? '',
|
||||
'host_mid': mid,
|
||||
'timezone_offset': '-480',
|
||||
'features': 'itemOpusStyle',
|
||||
'features': 'itemOpusStyle,listOnlyfans',
|
||||
'platform': 'web',
|
||||
'web_location': '333.999',
|
||||
'dm_img_list': '[]',
|
||||
|
||||
@@ -421,6 +421,7 @@ class DynamicMajorModel {
|
||||
this.courses,
|
||||
this.common,
|
||||
this.music,
|
||||
this.blocked,
|
||||
});
|
||||
|
||||
DynamicArchiveModel? archive;
|
||||
@@ -438,6 +439,7 @@ class DynamicMajorModel {
|
||||
Map? courses;
|
||||
Map? common;
|
||||
Map? music;
|
||||
Map? blocked;
|
||||
|
||||
DynamicMajorModel.fromJson(Map<String, dynamic> json) {
|
||||
archive = json['archive'] != null
|
||||
@@ -463,6 +465,7 @@ class DynamicMajorModel {
|
||||
courses = json['courses'] ?? {};
|
||||
common = json['common'] ?? {};
|
||||
music = json['music'] ?? {};
|
||||
blocked = json['blocked'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,21 +37,14 @@ InlineSpan picsNodes(List<OpusPicsModel> pics, callback) {
|
||||
}
|
||||
|
||||
Widget forWard(item, context, source, callback, {floor = 1}) {
|
||||
TextStyle authorStyle =
|
||||
TextStyle(color: Theme.of(context).colorScheme.primary);
|
||||
|
||||
List<OpusPicsModel> pics = [];
|
||||
|
||||
bool hasPics = item.modules.moduleDynamic.major != null &&
|
||||
item.modules.moduleDynamic.major.opus != null &&
|
||||
item.modules.moduleDynamic.major.opus.pics.isNotEmpty;
|
||||
if (hasPics) {
|
||||
pics = item.modules.moduleDynamic.major.opus.pics;
|
||||
}
|
||||
InlineSpan? richNodes = richNode(item, context);
|
||||
switch (item.type) {
|
||||
// 图文
|
||||
case 'DYNAMIC_TYPE_DRAW':
|
||||
bool hasPics = item.modules.moduleDynamic.major != null &&
|
||||
item.modules.moduleDynamic.major.opus != null &&
|
||||
item.modules.moduleDynamic.major.opus.pics.isNotEmpty;
|
||||
|
||||
InlineSpan? richNodes = richNode(item, context);
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
@@ -64,7 +57,8 @@ Widget forWard(item, context, source, callback, {floor = 1}) {
|
||||
arguments: {'face': item.modules.moduleAuthor.face}),
|
||||
child: Text(
|
||||
'@${item.modules.moduleAuthor.name}',
|
||||
style: authorStyle,
|
||||
style:
|
||||
TextStyle(color: Theme.of(context).colorScheme.primary),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
@@ -93,6 +87,7 @@ Widget forWard(item, context, source, callback, {floor = 1}) {
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
|
||||
if (richNodes != null)
|
||||
Text.rich(
|
||||
richNodes,
|
||||
@@ -104,7 +99,7 @@ Widget forWard(item, context, source, callback, {floor = 1}) {
|
||||
),
|
||||
if (hasPics) ...[
|
||||
Text.rich(
|
||||
picsNodes(pics, callback),
|
||||
picsNodes(item.modules.moduleDynamic.major.opus.pics, callback),
|
||||
// semanticsLabel: '动态图片',
|
||||
),
|
||||
if (item.modules.moduleDynamic.additional != null)
|
||||
@@ -126,7 +121,38 @@ Widget forWard(item, context, source, callback, {floor = 1}) {
|
||||
context,
|
||||
item.modules.moduleDynamic.additional.type,
|
||||
floor: floor,
|
||||
)
|
||||
),
|
||||
|
||||
if (item.modules.moduleDynamic.major.blocked != null) ...[
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.only(
|
||||
left: 12, right: 12, bottom: source == 'detail' ? 8 : 0),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (item.modules.moduleDynamic.major.blocked['title'] != null)
|
||||
Text(
|
||||
item.modules.moduleDynamic.major.blocked['title'],
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
),
|
||||
),
|
||||
if (item.modules.moduleDynamic.major
|
||||
.blocked['hint_message'] !=
|
||||
null)
|
||||
Text(
|
||||
item.modules.moduleDynamic.major.blocked['hint_message'],
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Theme.of(context).colorScheme.outline,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
);
|
||||
// 视频
|
||||
@@ -198,6 +224,7 @@ Widget forWard(item, context, source, callback, {floor = 1}) {
|
||||
case 'DYNAMIC_TYPE_UGC_SEASON':
|
||||
return videoSeasonWidget(item, context, 'ugcSeason');
|
||||
case 'DYNAMIC_TYPE_WORD':
|
||||
InlineSpan? richNodes = richNode(item, context);
|
||||
return floor == 2
|
||||
? Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@@ -210,7 +237,8 @@ Widget forWard(item, context, source, callback, {floor = 1}) {
|
||||
arguments: {'face': item.modules.moduleAuthor.face}),
|
||||
child: Text(
|
||||
'@${item.modules.moduleAuthor.name}',
|
||||
style: authorStyle,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.primary),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
|
||||
@@ -2,8 +2,8 @@ import 'package:PiliPlus/common/widgets/imageview.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
Widget picWidget(item, context, callback) {
|
||||
String type = item.modules.moduleDynamic.major.type;
|
||||
if (type == 'MAJOR_TYPE_OPUS') {
|
||||
if (item.modules.moduleDynamic.major?.draw?.items == null ||
|
||||
item.modules.moduleDynamic.major.type == 'MAJOR_TYPE_OPUS') {
|
||||
/// fix 图片跟rich_node_panel重复
|
||||
// pictures = item.modules.moduleDynamic.major.opus.pics;
|
||||
return const SizedBox();
|
||||
|
||||
Reference in New Issue
Block a user