mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-24 02:56:58 +08:00
@@ -806,14 +806,20 @@ class VideoHttp {
|
|||||||
'up_mid': upMid,
|
'up_mid': upMid,
|
||||||
});
|
});
|
||||||
var res = await Request().get(Api.aiConclusion, queryParameters: params);
|
var res = await Request().get(Api.aiConclusion, queryParameters: params);
|
||||||
if (res.data['code'] == 0 && res.data['data']['code'] == 0) {
|
final code = res.data['code'];
|
||||||
|
final dataCode = res.data['data']?['code'];
|
||||||
|
if (code == 0 && dataCode == 0) {
|
||||||
return {
|
return {
|
||||||
'status': true,
|
'status': true,
|
||||||
'data': AiConclusionData.fromJson(res.data['data']),
|
'data': AiConclusionData.fromJson(res.data['data']),
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
final handling = res.data['code'] == 0 && res.data['data']['code'] == 1;
|
final handling = code == 0 && dataCode == 1;
|
||||||
return {'status': false, 'msg': res.data['message'], 'handling': handling};
|
return {
|
||||||
|
'status': false,
|
||||||
|
'msg': res.data['message'],
|
||||||
|
'handling': handling,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ import 'package:PiliPlus/pages/video/related/controller.dart';
|
|||||||
import 'package:PiliPlus/pages/video/reply/controller.dart';
|
import 'package:PiliPlus/pages/video/reply/controller.dart';
|
||||||
import 'package:PiliPlus/plugin/pl_player/models/play_repeat.dart';
|
import 'package:PiliPlus/plugin/pl_player/models/play_repeat.dart';
|
||||||
import 'package:PiliPlus/services/service_locator.dart';
|
import 'package:PiliPlus/services/service_locator.dart';
|
||||||
|
import 'package:PiliPlus/utils/accounts.dart';
|
||||||
import 'package:PiliPlus/utils/context_ext.dart';
|
import 'package:PiliPlus/utils/context_ext.dart';
|
||||||
import 'package:PiliPlus/utils/extension.dart';
|
import 'package:PiliPlus/utils/extension.dart';
|
||||||
import 'package:PiliPlus/utils/feed_back.dart';
|
import 'package:PiliPlus/utils/feed_back.dart';
|
||||||
@@ -744,6 +745,10 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
|
|||||||
|
|
||||||
// ai总结
|
// ai总结
|
||||||
Future aiConclusion() async {
|
Future aiConclusion() async {
|
||||||
|
if (!Accounts.heartbeat.isLogin) {
|
||||||
|
SmartDialog.showToast("账号未登录");
|
||||||
|
return;
|
||||||
|
}
|
||||||
SmartDialog.showLoading(msg: '正在获取AI总结');
|
SmartDialog.showLoading(msg: '正在获取AI总结');
|
||||||
final res = await VideoHttp.aiConclusion(
|
final res = await VideoHttp.aiConclusion(
|
||||||
bvid: bvid,
|
bvid: bvid,
|
||||||
|
|||||||
@@ -890,30 +890,28 @@ class _UgcIntroPanelState extends TripleState<UgcIntroPanel>
|
|||||||
);
|
);
|
||||||
|
|
||||||
Widget get _aiBtn => Positioned(
|
Widget get _aiBtn => Positioned(
|
||||||
right: 10,
|
right: 8,
|
||||||
top: 0,
|
|
||||||
bottom: 0,
|
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Semantics(
|
|
||||||
label: 'AI总结',
|
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
|
behavior: HitTestBehavior.opaque,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
if (introController.aiConclusionResult == null) {
|
if (introController.aiConclusionResult == null) {
|
||||||
await introController.aiConclusion();
|
await introController.aiConclusion();
|
||||||
}
|
}
|
||||||
if (introController.aiConclusionResult == null) {
|
if (introController.aiConclusionResult case final res?) {
|
||||||
return;
|
if (res.summary?.isNotEmpty == true ||
|
||||||
}
|
res.outline?.isNotEmpty == true) {
|
||||||
if (introController.aiConclusionResult!.summary?.isNotEmpty ==
|
|
||||||
true ||
|
|
||||||
introController.aiConclusionResult!.outline?.isNotEmpty ==
|
|
||||||
true) {
|
|
||||||
widget.showAiBottomSheet();
|
widget.showAiBottomSheet();
|
||||||
} else {
|
} else {
|
||||||
SmartDialog.showToast("当前视频不支持AI视频总结");
|
SmartDialog.showToast("当前视频不支持AI视频总结");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
child: Image.asset('assets/images/ai.png', height: 22),
|
child: Image.asset(
|
||||||
|
semanticLabel: 'AI总结',
|
||||||
|
'assets/images/ai.png',
|
||||||
|
height: 18,
|
||||||
|
width: 18,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user