Merge branch 'feature-appScheme'

This commit is contained in:
guozhigq
2024-04-21 19:26:21 +08:00
2 changed files with 24 additions and 5 deletions

View File

@ -36,7 +36,7 @@ class NetworkImgLayer extends StatelessWidget {
final int defaultImgQuality = GlobalData().imgQuality;
final String imageUrl =
'${src!.startsWith('//') ? 'https:${src!}' : src!}@${quality ?? defaultImgQuality}q.webp';
print(imageUrl);
// print(imageUrl);
int? memCacheWidth, memCacheHeight;
double aspectRatio = (width / height).toDouble();

View File

@ -20,7 +20,7 @@ class PiliSchame {
/// 完整链接进入 b23.无效
appScheme.getLatestScheme().then((SchemeEntity? value) {
if (value != null) {
_fullPathPush(value);
_routePush(value);
}
});
@ -37,7 +37,6 @@ class PiliSchame {
final String scheme = value.scheme;
final String host = value.host;
final String path = value.path;
if (scheme == 'bilibili') {
if (host == 'root') {
Navigator.popUntil(
@ -85,6 +84,14 @@ class PiliSchame {
}
} else if (host == 'search') {
Get.toNamed('/searchResult', parameters: {'keyword': ''});
} else if (host == 'article') {
final String id = path.split('/').last.split('?').first;
Get.toNamed('/htmlRender', parameters: {
'url': 'https://www.bilibili.com/read/cv$id',
'title': 'cv$id',
'id': 'cv$id',
'dynamicType': 'read'
});
}
}
if (scheme == 'https') {
@ -155,9 +162,14 @@ class PiliSchame {
final String host = value.host!;
final String? path = value.path;
Map<String, String>? query = value.query;
RegExp regExp = RegExp(r'^(www\.)?m?\.(bilibili\.com)$');
RegExp regExp = RegExp(r'^((www\.)|(m\.))?bilibili\.com$');
if (regExp.hasMatch(host)) {
print('bilibili.com');
print('bilibili.com host: $host');
print('bilibili.com path: $path');
final String lastPathSegment = path!.split('/').last;
if (lastPathSegment.contains('BV')) {
_videoPush(null, lastPathSegment);
}
} else if (host.contains('live')) {
int roomId = int.parse(path!.split('/').last);
Get.toNamed(
@ -226,6 +238,13 @@ class PiliSchame {
break;
case 'read':
print('专栏');
String id = 'cv${matchNum(query!['id']!).first}';
Get.toNamed('/htmlRender', parameters: {
'url': value.dataString!,
'title': '',
'id': id,
'dynamicType': 'read'
});
break;
case 'space':
print('个人空间');