mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
refa: article (#757)
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -267,12 +267,13 @@ class PageUtils {
|
||||
DynamicItemModel data = res['data'];
|
||||
if (data.basic?['comment_type'] == 12) {
|
||||
toDupNamed(
|
||||
'/htmlRender',
|
||||
'/articlePage',
|
||||
parameters: {
|
||||
'url': 'www.bilibili.com/opus/$id',
|
||||
'title': '',
|
||||
'id': id,
|
||||
'dynamicType': 'opus'
|
||||
'type': 'opus',
|
||||
},
|
||||
arguments: {
|
||||
'item': data,
|
||||
},
|
||||
off: off,
|
||||
);
|
||||
@@ -398,20 +399,17 @@ class PageUtils {
|
||||
case 'DYNAMIC_TYPE_ARTICLE':
|
||||
String? url = item?.modules?.moduleDynamic?.major?.opus?.jumpUrl;
|
||||
if (url != null) {
|
||||
String? title = item?.modules?.moduleDynamic?.major?.opus?.title;
|
||||
if (url.contains('opus') || url.contains('read')) {
|
||||
RegExp digitRegExp = RegExp(r'\d+');
|
||||
Iterable<Match> matches = digitRegExp.allMatches(url);
|
||||
String number = matches.first.group(0)!;
|
||||
if (url.contains('read')) {
|
||||
number = 'cv$number';
|
||||
}
|
||||
toDupNamed('/htmlRender', parameters: {
|
||||
'url': url.startsWith('//') ? url.split('//').last : url,
|
||||
'title': title ?? '',
|
||||
'id': number,
|
||||
'dynamicType': url.split('//').last.split('/')[1]
|
||||
});
|
||||
toDupNamed(
|
||||
'/articlePage',
|
||||
parameters: {
|
||||
'id': number,
|
||||
'type': url.split('//').last.split('/')[1],
|
||||
},
|
||||
);
|
||||
} else {
|
||||
handleWebview('https:$url');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user