From 3d5f5597cd3e9bcf80f553fcda966f4a1b5e0410 Mon Sep 17 00:00:00 2001 From: guozhigq Date: Mon, 30 Sep 2024 11:23:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=86=E9=A2=91=E6=80=BB=E7=BB=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/models/video/ai.dart | 8 ++++---- .../video/detail/introduction/controller.dart | 4 ++-- lib/pages/video/detail/widgets/ai_detail.dart | 19 +++++++++++-------- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/lib/models/video/ai.dart b/lib/models/video/ai.dart index a06fa79d..0816c09d 100644 --- a/lib/models/video/ai.dart +++ b/lib/models/video/ai.dart @@ -39,11 +39,11 @@ class ModelResult { ModelResult.fromJson(Map json) { resultType = json['result_type']; summary = json['summary']; - outline = json['result_type'] == 2 - ? json['outline'] + outline = json['result_type'] == 0 + ? [] + : json['outline'] .map((e) => OutlineItem.fromJson(e)) - .toList() - : []; + .toList(); } } diff --git a/lib/pages/video/detail/introduction/controller.dart b/lib/pages/video/detail/introduction/controller.dart index 04a1249a..c0f6eebb 100644 --- a/lib/pages/video/detail/introduction/controller.dart +++ b/lib/pages/video/detail/introduction/controller.dart @@ -541,7 +541,7 @@ class VideoIntroController extends GetxController { // ai总结 Future aiConclusion() async { - SmartDialog.showLoading(msg: '正在生产ai总结'); + SmartDialog.showLoading(msg: '正在生成ai总结'); final res = await VideoHttp.aiConclusion( bvid: bvid, cid: lastPlayCid.value, @@ -551,7 +551,7 @@ class VideoIntroController extends GetxController { if (res['status']) { modelResult = res['data'].modelResult; } else { - SmartDialog.showToast("当前视频可能暂不支持AI视频总结"); + SmartDialog.showToast("当前视频暂不支持AI视频总结"); } return res; } diff --git a/lib/pages/video/detail/widgets/ai_detail.dart b/lib/pages/video/detail/widgets/ai_detail.dart index 37d51106..b71b026d 100644 --- a/lib/pages/video/detail/widgets/ai_detail.dart +++ b/lib/pages/video/detail/widgets/ai_detail.dart @@ -49,15 +49,18 @@ class AiDetail extends StatelessWidget { child: SingleChildScrollView( child: Column( children: [ - SelectableText( - modelResult!.summary!, - style: const TextStyle( - fontSize: 15, - fontWeight: FontWeight.bold, - height: 1.5, + if (modelResult!.resultType != 0 && + modelResult!.summary != '') ...[ + SelectableText( + modelResult!.summary!, + style: const TextStyle( + fontSize: 15, + fontWeight: FontWeight.bold, + height: 1.5, + ), ), - ), - const SizedBox(height: 20), + const SizedBox(height: 20), + ], ListView.builder( shrinkWrap: true, physics: const NeverScrollableScrollPhysics(),