mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-21 11:22:16 +08:00
opt sort search
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/http/search.dart';
|
||||
import 'package:PiliPlus/models/common/search/article_search_type.dart';
|
||||
import 'package:PiliPlus/models/common/search/user_search_type.dart';
|
||||
import 'package:PiliPlus/models/common/search/video_search_type.dart';
|
||||
import 'package:PiliPlus/models/common/search_type.dart';
|
||||
import 'package:PiliPlus/models/search/result.dart';
|
||||
import 'package:PiliPlus/pages/common/common_list_controller.dart';
|
||||
import 'package:PiliPlus/pages/search_result/controller.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class SearchPanelController<R extends SearchNumData<T>, T>
|
||||
@@ -19,17 +23,37 @@ class SearchPanelController<R extends SearchNumData<T>, T>
|
||||
final SearchType searchType;
|
||||
|
||||
// sort
|
||||
final RxString order = ''.obs;
|
||||
late final RxInt duration = 0.obs;
|
||||
int? tids;
|
||||
int? orderSort;
|
||||
int? userType;
|
||||
int? categoryId;
|
||||
// common
|
||||
String order = '';
|
||||
|
||||
// video
|
||||
VideoDurationType? videoDurationType; // int duration
|
||||
VideoZoneType? videoZoneType; // int? tids;
|
||||
int? pubBegin;
|
||||
int? pubEnd;
|
||||
|
||||
// article
|
||||
Rx<UserOrderType>? userOrderType;
|
||||
Rx<UserType>? userType;
|
||||
|
||||
// article
|
||||
Rx<ArticleZoneType>? articleZoneType; // int? categoryId;
|
||||
|
||||
SearchResultController? searchResultController;
|
||||
|
||||
void onSortSearch({
|
||||
bool getBack = true,
|
||||
String? label,
|
||||
}) {
|
||||
if (getBack) Get.back();
|
||||
SmartDialog.dismiss();
|
||||
if (label != null) {
|
||||
SmartDialog.showToast("「$label」的筛选结果");
|
||||
}
|
||||
SmartDialog.showLoading(msg: 'loading');
|
||||
onReload().whenComplete(SmartDialog.dismiss);
|
||||
}
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
@@ -55,12 +79,12 @@ class SearchPanelController<R extends SearchNumData<T>, T>
|
||||
searchType: searchType,
|
||||
keyword: keyword,
|
||||
page: page,
|
||||
order: order.value,
|
||||
duration: searchType == SearchType.video ? duration.value : null,
|
||||
tids: tids,
|
||||
orderSort: orderSort,
|
||||
userType: userType,
|
||||
categoryId: categoryId,
|
||||
order: order,
|
||||
duration: videoDurationType?.index,
|
||||
tids: videoZoneType?.tids,
|
||||
orderSort: userOrderType?.value.orderSort,
|
||||
userType: userType?.value.index,
|
||||
categoryId: articleZoneType?.value.categoryId,
|
||||
pubBegin: pubBegin,
|
||||
pubEnd: pubEnd,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user