mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
feat: save dyn
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -5,6 +5,7 @@ import 'package:PiliPlus/common/widgets/icon_button.dart';
|
|||||||
import 'package:PiliPlus/common/widgets/network_img_layer.dart';
|
import 'package:PiliPlus/common/widgets/network_img_layer.dart';
|
||||||
import 'package:PiliPlus/grpc/app/main/community/reply/v1/reply.pb.dart';
|
import 'package:PiliPlus/grpc/app/main/community/reply/v1/reply.pb.dart';
|
||||||
import 'package:PiliPlus/models/dynamics/result.dart';
|
import 'package:PiliPlus/models/dynamics/result.dart';
|
||||||
|
import 'package:PiliPlus/pages/dynamics/widgets/dynamic_panel.dart';
|
||||||
import 'package:PiliPlus/pages/video/detail/introduction/controller.dart';
|
import 'package:PiliPlus/pages/video/detail/introduction/controller.dart';
|
||||||
import 'package:PiliPlus/pages/video/detail/reply/widgets/reply_item_grpc.dart';
|
import 'package:PiliPlus/pages/video/detail/reply/widgets/reply_item_grpc.dart';
|
||||||
import 'package:PiliPlus/utils/download.dart';
|
import 'package:PiliPlus/utils/download.dart';
|
||||||
@@ -17,99 +18,188 @@ import 'package:pretty_qr_code/pretty_qr_code.dart';
|
|||||||
import 'package:saver_gallery/saver_gallery.dart';
|
import 'package:saver_gallery/saver_gallery.dart';
|
||||||
import 'package:share_plus/share_plus.dart';
|
import 'package:share_plus/share_plus.dart';
|
||||||
|
|
||||||
class ReplySavePanel extends StatefulWidget {
|
class SavePanel extends StatefulWidget {
|
||||||
const ReplySavePanel({
|
const SavePanel({
|
||||||
required this.upMid,
|
required this.item,
|
||||||
required this.replyItem,
|
// reply
|
||||||
|
this.upMid,
|
||||||
super.key,
|
super.key,
|
||||||
});
|
});
|
||||||
|
|
||||||
final dynamic upMid;
|
final dynamic upMid;
|
||||||
final ReplyInfo replyItem;
|
final dynamic item;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<ReplySavePanel> createState() => _ReplySavePanelState();
|
State<SavePanel> createState() => _SavePanelState();
|
||||||
|
|
||||||
|
static void toSavePanel({upMid, item}) {
|
||||||
|
Get.generalDialog(
|
||||||
|
barrierLabel: '',
|
||||||
|
barrierDismissible: true,
|
||||||
|
pageBuilder: (context, animation, secondaryAnimation) {
|
||||||
|
return SavePanel(upMid: upMid, item: item);
|
||||||
|
},
|
||||||
|
transitionDuration: const Duration(milliseconds: 255),
|
||||||
|
transitionBuilder: (context, animation, secondaryAnimation, child) {
|
||||||
|
var tween = Tween<double>(begin: 0, end: 1)
|
||||||
|
.chain(CurveTween(curve: Curves.easeInOut));
|
||||||
|
return FadeTransition(
|
||||||
|
opacity: animation.drive(tween),
|
||||||
|
child: child,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
routeSettings: RouteSettings(arguments: Get.arguments),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class _ReplySavePanelState extends State<ReplySavePanel> {
|
class _SavePanelState extends State<SavePanel> {
|
||||||
final boundaryKey = GlobalKey();
|
final boundaryKey = GlobalKey();
|
||||||
|
|
||||||
|
// item
|
||||||
|
dynamic get _item => widget.item;
|
||||||
|
late String viewType = '查看';
|
||||||
|
late String itemType = '内容';
|
||||||
|
|
||||||
|
//reply
|
||||||
String? cover;
|
String? cover;
|
||||||
String? title;
|
String? title;
|
||||||
int? pubdate;
|
int? pubdate;
|
||||||
String? uname;
|
String? uname;
|
||||||
|
|
||||||
String uri = '';
|
String uri = '';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
final currentRoute = Get.currentRoute;
|
if (_item is ReplyInfo) {
|
||||||
late final hasRoot = widget.replyItem.hasRoot();
|
itemType = '评论';
|
||||||
|
final currentRoute = Get.currentRoute;
|
||||||
|
late final hasRoot = _item.hasRoot();
|
||||||
|
|
||||||
if (currentRoute.startsWith('/video')) {
|
if (currentRoute.startsWith('/video')) {
|
||||||
try {
|
try {
|
||||||
final heroTag = Get.arguments?['heroTag'];
|
final heroTag = Get.arguments?['heroTag'];
|
||||||
late final ctr = Get.find<VideoIntroController>(tag: heroTag);
|
late final ctr = Get.find<VideoIntroController>(tag: heroTag);
|
||||||
cover = ctr.videoDetail.value.pic;
|
cover = ctr.videoDetail.value.pic;
|
||||||
title = ctr.videoDetail.value.title;
|
title = ctr.videoDetail.value.title;
|
||||||
pubdate = ctr.videoDetail.value.pubdate;
|
pubdate = ctr.videoDetail.value.pubdate;
|
||||||
uname = ctr.videoDetail.value.owner?.name;
|
uname = ctr.videoDetail.value.owner?.name;
|
||||||
} catch (_) {}
|
} catch (_) {}
|
||||||
uri =
|
|
||||||
'bilibili://video/${widget.replyItem.oid}?comment_root_id=${hasRoot ? widget.replyItem.root : widget.replyItem.id}${hasRoot ? '&comment_secondary_id=${widget.replyItem.id}' : ''}';
|
|
||||||
} else if (currentRoute.startsWith('/dynamicDetail')) {
|
|
||||||
try {
|
|
||||||
DynamicItemModel item = Get.arguments['item'];
|
|
||||||
uname = item.modules?.moduleAuthor?.name;
|
|
||||||
final type = widget.replyItem.type.toInt();
|
|
||||||
late final oid = item.idStr;
|
|
||||||
late final rootId =
|
|
||||||
hasRoot ? widget.replyItem.root : widget.replyItem.id;
|
|
||||||
late final anchor = hasRoot ? 'anchor=${widget.replyItem.id}&' : '';
|
|
||||||
late final enterUri = 'bilibili://following/detail/$oid';
|
|
||||||
uri = switch (type) {
|
|
||||||
1 =>
|
|
||||||
'bilibili://video/${item.basic!['rid_str']}?comment_root_id=${hasRoot ? widget.replyItem.root : widget.replyItem.id}${hasRoot ? '&comment_secondary_id=${widget.replyItem.id}' : ''}',
|
|
||||||
11 ||
|
|
||||||
12 =>
|
|
||||||
'bilibili://comment/detail/$type/${item.basic!['rid_str']}/$rootId/?${anchor}enterUri=$enterUri',
|
|
||||||
_ =>
|
|
||||||
'bilibili://comment/detail/$type/$oid/$rootId/?${anchor}enterUri=$enterUri',
|
|
||||||
};
|
|
||||||
} catch (_) {}
|
|
||||||
} else if (currentRoute.startsWith('/Scaffold')) {
|
|
||||||
try {
|
|
||||||
final type = widget.replyItem.type.toInt();
|
|
||||||
late final oid = Get.arguments['oid'];
|
|
||||||
late final rootId =
|
|
||||||
hasRoot ? widget.replyItem.root : widget.replyItem.id;
|
|
||||||
late final anchor = hasRoot ? 'anchor=${widget.replyItem.id}&' : '';
|
|
||||||
late final enterUri = 'bilibili://following/detail/$oid';
|
|
||||||
uri = switch (type) {
|
|
||||||
1 =>
|
|
||||||
'bilibili://video/$oid?comment_root_id=${hasRoot ? widget.replyItem.root : widget.replyItem.id}${hasRoot ? '&comment_secondary_id=${widget.replyItem.id}' : ''}',
|
|
||||||
11 ||
|
|
||||||
12 =>
|
|
||||||
'bilibili://comment/detail/$type/$oid/$rootId/?${anchor}enterUri=${Get.arguments['enterUri']}',
|
|
||||||
_ =>
|
|
||||||
'bilibili://comment/detail/$type/$oid/$rootId/?${anchor}enterUri=$enterUri',
|
|
||||||
};
|
|
||||||
} catch (_) {}
|
|
||||||
} else if (currentRoute.startsWith('/htmlRender')) {
|
|
||||||
try {
|
|
||||||
final type = widget.replyItem.type.toInt();
|
|
||||||
late final oid = widget.replyItem.oid;
|
|
||||||
late final rootId =
|
|
||||||
hasRoot ? widget.replyItem.root : widget.replyItem.id;
|
|
||||||
late final anchor = hasRoot ? 'anchor=${widget.replyItem.id}&' : '';
|
|
||||||
late final enterUri =
|
|
||||||
'bilibili://following/detail/${Get.parameters['id']}';
|
|
||||||
uri =
|
uri =
|
||||||
'bilibili://comment/detail/$type/$oid/$rootId/?${anchor}enterUri=$enterUri';
|
'bilibili://video/${_item.oid}?comment_root_id=${hasRoot ? _item.root : _item.id}${hasRoot ? '&comment_secondary_id=${_item.id}' : ''}';
|
||||||
|
} else if (currentRoute.startsWith('/dynamicDetail')) {
|
||||||
|
try {
|
||||||
|
DynamicItemModel dynItem = Get.arguments['item'];
|
||||||
|
uname = dynItem.modules?.moduleAuthor?.name;
|
||||||
|
final type = _item.type.toInt();
|
||||||
|
late final oid = dynItem.idStr;
|
||||||
|
late final rootId = hasRoot ? _item.root : _item.id;
|
||||||
|
late final anchor = hasRoot ? 'anchor=${_item.id}&' : '';
|
||||||
|
late final enterUri = 'bilibili://following/detail/$oid';
|
||||||
|
uri = switch (type) {
|
||||||
|
1 =>
|
||||||
|
'bilibili://video/${dynItem.basic!['rid_str']}?comment_root_id=${hasRoot ? _item.root : _item.id}${hasRoot ? '&comment_secondary_id=${_item.id}' : ''}',
|
||||||
|
11 ||
|
||||||
|
12 =>
|
||||||
|
'bilibili://comment/detail/$type/${dynItem.basic!['rid_str']}/$rootId/?${anchor}enterUri=$enterUri',
|
||||||
|
_ =>
|
||||||
|
'bilibili://comment/detail/$type/$oid/$rootId/?${anchor}enterUri=$enterUri',
|
||||||
|
};
|
||||||
|
} catch (_) {}
|
||||||
|
} else if (currentRoute.startsWith('/Scaffold')) {
|
||||||
|
try {
|
||||||
|
final type = _item.type.toInt();
|
||||||
|
late final oid = Get.arguments['oid'];
|
||||||
|
late final rootId = hasRoot ? _item.root : _item.id;
|
||||||
|
late final anchor = hasRoot ? 'anchor=${_item.id}&' : '';
|
||||||
|
late final enterUri = 'bilibili://following/detail/$oid';
|
||||||
|
uri = switch (type) {
|
||||||
|
1 =>
|
||||||
|
'bilibili://video/$oid?comment_root_id=${hasRoot ? _item.root : _item.id}${hasRoot ? '&comment_secondary_id=${_item.id}' : ''}',
|
||||||
|
11 ||
|
||||||
|
12 =>
|
||||||
|
'bilibili://comment/detail/$type/$oid/$rootId/?${anchor}enterUri=${Get.arguments['enterUri']}',
|
||||||
|
_ =>
|
||||||
|
'bilibili://comment/detail/$type/$oid/$rootId/?${anchor}enterUri=$enterUri',
|
||||||
|
};
|
||||||
|
} catch (_) {}
|
||||||
|
} else if (currentRoute.startsWith('/htmlRender')) {
|
||||||
|
try {
|
||||||
|
final type = _item.type.toInt();
|
||||||
|
late final oid = _item.oid;
|
||||||
|
late final rootId = hasRoot ? _item.root : _item.id;
|
||||||
|
late final anchor = hasRoot ? 'anchor=${_item.id}&' : '';
|
||||||
|
late final enterUri =
|
||||||
|
'bilibili://following/detail/${Get.parameters['id']}';
|
||||||
|
uri =
|
||||||
|
'bilibili://comment/detail/$type/$oid/$rootId/?${anchor}enterUri=$enterUri';
|
||||||
|
} catch (_) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
debugPrint(uri);
|
||||||
|
} else if (_item is DynamicItemModel) {
|
||||||
|
try {
|
||||||
|
switch (_item.type) {
|
||||||
|
case 'DYNAMIC_TYPE_AV':
|
||||||
|
viewType = '观看';
|
||||||
|
itemType = '视频';
|
||||||
|
uri = 'bilibili://video/${_item.basic!['comment_id_str']}';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'DYNAMIC_TYPE_ARTICLE':
|
||||||
|
itemType = '专栏';
|
||||||
|
uri = 'bilibili://following/detail/${_item.idStr}';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'DYNAMIC_TYPE_LIVE_RCMD':
|
||||||
|
viewType = '观看';
|
||||||
|
itemType = '直播';
|
||||||
|
final roomId = _item.modules.moduleDynamic.major.liveRcmd.roomId;
|
||||||
|
uri = 'bilibili://live/$roomId';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'DYNAMIC_TYPE_UGC_SEASON':
|
||||||
|
viewType = '观看';
|
||||||
|
itemType = '合集';
|
||||||
|
int aid = _item.modules.moduleDynamic.major.ugcSeason.aid;
|
||||||
|
uri = 'bilibili://video/$aid';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'DYNAMIC_TYPE_PGC':
|
||||||
|
case 'DYNAMIC_TYPE_PGC_UNION':
|
||||||
|
viewType = '观看';
|
||||||
|
itemType =
|
||||||
|
_item?.modules?.moduleDynamic?.major?.pgc?.badge?['text'] ??
|
||||||
|
'番剧';
|
||||||
|
final epid = _item.modules.moduleDynamic.major.pgc.epid;
|
||||||
|
uri = 'bilibili://pgc/season/ep/$epid';
|
||||||
|
break;
|
||||||
|
|
||||||
|
// https://www.bilibili.com/medialist/detail/ml12345678
|
||||||
|
case 'DYNAMIC_TYPE_MEDIALIST':
|
||||||
|
itemType = '收藏夹';
|
||||||
|
final mediaId = _item.modules.moduleDynamic.major.medialist!['id'];
|
||||||
|
uri = 'bilibili://medialist/detail/$mediaId';
|
||||||
|
break;
|
||||||
|
|
||||||
|
// 纯文字动态查看
|
||||||
|
// case 'DYNAMIC_TYPE_WORD':
|
||||||
|
// # 装扮/剧集点评/普通分享
|
||||||
|
// case 'DYNAMIC_TYPE_COMMON_SQUARE':
|
||||||
|
// 转发的动态
|
||||||
|
// case 'DYNAMIC_TYPE_FORWARD':
|
||||||
|
// 图文动态查看
|
||||||
|
// case 'DYNAMIC_TYPE_DRAW':
|
||||||
|
default:
|
||||||
|
itemType = '动态';
|
||||||
|
uri = 'bilibili://following/detail/${_item.idStr}';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
debugPrint(uri);
|
||||||
} catch (_) {}
|
} catch (_) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
debugPrint(uri);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void _onSaveOrSharePic([bool isShare = false]) async {
|
void _onSaveOrSharePic([bool isShare = false]) async {
|
||||||
@@ -195,14 +285,23 @@ class _ReplySavePanelState extends State<ReplySavePanel> {
|
|||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
IgnorePointer(
|
if (_item is ReplyInfo)
|
||||||
child: ReplyItemGrpc(
|
IgnorePointer(
|
||||||
replyItem: widget.replyItem,
|
child: ReplyItemGrpc(
|
||||||
replyLevel: '',
|
replyItem: _item,
|
||||||
needDivider: false,
|
replyLevel: '',
|
||||||
upMid: widget.upMid,
|
needDivider: false,
|
||||||
|
upMid: widget.upMid,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
else if (_item is DynamicItemModel)
|
||||||
|
IgnorePointer(
|
||||||
|
child: DynamicPanel(
|
||||||
|
item: _item,
|
||||||
|
source: 'detail',
|
||||||
|
isSave: true,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
if (cover?.isNotEmpty == true &&
|
if (cover?.isNotEmpty == true &&
|
||||||
title?.isNotEmpty == true)
|
title?.isNotEmpty == true)
|
||||||
Container(
|
Container(
|
||||||
@@ -290,7 +389,7 @@ class _ReplySavePanelState extends State<ReplySavePanel> {
|
|||||||
const SizedBox(height: 4),
|
const SizedBox(height: 4),
|
||||||
],
|
],
|
||||||
Text(
|
Text(
|
||||||
'识别二维码,查看评论',
|
'识别二维码,$viewType$itemType',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Theme.of(context)
|
color: Theme.of(context)
|
||||||
.colorScheme
|
.colorScheme
|
||||||
@@ -4,7 +4,7 @@ import 'package:PiliPlus/utils/utils.dart';
|
|||||||
import '../../../common/constants.dart';
|
import '../../../common/constants.dart';
|
||||||
import 'pic_panel.dart';
|
import 'pic_panel.dart';
|
||||||
|
|
||||||
Widget articlePanel(item, context, callback, {floor = 1}) {
|
Widget articlePanel(source, item, context, callback, {floor = 1}) {
|
||||||
TextStyle authorStyle =
|
TextStyle authorStyle =
|
||||||
TextStyle(color: Theme.of(context).colorScheme.primary);
|
TextStyle(color: Theme.of(context).colorScheme.primary);
|
||||||
return Padding(
|
return Padding(
|
||||||
@@ -46,9 +46,9 @@ Widget articlePanel(item, context, callback, {floor = 1}) {
|
|||||||
Text(
|
Text(
|
||||||
item.modules.moduleDynamic.major.opus.summary.richTextNodes.first
|
item.modules.moduleDynamic.major.opus.summary.richTextNodes.first
|
||||||
.text,
|
.text,
|
||||||
maxLines: 4,
|
maxLines: source == 'detail' ? null : 4,
|
||||||
style: const TextStyle(height: 1.55),
|
style: const TextStyle(height: 1.55),
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: source == 'detail' ? null : TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 2),
|
const SizedBox(height: 2),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'package:PiliPlus/common/widgets/report.dart';
|
import 'package:PiliPlus/common/widgets/report.dart';
|
||||||
|
import 'package:PiliPlus/common/widgets/save_panel.dart';
|
||||||
import 'package:PiliPlus/http/index.dart';
|
import 'package:PiliPlus/http/index.dart';
|
||||||
import 'package:PiliPlus/http/video.dart';
|
import 'package:PiliPlus/http/video.dart';
|
||||||
import 'package:PiliPlus/utils/extension.dart';
|
import 'package:PiliPlus/utils/extension.dart';
|
||||||
@@ -310,6 +311,16 @@ class AuthorPanel extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
minLeadingWidth: 0,
|
minLeadingWidth: 0,
|
||||||
),
|
),
|
||||||
|
ListTile(
|
||||||
|
onTap: () {
|
||||||
|
Get.back();
|
||||||
|
SavePanel.toSavePanel(item: item);
|
||||||
|
},
|
||||||
|
minLeadingWidth: 0,
|
||||||
|
leading: const Icon(Icons.save_alt, size: 19),
|
||||||
|
title:
|
||||||
|
Text('保存动态', style: Theme.of(context).textTheme.titleSmall!),
|
||||||
|
),
|
||||||
if (item.modules.moduleAuthor.mid == Accounts.main.mid) ...[
|
if (item.modules.moduleAuthor.mid == Accounts.main.mid) ...[
|
||||||
ListTile(
|
ListTile(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
|
|||||||
@@ -14,12 +14,14 @@ class DynamicPanel extends StatelessWidget {
|
|||||||
final String? source;
|
final String? source;
|
||||||
final Function? onRemove;
|
final Function? onRemove;
|
||||||
final Function(List<String>, int)? callback;
|
final Function(List<String>, int)? callback;
|
||||||
|
final bool? isSave;
|
||||||
|
|
||||||
const DynamicPanel({
|
const DynamicPanel({
|
||||||
required this.item,
|
required this.item,
|
||||||
this.source,
|
this.source,
|
||||||
this.onRemove,
|
this.onRemove,
|
||||||
this.callback,
|
this.callback,
|
||||||
|
this.isSave,
|
||||||
super.key,
|
super.key,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -29,8 +31,9 @@ class DynamicPanel extends StatelessWidget {
|
|||||||
// padding: source == 'detail'
|
// padding: source == 'detail'
|
||||||
// ? const EdgeInsets.only(bottom: 12)
|
// ? const EdgeInsets.only(bottom: 12)
|
||||||
// : EdgeInsets.zero,
|
// : EdgeInsets.zero,
|
||||||
decoration: source == 'detail' &&
|
decoration: isSave == true ||
|
||||||
Get.context!.orientation == Orientation.landscape
|
(source == 'detail' &&
|
||||||
|
Get.context!.orientation == Orientation.landscape)
|
||||||
? null
|
? null
|
||||||
: BoxDecoration(
|
: BoxDecoration(
|
||||||
border: Border(
|
border: Border(
|
||||||
@@ -138,7 +141,7 @@ class DynamicPanel extends StatelessWidget {
|
|||||||
forWard(item, context, source, callback),
|
forWard(item, context, source, callback),
|
||||||
const SizedBox(height: 2),
|
const SizedBox(height: 2),
|
||||||
if (source == null) ActionPanel(item: item),
|
if (source == null) ActionPanel(item: item),
|
||||||
if (source == 'detail') const SizedBox(height: 12),
|
if (source == 'detail' && isSave != true) const SizedBox(height: 12),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -160,12 +160,12 @@ Widget forWard(item, BuildContext context, source, callback, {floor = 1}) {
|
|||||||
);
|
);
|
||||||
// 视频
|
// 视频
|
||||||
case 'DYNAMIC_TYPE_AV':
|
case 'DYNAMIC_TYPE_AV':
|
||||||
return videoSeasonWidget(item, context, 'archive', floor: floor);
|
return videoSeasonWidget(source, item, context, 'archive', floor: floor);
|
||||||
// 文章
|
// 文章
|
||||||
case 'DYNAMIC_TYPE_ARTICLE':
|
case 'DYNAMIC_TYPE_ARTICLE':
|
||||||
return switch (item) {
|
return switch (item) {
|
||||||
DynamicItemModel() => item.isForwarded == true
|
DynamicItemModel() => item.isForwarded == true
|
||||||
? articlePanel(item, context, callback, floor: floor)
|
? articlePanel(source, item, context, callback, floor: floor)
|
||||||
: item.modules?.moduleDynamic?.major?.blocked != null
|
: item.modules?.moduleDynamic?.major?.blocked != null
|
||||||
? Padding(
|
? Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 12),
|
padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||||
@@ -260,13 +260,13 @@ Widget forWard(item, BuildContext context, source, callback, {floor = 1}) {
|
|||||||
);
|
);
|
||||||
// 直播
|
// 直播
|
||||||
case 'DYNAMIC_TYPE_LIVE_RCMD':
|
case 'DYNAMIC_TYPE_LIVE_RCMD':
|
||||||
return liveRcmdPanel(item, context, floor: floor);
|
return liveRcmdPanel(source, item, context, floor: floor);
|
||||||
// 直播
|
// 直播
|
||||||
case 'DYNAMIC_TYPE_LIVE':
|
case 'DYNAMIC_TYPE_LIVE':
|
||||||
return livePanel(item, context, floor: floor);
|
return livePanel(source, item, context, floor: floor);
|
||||||
// 合集
|
// 合集
|
||||||
case 'DYNAMIC_TYPE_UGC_SEASON':
|
case 'DYNAMIC_TYPE_UGC_SEASON':
|
||||||
return videoSeasonWidget(item, context, 'ugcSeason');
|
return videoSeasonWidget(source, item, context, 'ugcSeason');
|
||||||
case 'DYNAMIC_TYPE_WORD':
|
case 'DYNAMIC_TYPE_WORD':
|
||||||
InlineSpan? richNodes = richNode(item, context);
|
InlineSpan? richNodes = richNode(item, context);
|
||||||
return floor == 2
|
return floor == 2
|
||||||
@@ -318,9 +318,9 @@ Widget forWard(item, BuildContext context, source, callback, {floor = 1}) {
|
|||||||
? _blockedItem(context, item, source)
|
? _blockedItem(context, item, source)
|
||||||
: const SizedBox(height: 0);
|
: const SizedBox(height: 0);
|
||||||
case 'DYNAMIC_TYPE_PGC':
|
case 'DYNAMIC_TYPE_PGC':
|
||||||
return videoSeasonWidget(item, context, 'pgc', floor: floor);
|
return videoSeasonWidget(source, item, context, 'pgc', floor: floor);
|
||||||
case 'DYNAMIC_TYPE_PGC_UNION':
|
case 'DYNAMIC_TYPE_PGC_UNION':
|
||||||
return videoSeasonWidget(item, context, 'pgc', floor: floor);
|
return videoSeasonWidget(source, item, context, 'pgc', floor: floor);
|
||||||
// 直播结束
|
// 直播结束
|
||||||
case 'DYNAMIC_TYPE_NONE':
|
case 'DYNAMIC_TYPE_NONE':
|
||||||
return Row(
|
return Row(
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import 'package:PiliPlus/utils/utils.dart';
|
|||||||
|
|
||||||
import 'rich_node_panel.dart';
|
import 'rich_node_panel.dart';
|
||||||
|
|
||||||
Widget livePanel(item, context, {floor = 1}) {
|
Widget livePanel(source, item, context, {floor = 1}) {
|
||||||
dynamic content = item.modules.moduleDynamic.major;
|
dynamic content = item.modules.moduleDynamic.major;
|
||||||
late final TextStyle authorStyle =
|
late final TextStyle authorStyle =
|
||||||
TextStyle(color: Theme.of(context).colorScheme.primary);
|
TextStyle(color: Theme.of(context).colorScheme.primary);
|
||||||
@@ -85,8 +85,8 @@ Widget livePanel(item, context, {floor = 1}) {
|
|||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
content.live.title,
|
content.live.title,
|
||||||
maxLines: 2,
|
maxLines: source == 'detail' ? null : 2,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: source == 'detail' ? null : TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 4),
|
const SizedBox(height: 4),
|
||||||
Text(
|
Text(
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import 'package:PiliPlus/utils/utils.dart';
|
|||||||
|
|
||||||
import 'rich_node_panel.dart';
|
import 'rich_node_panel.dart';
|
||||||
|
|
||||||
Widget liveRcmdPanel(item, context, {floor = 1}) {
|
Widget liveRcmdPanel(source, item, context, {floor = 1}) {
|
||||||
TextStyle authorStyle =
|
TextStyle authorStyle =
|
||||||
TextStyle(color: Theme.of(context).colorScheme.primary);
|
TextStyle(color: Theme.of(context).colorScheme.primary);
|
||||||
DynamicLiveModel liveRcmd = item.modules.moduleDynamic.major.liveRcmd;
|
DynamicLiveModel liveRcmd = item.modules.moduleDynamic.major.liveRcmd;
|
||||||
@@ -144,9 +144,9 @@ Widget liveRcmdPanel(item, context, {floor = 1}) {
|
|||||||
padding: const EdgeInsets.symmetric(horizontal: StyleString.safeSpace),
|
padding: const EdgeInsets.symmetric(horizontal: StyleString.safeSpace),
|
||||||
child: Text(
|
child: Text(
|
||||||
item.modules.moduleDynamic.major.liveRcmd.title,
|
item.modules.moduleDynamic.major.liveRcmd.title,
|
||||||
maxLines: 1,
|
maxLines: source == 'detail' ? null : 1,
|
||||||
style: const TextStyle(fontWeight: FontWeight.bold),
|
style: const TextStyle(fontWeight: FontWeight.bold),
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: source == 'detail' ? null : TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 2),
|
const SizedBox(height: 2),
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import 'package:PiliPlus/utils/utils.dart';
|
|||||||
|
|
||||||
import 'rich_node_panel.dart';
|
import 'rich_node_panel.dart';
|
||||||
|
|
||||||
Widget videoSeasonWidget(item, context, type, {floor = 1}) {
|
Widget videoSeasonWidget(source, item, context, type, {floor = 1}) {
|
||||||
if (item.modules.moduleDynamic.major?.type == 'MAJOR_TYPE_NONE') {
|
if (item.modules.moduleDynamic.major?.type == 'MAJOR_TYPE_NONE') {
|
||||||
return item.modules.moduleDynamic.major?.none?.tips != null
|
return item.modules.moduleDynamic.major?.none?.tips != null
|
||||||
? Row(
|
? Row(
|
||||||
@@ -196,9 +196,9 @@ Widget videoSeasonWidget(item, context, type, {floor = 1}) {
|
|||||||
: EdgeInsets.zero,
|
: EdgeInsets.zero,
|
||||||
child: Text(
|
child: Text(
|
||||||
content.title,
|
content.title,
|
||||||
maxLines: 1,
|
maxLines: source == 'detail' ? null : 1,
|
||||||
style: const TextStyle(fontWeight: FontWeight.bold),
|
style: const TextStyle(fontWeight: FontWeight.bold),
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: source == 'detail' ? null : TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import 'package:PiliPlus/grpc/app/main/community/reply/v1/reply.pb.dart';
|
|||||||
import 'package:PiliPlus/http/init.dart';
|
import 'package:PiliPlus/http/init.dart';
|
||||||
import 'package:PiliPlus/http/video.dart';
|
import 'package:PiliPlus/http/video.dart';
|
||||||
import 'package:PiliPlus/models/dynamics/result.dart';
|
import 'package:PiliPlus/models/dynamics/result.dart';
|
||||||
import 'package:PiliPlus/pages/video/detail/reply/widgets/reply_save.dart';
|
import 'package:PiliPlus/common/widgets/save_panel.dart';
|
||||||
import 'package:PiliPlus/pages/video/detail/reply/widgets/zan_grpc.dart';
|
import 'package:PiliPlus/pages/video/detail/reply/widgets/zan_grpc.dart';
|
||||||
import 'package:PiliPlus/utils/extension.dart';
|
import 'package:PiliPlus/utils/extension.dart';
|
||||||
import 'package:PiliPlus/utils/global_data.dart';
|
import 'package:PiliPlus/utils/global_data.dart';
|
||||||
@@ -1202,23 +1202,7 @@ class ReplyItemGrpc extends StatelessWidget {
|
|||||||
break;
|
break;
|
||||||
case 'saveReply':
|
case 'saveReply':
|
||||||
Get.back();
|
Get.back();
|
||||||
Get.generalDialog(
|
SavePanel.toSavePanel(upMid: upMid, item: item);
|
||||||
barrierLabel: '',
|
|
||||||
barrierDismissible: true,
|
|
||||||
pageBuilder: (context, animation, secondaryAnimation) {
|
|
||||||
return ReplySavePanel(upMid: upMid, replyItem: item);
|
|
||||||
},
|
|
||||||
transitionDuration: const Duration(milliseconds: 255),
|
|
||||||
transitionBuilder: (context, animation, secondaryAnimation, child) {
|
|
||||||
var tween = Tween<double>(begin: 0, end: 1)
|
|
||||||
.chain(CurveTween(curve: Curves.easeInOut));
|
|
||||||
return FadeTransition(
|
|
||||||
opacity: animation.drive(tween),
|
|
||||||
child: child,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
routeSettings: RouteSettings(arguments: Get.arguments),
|
|
||||||
);
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -439,6 +439,20 @@ class PiliScheme {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
case 'medialist':
|
||||||
|
String? mediaId = uriDigitRegExp.firstMatch(path)?.group(1);
|
||||||
|
if (mediaId != null) {
|
||||||
|
Utils.toDupNamed(
|
||||||
|
'/favDetail',
|
||||||
|
parameters: {
|
||||||
|
'mediaId': mediaId,
|
||||||
|
'heroTag': Utils.makeHeroTag(mediaId),
|
||||||
|
},
|
||||||
|
off: off,
|
||||||
|
);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
default:
|
default:
|
||||||
if (selfHandle.not) {
|
if (selfHandle.not) {
|
||||||
debugPrint('$uri');
|
debugPrint('$uri');
|
||||||
|
|||||||
@@ -875,17 +875,6 @@ class Utils {
|
|||||||
SmartDialog.showToast('暂未支持的类型,请联系开发者');
|
SmartDialog.showToast('暂未支持的类型,请联系开发者');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/// 纯文字动态查看
|
|
||||||
case 'DYNAMIC_TYPE_WORD':
|
|
||||||
debugPrint('纯文本');
|
|
||||||
Utils.toDupNamed(
|
|
||||||
'/dynamicDetail',
|
|
||||||
arguments: {
|
|
||||||
'item': item,
|
|
||||||
'floor': floor,
|
|
||||||
},
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
case 'DYNAMIC_TYPE_LIVE_RCMD':
|
case 'DYNAMIC_TYPE_LIVE_RCMD':
|
||||||
DynamicLiveModel liveRcmd = item.modules.moduleDynamic.major.liveRcmd;
|
DynamicLiveModel liveRcmd = item.modules.moduleDynamic.major.liveRcmd;
|
||||||
ModuleAuthorModel author = item.modules.moduleAuthor;
|
ModuleAuthorModel author = item.modules.moduleAuthor;
|
||||||
@@ -947,10 +936,13 @@ class Utils {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// 纯文字动态查看
|
||||||
|
// case 'DYNAMIC_TYPE_WORD':
|
||||||
|
// # 装扮/剧集点评/普通分享
|
||||||
// case 'DYNAMIC_TYPE_COMMON_SQUARE':
|
// case 'DYNAMIC_TYPE_COMMON_SQUARE':
|
||||||
// /// 转发的动态
|
// 转发的动态
|
||||||
// case 'DYNAMIC_TYPE_FORWARD':
|
// case 'DYNAMIC_TYPE_FORWARD':
|
||||||
// /// 图文动态查看
|
// 图文动态查看
|
||||||
// case 'DYNAMIC_TYPE_DRAW':
|
// case 'DYNAMIC_TYPE_DRAW':
|
||||||
default:
|
default:
|
||||||
Utils.toDupNamed(
|
Utils.toDupNamed(
|
||||||
|
|||||||
Reference in New Issue
Block a user