Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-02-12 14:20:16 +08:00
parent 6502b97388
commit 09753b6bbd
2 changed files with 24 additions and 3 deletions

View File

@@ -79,10 +79,14 @@ class DynamicsHttp {
//
static Future dynamicDetail({
String? id,
dynamic rid,
dynamic type,
}) async {
var res = await Request().get(Api.dynamicDetail, queryParameters: {
'timezone_offset': -480,
'id': id,
if (id != null) 'id': id,
if (rid != null) 'rid': rid,
if (type != null) 'type': type,
'features': 'itemOpusStyle',
});
if (res.data['code'] == 0) {

View File

@@ -121,7 +121,7 @@ class PiliScheme {
//fmt.Sprintf("bilibili://comment/detail/%d/%d/%d/?subType=%d&anchor=%d&showEnter=1&extraIntentId=%d", rp.Type, rp.Oid, rootID, subType, rp.RpID, extraIntentID)
debugPrint('${value.queryParameters}');
List<String> pathParts = path.split('/');
// int type = int.parse(pathParts[2]);
int type = int.parse(pathParts[2]);
int oid = int.parse(pathParts[3]);
int rootId = int.parse(pathParts[4]);
// int subType = int.parse(value.queryParameters['subType'] ?? '0');
@@ -150,7 +150,7 @@ class PiliScheme {
oid: oid,
rpid: rootId, // rpID,
source: 'routePush',
replyType: ReplyType.dynamics,
replyType: ReplyType.values[type],
firstFloor: null,
),
),
@@ -211,6 +211,23 @@ class PiliScheme {
} else {
getToOpusWeb();
}
} else if (host == 'album') {
String? rid =
RegExp(r'album/(\d+)').firstMatch(value.toString())?.group(1);
if (rid != null) {
SmartDialog.showLoading();
dynamic res = await DynamicsHttp.dynamicDetail(rid: rid, type: 2);
SmartDialog.dismiss();
if (res['status']) {
Get.toNamed('/dynamicDetail', arguments: {
'item': res['data'],
'floor': 1,
'action': 'detail'
});
} else {
SmartDialog.showToast(res['msg']);
}
}
} else {
debugPrint('$value');
SmartDialog.showToast('未知路径:$value,请截图反馈给开发者');