mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
feat: at、赞、回复页视频路由跳转支持
This commit is contained in:
@@ -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},请截图反馈给开发者');
|
||||
|
||||
Reference in New Issue
Block a user