feat: at、赞、回复页视频路由跳转支持

This commit is contained in:
orz12
2024-07-11 17:46:14 +08:00
parent 2fd85da836
commit 815716c402
4 changed files with 54 additions and 21 deletions

View File

@@ -32,6 +32,21 @@ class PiliScheme {
});
}
static SchemeEntity stringToSchemeEntity(String dataString) {
Uri uri = Uri.parse(dataString);
Map<String, String>? queryParams =
uri.query.isNotEmpty ? Uri.splitQueryString(uri.query) : null;
return SchemeEntity(
scheme: uri.scheme,
host: uri.host,
port: uri.hasPort ? uri.port : null,
path: uri.path,
query: queryParams,
source: dataString,
dataString: dataString,
);
}
/// 路由跳转
static void routePush(SchemeEntity value) async {
final String scheme = value.scheme!;
@@ -96,6 +111,16 @@ class PiliScheme {
'dynamicType': 'read'
},
);
} else if (host == 'following' && path.startsWith("/detail/")) {
var opusId = path.split('/').last;
Get.toNamed(
'/webview',
parameters: {
'url': 'https://www.bilibili.com/opus/$opusId',
'type': 'url',
'pageTitle': '',
},
);
} else {
print(value.dataString);
SmartDialog.showToast('未知路径:${value.dataString},请截图反馈给开发者');