From 4aaaffbcea36efd20ff3899deebb1f095f98b63f Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Fri, 4 Apr 2025 23:40:05 +0800 Subject: [PATCH] fix: dyn comment type Signed-off-by: bggRGjQaUbCoE --- lib/http/html.dart | 7 ++++--- lib/pages/dynamics/detail/controller.dart | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/http/html.dart b/lib/http/html.dart index 3614faf49..dc7055e11 100644 --- a/lib/http/html.dart +++ b/lib/http/html.dart @@ -64,11 +64,11 @@ class HtmlHttp { .innerHtml; } catch (_) {} - String commentId = opusDetail + List comment = opusDetail .querySelector('.bili-comment-container')! .className .split(' ')[1] - .split('-')[2]; + .split('-'); // List imgList = opusDetail.querySelectorAll('bili-album__preview__picture__img'); return { 'status': true, @@ -76,7 +76,8 @@ class HtmlHttp { 'uname': uname, 'updateTime': updateTime, 'content': (test ?? '') + opusContent, - 'commentId': int.parse(commentId) + 'commentType': int.parse(comment[1]), + 'commentId': int.parse(comment[2]), }; } catch (err) { debugPrint('err: $err'); diff --git a/lib/pages/dynamics/detail/controller.dart b/lib/pages/dynamics/detail/controller.dart index 83bd9b068..a043b41a8 100644 --- a/lib/pages/dynamics/detail/controller.dart +++ b/lib/pages/dynamics/detail/controller.dart @@ -41,6 +41,7 @@ class DynamicDetailController extends ReplyController { // 根据jumpUrl获取动态html reqHtmlByOpusId(int id) async { var res = await HtmlHttp.reqHtml(id, 'opus'); + type = res['commentType']; oid = res['commentId']; queryData(); }