Merge branch 'fix'

This commit is contained in:
guozhigq
2024-09-30 13:35:34 +08:00
7 changed files with 39 additions and 25 deletions

View File

@ -39,11 +39,11 @@ class ModelResult {
ModelResult.fromJson(Map<String, dynamic> json) { ModelResult.fromJson(Map<String, dynamic> json) {
resultType = json['result_type']; resultType = json['result_type'];
summary = json['summary']; summary = json['summary'];
outline = json['result_type'] == 2 outline = json['result_type'] == 0
? json['outline'] ? <OutlineItem>[]
: json['outline']
.map<OutlineItem>((e) => OutlineItem.fromJson(e)) .map<OutlineItem>((e) => OutlineItem.fromJson(e))
.toList() .toList();
: <OutlineItem>[];
} }
} }

View File

@ -61,7 +61,7 @@ class _BlackListPageState extends State<BlackListPage> {
centerTitle: false, centerTitle: false,
title: Obx( title: Obx(
() => Text( () => Text(
'黑名单管理 - ${_blackListController.total.value}', '黑名单管理 ${_blackListController.total.value == 0 ? '' : '- ${_blackListController.total.value}'}',
style: Theme.of(context).textTheme.titleMedium, style: Theme.of(context).textTheme.titleMedium,
), ),
), ),
@ -76,8 +76,12 @@ class _BlackListPageState extends State<BlackListPage> {
if (data['status']) { if (data['status']) {
List<BlackListItem> list = _blackListController.blackList; List<BlackListItem> list = _blackListController.blackList;
return Obx( return Obx(
() => list.length == 1 () => list.isEmpty
? const SizedBox() ? CustomScrollView(
slivers: [
HttpError(errMsg: '你没有拉黑任何人哦_', fn: () => {})
],
)
: ListView.builder( : ListView.builder(
controller: scrollController, controller: scrollController,
itemCount: list.length, itemCount: list.length,

View File

@ -49,7 +49,6 @@ class FansController extends GetxController {
} else if (type == 'onLoad') { } else if (type == 'onLoad') {
fansList.addAll(res['data'].list); fansList.addAll(res['data'].list);
} }
print(total);
if ((pn == 1 && total < ps) || res['data'].list.isEmpty) { if ((pn == 1 && total < ps) || res['data'].list.isEmpty) {
loadingText.value = '没有更多了'; loadingText.value = '没有更多了';
} }

View File

@ -103,9 +103,17 @@ class _FansPageState extends State<FansPage> {
), ),
); );
} else { } else {
return HttpError( return CustomScrollView(
errMsg: data['msg'], physics: const NeverScrollableScrollPhysics(),
fn: () => _fansController.queryFans('init'), slivers: [
HttpError(
errMsg: data['msg'],
fn: () {
_futureBuilderFuture =
_fansController.queryFans('init');
},
)
],
); );
} }
} else { } else {

View File

@ -115,7 +115,7 @@ class VideoDetailController extends GetxController
].obs; ].obs;
RxDouble sheetHeight = 0.0.obs; RxDouble sheetHeight = 0.0.obs;
RxString archiveSourceType = 'dash'.obs; RxString archiveSourceType = 'dash'.obs;
ScrollController? replyScrillController; ScrollController? replyScrollController;
List<MediaVideoItemModel> mediaList = <MediaVideoItemModel>[]; List<MediaVideoItemModel> mediaList = <MediaVideoItemModel>[];
RxBool isWatchLaterVisible = false.obs; RxBool isWatchLaterVisible = false.obs;
RxString watchLaterTitle = ''.obs; RxString watchLaterTitle = ''.obs;
@ -574,12 +574,12 @@ class VideoDetailController extends GetxController
} }
void onControllerCreated(ScrollController controller) { void onControllerCreated(ScrollController controller) {
replyScrillController = controller; replyScrollController = controller;
} }
void onTapTabbar(int index) { void onTapTabbar(int index) {
if (index == 1 && tabCtr.index == 1) { if (tabCtr.animation!.isCompleted && index == 1 && tabCtr.index == 1) {
replyScrillController?.animateTo(0, replyScrollController?.animateTo(0,
duration: const Duration(milliseconds: 300), curve: Curves.ease); duration: const Duration(milliseconds: 300), curve: Curves.ease);
} }
} }

View File

@ -541,7 +541,7 @@ class VideoIntroController extends GetxController {
// ai总结 // ai总结
Future aiConclusion() async { Future aiConclusion() async {
SmartDialog.showLoading(msg: '正在生ai总结'); SmartDialog.showLoading(msg: '正在生ai总结');
final res = await VideoHttp.aiConclusion( final res = await VideoHttp.aiConclusion(
bvid: bvid, bvid: bvid,
cid: lastPlayCid.value, cid: lastPlayCid.value,
@ -551,7 +551,7 @@ class VideoIntroController extends GetxController {
if (res['status']) { if (res['status']) {
modelResult = res['data'].modelResult; modelResult = res['data'].modelResult;
} else { } else {
SmartDialog.showToast("当前视频可能暂不支持AI视频总结"); SmartDialog.showToast("当前视频暂不支持AI视频总结");
} }
return res; return res;
} }

View File

@ -49,15 +49,18 @@ class AiDetail extends StatelessWidget {
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
children: [ children: [
SelectableText( if (modelResult!.resultType != 0 &&
modelResult!.summary!, modelResult!.summary != '') ...[
style: const TextStyle( SelectableText(
fontSize: 15, modelResult!.summary!,
fontWeight: FontWeight.bold, style: const TextStyle(
height: 1.5, fontSize: 15,
fontWeight: FontWeight.bold,
height: 1.5,
),
), ),
), const SizedBox(height: 20),
const SizedBox(height: 20), ],
ListView.builder( ListView.builder(
shrinkWrap: true, shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),