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, setKey: SettingBoxKey.enableSaveLastData,
defaultVal: false, defaultVal: false,
), ),
const SetSwitchItem(
title: '启用ai总结',
subTitle: '视频详情页开启ai总结',
setKey: SettingBoxKey.enableAi,
defaultVal: true,
),
ListTile( ListTile(
dense: false, dense: false,
title: Text('评论展示', style: titleStyle), title: Text('评论展示', style: titleStyle),

View File

@ -568,14 +568,8 @@ class VideoIntroController extends GetxController {
upMid: videoDetail.value.owner!.mid!, upMid: videoDetail.value.owner!.mid!,
); );
if (res['status']) { 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(); SmartDialog.dismiss();
return res; return res;
} }

View File

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

View File

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