diff --git a/lib/http/dynamics.dart b/lib/http/dynamics.dart index 41e61231..b956d76f 100644 --- a/lib/http/dynamics.dart +++ b/lib/http/dynamics.dart @@ -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) { diff --git a/lib/utils/app_scheme.dart b/lib/utils/app_scheme.dart index 876e137f..c2630251 100644 --- a/lib/utils/app_scheme.dart +++ b/lib/utils/app_scheme.dart @@ -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 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,请截图反馈给开发者');