From 82d615fbbf7e57cf815133a3d799fffeba9e60c1 Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Mon, 7 Apr 2025 17:31:04 +0800 Subject: [PATCH] feat: save dyn Signed-off-by: bggRGjQaUbCoE --- .../widgets/save_panel.dart} | 255 ++++++++++++------ lib/pages/dynamics/widgets/article_panel.dart | 6 +- lib/pages/dynamics/widgets/author_panel.dart | 11 + lib/pages/dynamics/widgets/dynamic_panel.dart | 9 +- lib/pages/dynamics/widgets/forward_panel.dart | 14 +- lib/pages/dynamics/widgets/live_panel.dart | 6 +- .../dynamics/widgets/live_rcmd_panel.dart | 6 +- lib/pages/dynamics/widgets/video_panel.dart | 6 +- .../detail/reply/widgets/reply_item_grpc.dart | 20 +- lib/utils/app_scheme.dart | 14 + lib/utils/utils.dart | 18 +- 11 files changed, 234 insertions(+), 131 deletions(-) rename lib/{pages/video/detail/reply/widgets/reply_save.dart => common/widgets/save_panel.dart} (64%) diff --git a/lib/pages/video/detail/reply/widgets/reply_save.dart b/lib/common/widgets/save_panel.dart similarity index 64% rename from lib/pages/video/detail/reply/widgets/reply_save.dart rename to lib/common/widgets/save_panel.dart index 8ae8997c..d326ab06 100644 --- a/lib/pages/video/detail/reply/widgets/reply_save.dart +++ b/lib/common/widgets/save_panel.dart @@ -5,6 +5,7 @@ import 'package:PiliPlus/common/widgets/icon_button.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/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/reply/widgets/reply_item_grpc.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:share_plus/share_plus.dart'; -class ReplySavePanel extends StatefulWidget { - const ReplySavePanel({ - required this.upMid, - required this.replyItem, +class SavePanel extends StatefulWidget { + const SavePanel({ + required this.item, + // reply + this.upMid, super.key, }); final dynamic upMid; - final ReplyInfo replyItem; + final dynamic item; @override - State createState() => _ReplySavePanelState(); + State 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(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 { +class _SavePanelState extends State { final boundaryKey = GlobalKey(); + // item + dynamic get _item => widget.item; + late String viewType = '查看'; + late String itemType = '内容'; + + //reply String? cover; String? title; int? pubdate; String? uname; + String uri = ''; @override void initState() { super.initState(); - final currentRoute = Get.currentRoute; - late final hasRoot = widget.replyItem.hasRoot(); + if (_item is ReplyInfo) { + itemType = '评论'; + final currentRoute = Get.currentRoute; + late final hasRoot = _item.hasRoot(); - if (currentRoute.startsWith('/video')) { - try { - final heroTag = Get.arguments?['heroTag']; - late final ctr = Get.find(tag: heroTag); - cover = ctr.videoDetail.value.pic; - title = ctr.videoDetail.value.title; - pubdate = ctr.videoDetail.value.pubdate; - uname = ctr.videoDetail.value.owner?.name; - } 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']}'; + if (currentRoute.startsWith('/video')) { + try { + final heroTag = Get.arguments?['heroTag']; + late final ctr = Get.find(tag: heroTag); + cover = ctr.videoDetail.value.pic; + title = ctr.videoDetail.value.title; + pubdate = ctr.videoDetail.value.pubdate; + uname = ctr.videoDetail.value.owner?.name; + } catch (_) {} 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 (_) {} } - - debugPrint(uri); } void _onSaveOrSharePic([bool isShare = false]) async { @@ -195,14 +285,23 @@ class _ReplySavePanelState extends State { mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ - IgnorePointer( - child: ReplyItemGrpc( - replyItem: widget.replyItem, - replyLevel: '', - needDivider: false, - upMid: widget.upMid, + if (_item is ReplyInfo) + IgnorePointer( + child: ReplyItemGrpc( + replyItem: _item, + replyLevel: '', + needDivider: false, + upMid: widget.upMid, + ), + ) + else if (_item is DynamicItemModel) + IgnorePointer( + child: DynamicPanel( + item: _item, + source: 'detail', + isSave: true, + ), ), - ), if (cover?.isNotEmpty == true && title?.isNotEmpty == true) Container( @@ -290,7 +389,7 @@ class _ReplySavePanelState extends State { const SizedBox(height: 4), ], Text( - '识别二维码,查看评论', + '识别二维码,$viewType$itemType', style: TextStyle( color: Theme.of(context) .colorScheme diff --git a/lib/pages/dynamics/widgets/article_panel.dart b/lib/pages/dynamics/widgets/article_panel.dart index 2f481056..69c7ce7b 100644 --- a/lib/pages/dynamics/widgets/article_panel.dart +++ b/lib/pages/dynamics/widgets/article_panel.dart @@ -4,7 +4,7 @@ import 'package:PiliPlus/utils/utils.dart'; import '../../../common/constants.dart'; import 'pic_panel.dart'; -Widget articlePanel(item, context, callback, {floor = 1}) { +Widget articlePanel(source, item, context, callback, {floor = 1}) { TextStyle authorStyle = TextStyle(color: Theme.of(context).colorScheme.primary); return Padding( @@ -46,9 +46,9 @@ Widget articlePanel(item, context, callback, {floor = 1}) { Text( item.modules.moduleDynamic.major.opus.summary.richTextNodes.first .text, - maxLines: 4, + maxLines: source == 'detail' ? null : 4, style: const TextStyle(height: 1.55), - overflow: TextOverflow.ellipsis, + overflow: source == 'detail' ? null : TextOverflow.ellipsis, ), const SizedBox(height: 2), ], diff --git a/lib/pages/dynamics/widgets/author_panel.dart b/lib/pages/dynamics/widgets/author_panel.dart index 06852d47..edecdf30 100644 --- a/lib/pages/dynamics/widgets/author_panel.dart +++ b/lib/pages/dynamics/widgets/author_panel.dart @@ -1,4 +1,5 @@ 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/video.dart'; import 'package:PiliPlus/utils/extension.dart'; @@ -310,6 +311,16 @@ class AuthorPanel extends StatelessWidget { }, 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) ...[ ListTile( onTap: () { diff --git a/lib/pages/dynamics/widgets/dynamic_panel.dart b/lib/pages/dynamics/widgets/dynamic_panel.dart index 7a49e947..f93b3dc7 100644 --- a/lib/pages/dynamics/widgets/dynamic_panel.dart +++ b/lib/pages/dynamics/widgets/dynamic_panel.dart @@ -14,12 +14,14 @@ class DynamicPanel extends StatelessWidget { final String? source; final Function? onRemove; final Function(List, int)? callback; + final bool? isSave; const DynamicPanel({ required this.item, this.source, this.onRemove, this.callback, + this.isSave, super.key, }); @@ -29,8 +31,9 @@ class DynamicPanel extends StatelessWidget { // padding: source == 'detail' // ? const EdgeInsets.only(bottom: 12) // : EdgeInsets.zero, - decoration: source == 'detail' && - Get.context!.orientation == Orientation.landscape + decoration: isSave == true || + (source == 'detail' && + Get.context!.orientation == Orientation.landscape) ? null : BoxDecoration( border: Border( @@ -138,7 +141,7 @@ class DynamicPanel extends StatelessWidget { forWard(item, context, source, callback), const SizedBox(height: 2), if (source == null) ActionPanel(item: item), - if (source == 'detail') const SizedBox(height: 12), + if (source == 'detail' && isSave != true) const SizedBox(height: 12), ], ); } diff --git a/lib/pages/dynamics/widgets/forward_panel.dart b/lib/pages/dynamics/widgets/forward_panel.dart index c80be764..acb6399a 100644 --- a/lib/pages/dynamics/widgets/forward_panel.dart +++ b/lib/pages/dynamics/widgets/forward_panel.dart @@ -160,12 +160,12 @@ Widget forWard(item, BuildContext context, source, callback, {floor = 1}) { ); // 视频 case 'DYNAMIC_TYPE_AV': - return videoSeasonWidget(item, context, 'archive', floor: floor); + return videoSeasonWidget(source, item, context, 'archive', floor: floor); // 文章 case 'DYNAMIC_TYPE_ARTICLE': return switch (item) { DynamicItemModel() => item.isForwarded == true - ? articlePanel(item, context, callback, floor: floor) + ? articlePanel(source, item, context, callback, floor: floor) : item.modules?.moduleDynamic?.major?.blocked != null ? Padding( padding: const EdgeInsets.symmetric(horizontal: 12), @@ -260,13 +260,13 @@ Widget forWard(item, BuildContext context, source, callback, {floor = 1}) { ); // 直播 case 'DYNAMIC_TYPE_LIVE_RCMD': - return liveRcmdPanel(item, context, floor: floor); + return liveRcmdPanel(source, item, context, floor: floor); // 直播 case 'DYNAMIC_TYPE_LIVE': - return livePanel(item, context, floor: floor); + return livePanel(source, item, context, floor: floor); // 合集 case 'DYNAMIC_TYPE_UGC_SEASON': - return videoSeasonWidget(item, context, 'ugcSeason'); + return videoSeasonWidget(source, item, context, 'ugcSeason'); case 'DYNAMIC_TYPE_WORD': InlineSpan? richNodes = richNode(item, context); return floor == 2 @@ -318,9 +318,9 @@ Widget forWard(item, BuildContext context, source, callback, {floor = 1}) { ? _blockedItem(context, item, source) : const SizedBox(height: 0); case 'DYNAMIC_TYPE_PGC': - return videoSeasonWidget(item, context, 'pgc', floor: floor); + return videoSeasonWidget(source, item, context, 'pgc', floor: floor); case 'DYNAMIC_TYPE_PGC_UNION': - return videoSeasonWidget(item, context, 'pgc', floor: floor); + return videoSeasonWidget(source, item, context, 'pgc', floor: floor); // 直播结束 case 'DYNAMIC_TYPE_NONE': return Row( diff --git a/lib/pages/dynamics/widgets/live_panel.dart b/lib/pages/dynamics/widgets/live_panel.dart index 3641d321..387205be 100644 --- a/lib/pages/dynamics/widgets/live_panel.dart +++ b/lib/pages/dynamics/widgets/live_panel.dart @@ -6,7 +6,7 @@ import 'package:PiliPlus/utils/utils.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; late final TextStyle authorStyle = TextStyle(color: Theme.of(context).colorScheme.primary); @@ -85,8 +85,8 @@ Widget livePanel(item, context, {floor = 1}) { children: [ Text( content.live.title, - maxLines: 2, - overflow: TextOverflow.ellipsis, + maxLines: source == 'detail' ? null : 2, + overflow: source == 'detail' ? null : TextOverflow.ellipsis, ), const SizedBox(height: 4), Text( diff --git a/lib/pages/dynamics/widgets/live_rcmd_panel.dart b/lib/pages/dynamics/widgets/live_rcmd_panel.dart index dccd09b1..9d57b048 100644 --- a/lib/pages/dynamics/widgets/live_rcmd_panel.dart +++ b/lib/pages/dynamics/widgets/live_rcmd_panel.dart @@ -8,7 +8,7 @@ import 'package:PiliPlus/utils/utils.dart'; import 'rich_node_panel.dart'; -Widget liveRcmdPanel(item, context, {floor = 1}) { +Widget liveRcmdPanel(source, item, context, {floor = 1}) { TextStyle authorStyle = TextStyle(color: Theme.of(context).colorScheme.primary); DynamicLiveModel liveRcmd = item.modules.moduleDynamic.major.liveRcmd; @@ -144,9 +144,9 @@ Widget liveRcmdPanel(item, context, {floor = 1}) { padding: const EdgeInsets.symmetric(horizontal: StyleString.safeSpace), child: Text( item.modules.moduleDynamic.major.liveRcmd.title, - maxLines: 1, + maxLines: source == 'detail' ? null : 1, style: const TextStyle(fontWeight: FontWeight.bold), - overflow: TextOverflow.ellipsis, + overflow: source == 'detail' ? null : TextOverflow.ellipsis, ), ), const SizedBox(height: 2), diff --git a/lib/pages/dynamics/widgets/video_panel.dart b/lib/pages/dynamics/widgets/video_panel.dart index 26c4fe21..a68ccd96 100644 --- a/lib/pages/dynamics/widgets/video_panel.dart +++ b/lib/pages/dynamics/widgets/video_panel.dart @@ -8,7 +8,7 @@ import 'package:PiliPlus/utils/utils.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') { return item.modules.moduleDynamic.major?.none?.tips != null ? Row( @@ -196,9 +196,9 @@ Widget videoSeasonWidget(item, context, type, {floor = 1}) { : EdgeInsets.zero, child: Text( content.title, - maxLines: 1, + maxLines: source == 'detail' ? null : 1, style: const TextStyle(fontWeight: FontWeight.bold), - overflow: TextOverflow.ellipsis, + overflow: source == 'detail' ? null : TextOverflow.ellipsis, ), ), ], diff --git a/lib/pages/video/detail/reply/widgets/reply_item_grpc.dart b/lib/pages/video/detail/reply/widgets/reply_item_grpc.dart index e6a6c3ab..2afdf399 100644 --- a/lib/pages/video/detail/reply/widgets/reply_item_grpc.dart +++ b/lib/pages/video/detail/reply/widgets/reply_item_grpc.dart @@ -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/video.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/utils/extension.dart'; import 'package:PiliPlus/utils/global_data.dart'; @@ -1202,23 +1202,7 @@ class ReplyItemGrpc extends StatelessWidget { break; case 'saveReply': Get.back(); - Get.generalDialog( - 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(begin: 0, end: 1) - .chain(CurveTween(curve: Curves.easeInOut)); - return FadeTransition( - opacity: animation.drive(tween), - child: child, - ); - }, - routeSettings: RouteSettings(arguments: Get.arguments), - ); + SavePanel.toSavePanel(upMid: upMid, item: item); break; default: } diff --git a/lib/utils/app_scheme.dart b/lib/utils/app_scheme.dart index 0f443975..63551afd 100644 --- a/lib/utils/app_scheme.dart +++ b/lib/utils/app_scheme.dart @@ -439,6 +439,20 @@ class PiliScheme { return true; } 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: if (selfHandle.not) { debugPrint('$uri'); diff --git a/lib/utils/utils.dart b/lib/utils/utils.dart index 38ed4c0c..16541973 100644 --- a/lib/utils/utils.dart +++ b/lib/utils/utils.dart @@ -875,17 +875,6 @@ class Utils { SmartDialog.showToast('暂未支持的类型,请联系开发者'); break; - /// 纯文字动态查看 - case 'DYNAMIC_TYPE_WORD': - debugPrint('纯文本'); - Utils.toDupNamed( - '/dynamicDetail', - arguments: { - 'item': item, - 'floor': floor, - }, - ); - break; case 'DYNAMIC_TYPE_LIVE_RCMD': DynamicLiveModel liveRcmd = item.modules.moduleDynamic.major.liveRcmd; ModuleAuthorModel author = item.modules.moduleAuthor; @@ -947,10 +936,13 @@ class Utils { } break; + // 纯文字动态查看 + // case 'DYNAMIC_TYPE_WORD': + // # 装扮/剧集点评/普通分享 // case 'DYNAMIC_TYPE_COMMON_SQUARE': - // /// 转发的动态 + // 转发的动态 // case 'DYNAMIC_TYPE_FORWARD': - // /// 图文动态查看 + // 图文动态查看 // case 'DYNAMIC_TYPE_DRAW': default: Utils.toDupNamed(