Merge branch 'fix'

This commit is contained in:
guozhigq
2023-12-02 23:11:40 +08:00
4 changed files with 24 additions and 22 deletions

View File

@ -169,6 +169,12 @@ class _ExtraSettingState extends State<ExtraSetting> {
setKey: SettingBoxKey.enableSaveLastData,
defaultVal: false,
),
const SetSwitchItem(
title: '启用ai总结',
subTitle: '视频详情页开启ai总结',
setKey: SettingBoxKey.enableAi,
defaultVal: true,
),
ListTile(
dense: false,
title: Text('评论展示', style: titleStyle),

View File

@ -568,13 +568,7 @@ class VideoIntroController extends GetxController {
upMid: videoDetail.value.owner!.mid!,
);
if (res['status']) {
if (res['data'].modelResult.resultType == 0) {
SmartDialog.showToast('该视频不支持ai总结');
}
if (res['data'].modelResult.resultType == 2 ||
res['data'].modelResult.resultType == 1) {
modelResult = res['data'].modelResult;
}
modelResult = res['data'].modelResult;
}
SmartDialog.dismiss();
return res;

View File

@ -134,6 +134,7 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
late final dynamic followStatus;
late int mid;
late String memberHeroTag;
late bool enableAi;
@override
void initState() {
@ -150,6 +151,7 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
? '-'
: Utils.numFormat(videoIntroController.userStat['follower']);
followStatus = videoIntroController.followStatus;
enableAi = setting.get(SettingBoxKey.enableAi, defaultValue: true);
}
// 收藏
@ -317,23 +319,22 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
),
),
),
Positioned(
right: 10,
top: 6,
child: GestureDetector(
onTap: () async {
var res = await videoIntroController.aiConclusion();
if (res['status']) {
if (res['data'].modelResult.resultType == 2 ||
res['data'].modelResult.resultType == 1) {
if (enableAi)
Positioned(
right: 10,
top: 6,
child: GestureDetector(
onTap: () async {
var res =
await videoIntroController.aiConclusion();
if (res['status']) {
showAiBottomSheet();
}
}
},
child:
Image.asset('assets/images/ai.png', height: 22),
),
)
},
child:
Image.asset('assets/images/ai.png', height: 22),
),
)
],
),
// 点赞收藏转发 布局样式1

View File

@ -127,6 +127,7 @@ class SettingBoxKey {
static const String enableRcmdDynamic = 'enableRcmdDynamic';
static const String enableSaveLastData = 'enableSaveLastData';
static const String enableSystemProxy = 'enableSystemProxy';
static const String enableAi = 'enableAi';
/// 外观
static const String themeMode = 'themeMode';