From 16847b8a92c3d41bd727439989b2fe62a2ef73ed Mon Sep 17 00:00:00 2001 From: guozhigq Date: Mon, 7 Oct 2024 22:39:48 +0800 Subject: [PATCH 1/2] =?UTF-8?q?mod:=20=E8=AF=84=E8=AE=BA=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?cv?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../video/detail/reply/widgets/reply_item.dart | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/pages/video/detail/reply/widgets/reply_item.dart b/lib/pages/video/detail/reply/widgets/reply_item.dart index 26dc2e5a..2ba97a20 100644 --- a/lib/pages/video/detail/reply/widgets/reply_item.dart +++ b/lib/pages/video/detail/reply/widgets/reply_item.dart @@ -727,14 +727,11 @@ InlineSpan buildContent( '', ); } else if (RegExp(r'^cv\d+$').hasMatch(matchStr)) { - Get.toNamed( - '/webview', - parameters: { - 'url': 'https://www.bilibili.com/read/$matchStr', - 'type': 'url', - 'pageTitle': title - }, - ); + Get.toNamed('/read', parameters: { + 'title': title, + 'id': Utils.matchNum(matchStr).first.toString(), + 'articleType': 'read', + }); } else { Uri uri = Uri.parse(matchStr.replaceAll('/?', '?')); SchemeEntity scheme = SchemeEntity( From a366f5d3ce06552632a28f3a4f296a7a43039793 Mon Sep 17 00:00:00 2001 From: guozhigq Date: Mon, 7 Oct 2024 22:51:02 +0800 Subject: [PATCH 2/2] =?UTF-8?q?opt:=20=E4=B8=93=E6=A0=8F=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E5=8F=AF=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/opus/view.dart | 2 +- lib/pages/read/controller.dart | 2 +- lib/pages/read/view.dart | 11 ++++++----- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/pages/opus/view.dart b/lib/pages/opus/view.dart index 434a9405..42c0c419 100644 --- a/lib/pages/opus/view.dart +++ b/lib/pages/opus/view.dart @@ -157,7 +157,7 @@ class _OpusPageState extends State { Container( alignment: TextHelper.getAlignment(paragraph.align), margin: const EdgeInsets.only(bottom: 10), - child: Text.rich( + child: SelectableText.rich( TextSpan( children: paragraph.text?.nodes?.map((node) { return TextHelper.buildTextSpan( diff --git a/lib/pages/read/controller.dart b/lib/pages/read/controller.dart index efa43c98..ac81aca8 100644 --- a/lib/pages/read/controller.dart +++ b/lib/pages/read/controller.dart @@ -21,7 +21,7 @@ class ReadPageController extends GetxController { super.onInit(); title.value = Get.parameters['title'] ?? ''; id = Get.parameters['id']!; - articleType = Get.parameters['articleType']!; + articleType = Get.parameters['articleType'] ?? 'read'; url = 'https://www.bilibili.com/read/cv$id'; scrollController.addListener(_scrollListener); fetchViewInfo(); diff --git a/lib/pages/read/view.dart b/lib/pages/read/view.dart index d37eeae5..710934eb 100644 --- a/lib/pages/read/view.dart +++ b/lib/pages/read/view.dart @@ -126,7 +126,6 @@ class _ReadPageState extends State { Widget _buildContent(ReadDataModel cvData) { final List picList = _extractPicList(cvData); final List imgList = extractDataSrc(cvData.readInfo!.content!); - return Padding( padding: EdgeInsets.fromLTRB( 16, 0, 16, MediaQuery.of(context).padding.bottom + 40), @@ -163,9 +162,11 @@ class _ReadPageState extends State { padding: const EdgeInsets.only(bottom: 20), child: _buildAuthorWidget(cvData), ), - HtmlRender( - htmlContent: cvData.readInfo!.content!, - imgList: imgList, + SelectionArea( + child: HtmlRender( + htmlContent: cvData.readInfo!.content!, + imgList: imgList, + ), ), ], ); @@ -206,7 +207,7 @@ class _ReadPageState extends State { return Container( alignment: TextHelper.getAlignment(paragraph.align), margin: const EdgeInsets.only(bottom: 10), - child: Text.rich( + child: SelectableText.rich( TextSpan( children: paragraph.text?.nodes?.map((node) { return TextHelper.buildTextSpan(node, paragraph.align, context);