From 91ad0fa03dc44ddc3694367b8902db0be34003b0 Mon Sep 17 00:00:00 2001 From: guozhigq Date: Wed, 1 May 2024 20:22:52 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E6=9F=A5=E7=9C=8B=E8=AF=84=E8=AE=BA?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E7=82=B9=E5=87=BB=E5=8C=BA=E5=9F=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/video/detail/reply/widgets/reply_item.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pages/video/detail/reply/widgets/reply_item.dart b/lib/pages/video/detail/reply/widgets/reply_item.dart index 468d2541..ef4cd15c 100644 --- a/lib/pages/video/detail/reply/widgets/reply_item.dart +++ b/lib/pages/video/detail/reply/widgets/reply_item.dart @@ -44,7 +44,7 @@ class ReplyItem extends StatelessWidget { onTap: () { feedBack(); if (replyReply != null) { - replyReply!(replyItem, null); + replyReply!(replyItem); } }, onLongPress: () { @@ -358,7 +358,7 @@ class ReplyItemRow extends StatelessWidget { InkWell( // 一楼点击评论展开评论详情 // onTap: () { - // replyReply?.call(replyItem, replies![i]); + // replyReply?.call(replyItem); // }, onLongPress: () { feedBack(); From 291312bde70df30258692759fcb31ed030f0b133 Mon Sep 17 00:00:00 2001 From: guozhigq Date: Wed, 1 May 2024 20:44:38 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E8=AF=84=E8=AE=BA=E5=8C=BA=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E8=A7=86=E9=A2=91=E9=A1=B5pic=20null?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/http/search.dart | 16 ++++++++++++++++ lib/pages/video/detail/controller.dart | 2 +- lib/utils/url_utils.dart | 6 ++++-- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/lib/http/search.dart b/lib/http/search.dart index 18481ea8..cf1a1b49 100644 --- a/lib/http/search.dart +++ b/lib/http/search.dart @@ -163,4 +163,20 @@ class SearchHttp { }; } } + + static Future> ab2cWithPic( + {int? aid, String? bvid}) async { + Map data = {}; + if (aid != null) { + data['aid'] = aid; + } else if (bvid != null) { + data['bvid'] = bvid; + } + final dynamic res = + await Request().get(Api.ab2c, data: {...data}); + return { + 'cid': res.data['data'].first['cid'], + 'pic': res.data['data'].first['first_frame'], + }; + } } diff --git a/lib/pages/video/detail/controller.dart b/lib/pages/video/detail/controller.dart index 6dd6425f..f7f9e848 100644 --- a/lib/pages/video/detail/controller.dart +++ b/lib/pages/video/detail/controller.dart @@ -547,7 +547,7 @@ class VideoDetailController extends GetxController } void updateCover(String? pic) { - if (pic != null && pic != '') { + if (pic != null) { cover.value = videoItem['pic'] = pic; } } diff --git a/lib/utils/url_utils.dart b/lib/utils/url_utils.dart index cf0ef9e2..20f9cb0d 100644 --- a/lib/utils/url_utils.dart +++ b/lib/utils/url_utils.dart @@ -42,12 +42,14 @@ class UrlUtils { final Map matchRes = IdUtils.matchAvorBv(input: pathSegment); if (matchRes.containsKey('BV')) { final String bv = matchRes['BV']; - final int cid = await SearchHttp.ab2c(bvid: bv); + final Map res = await SearchHttp.ab2cWithPic(bvid: bv); + final int cid = res['cid']; + final String pic = res['pic']; final String heroTag = Utils.makeHeroTag(bv); await Get.toNamed( '/video?bvid=$bv&cid=$cid', arguments: { - 'pic': '', + 'pic': pic, 'heroTag': heroTag, }, );