Merge branch 'fix' into alpha
This commit is contained in:
@ -70,6 +70,7 @@ class _SeasonPanelState extends State<SeasonPanel> {
|
|||||||
currentIndex = i;
|
currentIndex = i;
|
||||||
setState(() {});
|
setState(() {});
|
||||||
Get.back();
|
Get.back();
|
||||||
|
setState(() {});
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -11,6 +11,7 @@ import 'package:pilipala/pages/preview/index.dart';
|
|||||||
import 'package:pilipala/pages/video/detail/index.dart';
|
import 'package:pilipala/pages/video/detail/index.dart';
|
||||||
import 'package:pilipala/pages/video/detail/replyNew/index.dart';
|
import 'package:pilipala/pages/video/detail/replyNew/index.dart';
|
||||||
import 'package:pilipala/utils/feed_back.dart';
|
import 'package:pilipala/utils/feed_back.dart';
|
||||||
|
import 'package:pilipala/utils/id_utils.dart';
|
||||||
import 'package:pilipala/utils/storage.dart';
|
import 'package:pilipala/utils/storage.dart';
|
||||||
import 'package:pilipala/utils/utils.dart';
|
import 'package:pilipala/utils/utils.dart';
|
||||||
|
|
||||||
@ -667,10 +668,11 @@ InlineSpan buildContent(
|
|||||||
// 匹配 jumpUrl
|
// 匹配 jumpUrl
|
||||||
String matchUrl = matchMember;
|
String matchUrl = matchMember;
|
||||||
if (content.jumpUrl.isNotEmpty && hasMatchMember) {
|
if (content.jumpUrl.isNotEmpty && hasMatchMember) {
|
||||||
List urlKeys = content.jumpUrl.keys.toList();
|
List urlKeys = content.jumpUrl.keys.toList().reversed.toList();
|
||||||
matchUrl = matchMember.splitMapJoin(
|
matchUrl = matchMember.splitMapJoin(
|
||||||
/// RegExp.escape() 转义特殊字符
|
/// RegExp.escape() 转义特殊字符
|
||||||
RegExp(RegExp.escape(urlKeys.join("|"))),
|
RegExp(urlKeys.map((key) => key).join("|")),
|
||||||
|
// RegExp(RegExp.escape(urlKeys.join("|"))),
|
||||||
onMatch: (Match match) {
|
onMatch: (Match match) {
|
||||||
String matchStr = match[0]!;
|
String matchStr = match[0]!;
|
||||||
String appUrlSchema = content.jumpUrl[matchStr]['app_url_schema'];
|
String appUrlSchema = content.jumpUrl[matchStr]['app_url_schema'];
|
||||||
@ -688,14 +690,26 @@ InlineSpan buildContent(
|
|||||||
recognizer: TapGestureRecognizer()
|
recognizer: TapGestureRecognizer()
|
||||||
..onTap = () {
|
..onTap = () {
|
||||||
if (appUrlSchema == '') {
|
if (appUrlSchema == '') {
|
||||||
Get.toNamed(
|
String str = Uri.parse(matchStr).pathSegments[0];
|
||||||
'/webview',
|
Map matchRes = IdUtils.matchAvorBv(input: str);
|
||||||
parameters: {
|
List matchKeys = matchRes.keys.toList();
|
||||||
'url': matchStr,
|
if (matchKeys.isNotEmpty) {
|
||||||
'type': 'url',
|
if (matchKeys.first == 'BV') {
|
||||||
'pageTitle': ''
|
Get.toNamed(
|
||||||
},
|
'/searchResult',
|
||||||
);
|
parameters: {'keyword': matchRes['BV']},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Get.toNamed(
|
||||||
|
'/webview',
|
||||||
|
parameters: {
|
||||||
|
'url': matchStr,
|
||||||
|
'type': 'url',
|
||||||
|
'pageTitle': ''
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (appUrlSchema.startsWith('bilibili://search') &&
|
if (appUrlSchema.startsWith('bilibili://search') &&
|
||||||
enableWordRe) {
|
enableWordRe) {
|
||||||
|
@ -11,6 +11,7 @@ import 'package:pilipala/pages/home/index.dart';
|
|||||||
import 'package:pilipala/pages/media/index.dart';
|
import 'package:pilipala/pages/media/index.dart';
|
||||||
import 'package:pilipala/utils/cookie.dart';
|
import 'package:pilipala/utils/cookie.dart';
|
||||||
import 'package:pilipala/utils/event_bus.dart';
|
import 'package:pilipala/utils/event_bus.dart';
|
||||||
|
import 'package:pilipala/utils/id_utils.dart';
|
||||||
import 'package:pilipala/utils/login.dart';
|
import 'package:pilipala/utils/login.dart';
|
||||||
import 'package:pilipala/utils/storage.dart';
|
import 'package:pilipala/utils/storage.dart';
|
||||||
import 'package:webview_flutter/webview_flutter.dart';
|
import 'package:webview_flutter/webview_flutter.dart';
|
||||||
@ -50,7 +51,19 @@ class WebviewController extends GetxController {
|
|||||||
// Update loading bar.
|
// Update loading bar.
|
||||||
loadProgress.value = progress;
|
loadProgress.value = progress;
|
||||||
},
|
},
|
||||||
onPageStarted: (String url) {},
|
onPageStarted: (String url) {
|
||||||
|
String str = Uri.parse(url).pathSegments[0];
|
||||||
|
Map matchRes = IdUtils.matchAvorBv(input: str);
|
||||||
|
List matchKeys = matchRes.keys.toList();
|
||||||
|
if (matchKeys.isNotEmpty) {
|
||||||
|
if (matchKeys.first == 'BV') {
|
||||||
|
Get.offAndToNamed(
|
||||||
|
'/searchResult',
|
||||||
|
parameters: {'keyword': matchRes['BV']},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
// 加载完成
|
// 加载完成
|
||||||
onUrlChange: (UrlChange urlChange) async {
|
onUrlChange: (UrlChange urlChange) async {
|
||||||
loadShow.value = false;
|
loadShow.value = false;
|
||||||
|
@ -19,6 +19,10 @@ class Em {
|
|||||||
return regCate(matchStr);
|
return regCate(matchStr);
|
||||||
}, onNonMatch: (String str) {
|
}, onNonMatch: (String str) {
|
||||||
if (str != '') {
|
if (str != '') {
|
||||||
|
str = str
|
||||||
|
.replaceAll('>', '>')
|
||||||
|
.replaceAll('"', '"')
|
||||||
|
.replaceAll(''', "'");
|
||||||
Map map = {'type': 'text', 'text': str};
|
Map map = {'type': 'text', 'text': str};
|
||||||
res.add(map);
|
res.add(map);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user