mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
fix: push bilibili://following/detail
related #576 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -6,8 +6,7 @@ class MsgFeedReplyMe {
|
||||
MsgFeedReplyMe({this.cursor, this.items, this.lastViewAt});
|
||||
|
||||
MsgFeedReplyMe.fromJson(Map<String, dynamic> json) {
|
||||
cursor =
|
||||
json['cursor'] != null ? Cursor.fromJson(json['cursor']) : null;
|
||||
cursor = json['cursor'] != null ? Cursor.fromJson(json['cursor']) : null;
|
||||
if (json['items'] != null) {
|
||||
items = <ReplyMeItems>[];
|
||||
json['items'].forEach((v) {
|
||||
@@ -56,13 +55,14 @@ class ReplyMeItems {
|
||||
int? isMulti;
|
||||
int? replyTime;
|
||||
|
||||
ReplyMeItems(
|
||||
{this.id,
|
||||
ReplyMeItems({
|
||||
this.id,
|
||||
this.user,
|
||||
this.item,
|
||||
this.counts,
|
||||
this.isMulti,
|
||||
this.replyTime});
|
||||
this.replyTime,
|
||||
});
|
||||
|
||||
ReplyMeItems.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:PiliPlus/common/widgets/loading_widget.dart';
|
||||
import 'package:PiliPlus/common/widgets/refresh_indicator.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/models/msg/msgfeed_reply_me.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -46,29 +47,31 @@ class _ReplyMePageState extends State<ReplyMePage> {
|
||||
_replyMeController.onLoadMore();
|
||||
}
|
||||
|
||||
ReplyMeItems item = loadingState.response[index];
|
||||
return ListTile(
|
||||
onTap: () {
|
||||
String? nativeUri =
|
||||
loadingState.response[index].item?.nativeUri;
|
||||
String? nativeUri = item.item?.nativeUri;
|
||||
if (nativeUri != null) {
|
||||
PiliScheme.routePushFromUrl(nativeUri);
|
||||
PiliScheme.routePushFromUrl(
|
||||
nativeUri,
|
||||
businessId: item.item?.businessId,
|
||||
);
|
||||
}
|
||||
},
|
||||
leading: GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(
|
||||
'/member?mid=${loadingState.response[index].user?.mid}');
|
||||
Get.toNamed('/member?mid=${item.user?.mid}');
|
||||
},
|
||||
child: NetworkImgLayer(
|
||||
width: 45,
|
||||
height: 45,
|
||||
type: 'avatar',
|
||||
src: loadingState.response[index].user?.avatar,
|
||||
src: item.user?.avatar,
|
||||
),
|
||||
),
|
||||
title: Text(
|
||||
"${loadingState.response[index].user?.nickname} "
|
||||
"回复了我的${loadingState.response[index].item?.business}",
|
||||
"${item.user?.nickname}${item.isMulti == 1 ? '等人' : ''} "
|
||||
"回复了我的${item.item?.business} ${item.isMulti == 1 ? ',共${item.counts}条' : ''}",
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodyMedium!
|
||||
@@ -79,9 +82,7 @@ class _ReplyMePageState extends State<ReplyMePage> {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
loadingState.response[index].item?.sourceContent ??
|
||||
"",
|
||||
Text(item.item?.sourceContent ?? "",
|
||||
style: Theme.of(context).textTheme.bodyMedium),
|
||||
const SizedBox(height: 4),
|
||||
if (loadingState
|
||||
@@ -90,8 +91,7 @@ class _ReplyMePageState extends State<ReplyMePage> {
|
||||
loadingState
|
||||
.response[index].item?.targetReplyContent !=
|
||||
"")
|
||||
Text(
|
||||
"| ${loadingState.response[index].item?.targetReplyContent}",
|
||||
Text("| ${item.item?.targetReplyContent}",
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: Theme.of(context)
|
||||
@@ -101,12 +101,9 @@ class _ReplyMePageState extends State<ReplyMePage> {
|
||||
color:
|
||||
Theme.of(context).colorScheme.outline,
|
||||
height: 1.5)),
|
||||
if (loadingState.response[index].item?.rootReplyContent !=
|
||||
null &&
|
||||
loadingState.response[index].item?.rootReplyContent !=
|
||||
"")
|
||||
Text(
|
||||
" | ${loadingState.response[index].item?.rootReplyContent}",
|
||||
if (item.item?.rootReplyContent != null &&
|
||||
item.item?.rootReplyContent != "")
|
||||
Text(" | ${item.item?.rootReplyContent}",
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: Theme.of(context)
|
||||
@@ -117,8 +114,7 @@ class _ReplyMePageState extends State<ReplyMePage> {
|
||||
Theme.of(context).colorScheme.outline,
|
||||
height: 1.5)),
|
||||
Text(
|
||||
Utils.dateFormat(
|
||||
loadingState.response[index].replyTime),
|
||||
Utils.dateFormat(item.replyTime),
|
||||
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
|
||||
color: Theme.of(context).colorScheme.outline,
|
||||
),
|
||||
|
||||
@@ -35,6 +35,7 @@ class PiliScheme {
|
||||
bool selfHandle = false,
|
||||
bool off = false,
|
||||
Map? parameters,
|
||||
int? businessId,
|
||||
}) async {
|
||||
try {
|
||||
if (url.startsWith('//')) {
|
||||
@@ -47,6 +48,7 @@ class PiliScheme {
|
||||
selfHandle: selfHandle,
|
||||
off: off,
|
||||
parameters: parameters,
|
||||
businessId: businessId,
|
||||
);
|
||||
} catch (_) {
|
||||
return false;
|
||||
@@ -59,6 +61,7 @@ class PiliScheme {
|
||||
bool selfHandle = false,
|
||||
bool off = false,
|
||||
Map? parameters,
|
||||
int? businessId,
|
||||
}) async {
|
||||
final String scheme = uri.scheme;
|
||||
final String host = uri.host.toLowerCase();
|
||||
@@ -273,9 +276,14 @@ class PiliScheme {
|
||||
),
|
||||
);
|
||||
return true;
|
||||
} else if (path.startsWith("/msg_fold/")) {
|
||||
// bilibili://comment/msg_fold/1/22222/33333/11111/?enterUri=bilibili://video/22222
|
||||
// bilibili://comment/msg_fold/11/22222/33333/11111/?enterUri=bilibili://following/detail/44444
|
||||
}
|
||||
return false;
|
||||
case 'following':
|
||||
// bilibili://following/detail/832703053858603029
|
||||
// bilibili://following/detail/12345678?comment_root_id=654321\u0026comment_on=1
|
||||
if (path.startsWith("/detail/")) {
|
||||
final queryParameters = uri.queryParameters;
|
||||
final commentRootId = queryParameters['comment_root_id'];
|
||||
@@ -302,7 +310,9 @@ class PiliScheme {
|
||||
oid: int.parse(oid),
|
||||
rpid: rpid,
|
||||
source: 'routePush',
|
||||
replyType: ReplyType.dynamics,
|
||||
replyType: businessId != null
|
||||
? ReplyType.values[businessId]
|
||||
: ReplyType.dynamics,
|
||||
firstFloor: null,
|
||||
id: queryParameters['comment_secondary_id'] != null
|
||||
? int.tryParse(
|
||||
|
||||
Reference in New Issue
Block a user