diff --git a/lib/pages/article/view.dart b/lib/pages/article/view.dart index d6ef37a5..0d01eaca 100644 --- a/lib/pages/article/view.dart +++ b/lib/pages/article/view.dart @@ -648,7 +648,7 @@ class _ArticlePageState extends State children: [ Icon(Icons.forward_to_inbox, size: 19), SizedBox(width: 10), - Text('分享至动态'), + Text('分享至消息'), ], ), ), diff --git a/lib/pages/history/view.dart b/lib/pages/history/view.dart index dd07cad1..60bdcf5c 100644 --- a/lib/pages/history/view.dart +++ b/lib/pages/history/view.dart @@ -246,7 +246,14 @@ class _HistoryPageState extends State physics: const AlwaysScrollableScrollPhysics(), controller: _historyController.scrollController, slivers: [ - Obx(() => _buildBody(_historyController.loadingState.value)), + SliverPadding( + padding: EdgeInsets.only( + top: StyleString.safeSpace - 5, + bottom: MediaQuery.of(context).padding.bottom + 80, + ), + sliver: + Obx(() => _buildBody(_historyController.loadingState.value)), + ), ], ), ); @@ -263,29 +270,23 @@ class _HistoryPageState extends State ), ), Success() => loadingState.response?.isNotEmpty == true - ? SliverPadding( - padding: EdgeInsets.only( - top: StyleString.safeSpace - 5, - bottom: MediaQuery.of(context).padding.bottom + 80, - ), - sliver: SliverGrid( - gridDelegate: Grid.videoCardHDelegate(context), - delegate: SliverChildBuilderDelegate( - (context, index) { - if (index == loadingState.response!.length - 1) { - _historyController.onLoadMore(); - } - final item = loadingState.response![index]; - return HistoryItem( - videoItem: item, - ctr: _historyController.baseCtr, - onChoose: () => _historyController.onSelect(index), - onDelete: (kid, business) => - _historyController.delHistory(item), - ); - }, - childCount: loadingState.response!.length, - ), + ? SliverGrid( + gridDelegate: Grid.videoCardHDelegate(context), + delegate: SliverChildBuilderDelegate( + (context, index) { + if (index == loadingState.response!.length - 1) { + _historyController.onLoadMore(); + } + final item = loadingState.response![index]; + return HistoryItem( + videoItem: item, + ctr: _historyController.baseCtr, + onChoose: () => _historyController.onSelect(index), + onDelete: (kid, business) => + _historyController.delHistory(item), + ); + }, + childCount: loadingState.response!.length, ), ) : HttpError( 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 8ff03a2d..bec448b3 100644 --- a/lib/pages/video/detail/reply/widgets/reply_item_grpc.dart +++ b/lib/pages/video/detail/reply/widgets/reply_item_grpc.dart @@ -25,7 +25,6 @@ import 'package:PiliPlus/utils/feed_back.dart'; import 'package:PiliPlus/utils/storage.dart'; import 'package:PiliPlus/utils/url_utils.dart'; import 'package:PiliPlus/utils/utils.dart'; -import 'package:html/parser.dart' show parse; class ReplyItemGrpc extends StatelessWidget { const ReplyItemGrpc({ @@ -618,7 +617,6 @@ class ReplyItemGrpc extends StatelessWidget { }); message = message.replaceAll(RegExp(r"\{vote:\d+?\}"), ""); } - message = parse(message).body?.text ?? message; // 构建正则表达式 final List specialTokens = [ ...content.emote.keys, diff --git a/lib/utils/request_utils.dart b/lib/utils/request_utils.dart index bdc92afe..3f50040b 100644 --- a/lib/utils/request_utils.dart +++ b/lib/utils/request_utils.dart @@ -43,12 +43,11 @@ class RequestUtils { required int receiverId, required Map content, String? message, - ValueChanged? callback, }) async { SmartDialog.showLoading(); final ownerMid = Accounts.main.mid; - final videoRes = await GrpcRepo.sendMsg( + final contentRes = await GrpcRepo.sendMsg( senderUid: ownerMid, receiverId: receiverId, content: jsonEncode(content), @@ -57,26 +56,26 @@ class RequestUtils { : MsgType.EN_MSG_TYPE_SHARE_V2, ); - if (videoRes['status']) { + if (contentRes['status']) { if (message?.isNotEmpty == true) { - var textRes = await MsgHttp.sendMsg( + var msgRes = await MsgHttp.sendMsg( senderUid: ownerMid, receiverId: receiverId, content: jsonEncode({"content": message}), msgType: 1, ); Get.back(); - if (textRes['status']) { + if (msgRes['status']) { SmartDialog.showToast('分享成功'); } else { - SmartDialog.showToast('视频分享成功,但消息分享失败: ${textRes['msg']}'); + SmartDialog.showToast('内容分享成功,但消息分享失败: ${msgRes['msg']}'); } } else { Get.back(); SmartDialog.showToast('分享成功'); } } else { - SmartDialog.showToast('分享失败: ${videoRes['msg']}'); + SmartDialog.showToast('分享失败: ${contentRes['msg']}'); } SmartDialog.dismiss(); }