From 3191ae27a55d5c6cfbf6d6a68bc19b56caf02c6b Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Tue, 18 Feb 2025 18:46:24 +0800 Subject: [PATCH] mod: repost panel Signed-off-by: bggRGjQaUbCoE --- lib/models/bangumi/info.dart | 3 +++ lib/pages/bangumi/introduction/controller.dart | 5 ++++- lib/pages/dynamics/repost_dyn_panel.dart | 13 ++++++------- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/lib/models/bangumi/info.dart b/lib/models/bangumi/info.dart index 536a1da9..5c33d11a 100644 --- a/lib/models/bangumi/info.dart +++ b/lib/models/bangumi/info.dart @@ -175,6 +175,7 @@ class EpisodeItem { this.subtitle, this.title, this.vid, + this.showTitle, }); int? aid; @@ -205,6 +206,7 @@ class EpisodeItem { String? subtitle; String? title; String? vid; + String? showTitle; EpisodeItem.fromJson(Map json) { aid = json['aid']; @@ -235,6 +237,7 @@ class EpisodeItem { subtitle = json['subtitle']; title = json['title']; vid = json['vid']; + showTitle = json['show_title']; } } diff --git a/lib/pages/bangumi/introduction/controller.dart b/lib/pages/bangumi/introduction/controller.dart index 4d4d776c..6af014a0 100644 --- a/lib/pages/bangumi/introduction/controller.dart +++ b/lib/pages/bangumi/introduction/controller.dart @@ -406,6 +406,8 @@ class BangumiIntroController extends CommonController { ), onTap: () { Get.back(); + EpisodeItem? item = bangumiItem?.episodes + ?.firstWhereOrNull((item) => item.epId == epId); showModalBottomSheet( context: context, isScrollControlled: true, @@ -430,7 +432,8 @@ class BangumiIntroController extends CommonController { _ => -1, }, pic: bangumiItem?.cover, - title: bangumiItem?.title, + title: + '${bangumiItem?.title}${item != null ? '\n${item.showTitle}' : ''}', uname: '', ), ); diff --git a/lib/pages/dynamics/repost_dyn_panel.dart b/lib/pages/dynamics/repost_dyn_panel.dart index d88e7ac2..8f2a9b15 100644 --- a/lib/pages/dynamics/repost_dyn_panel.dart +++ b/lib/pages/dynamics/repost_dyn_panel.dart @@ -161,7 +161,6 @@ class _RepostPanelState extends CommonPublishPageState { borderRadius: BorderRadius.circular(12), ), child: Row( - crossAxisAlignment: CrossAxisAlignment.start, children: [ if (_pic != null) ...[ NetworkImgLayer( @@ -248,8 +247,8 @@ class _RepostPanelState extends CommonPublishPageState { ? Row( children: [ const SizedBox(width: 16), - const Text( - '转发动态', + Text( + widget.rid != null ? '分享至动态' : '转发动态', style: TextStyle(fontWeight: FontWeight.bold), ), const Spacer(), @@ -263,7 +262,7 @@ class _RepostPanelState extends CommonPublishPageState { vertical: -2, ), ), - child: const Text('立即转发'), + child: Text(widget.rid != null ? '立即发布' : '立即转发'), ), const SizedBox(width: 16), ], @@ -298,8 +297,8 @@ class _RepostPanelState extends CommonPublishPageState { ), ), Center( - child: const Text( - '转发动态', + child: Text( + widget.rid != null ? '分享至动态' : '转发动态', style: TextStyle(fontSize: 15, fontWeight: FontWeight.bold), ), ), @@ -318,7 +317,7 @@ class _RepostPanelState extends CommonPublishPageState { vertical: -2, ), ), - child: const Text('转发'), + child: Text(widget.rid != null ? '发布' : '转发'), ), ), ],