mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-24 11:06:51 +08:00
opt queryBySort
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -12,7 +12,6 @@ import 'package:PiliPlus/utils/reply_utils.dart';
|
||||
import 'package:PiliPlus/utils/request_utils.dart';
|
||||
import 'package:PiliPlus/utils/storage_pref.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:easy_debounce/easy_throttle.dart';
|
||||
import 'package:fixnum/fixnum.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
@@ -87,20 +86,19 @@ abstract class ReplyController<R> extends CommonListController<R, ReplyInfo> {
|
||||
|
||||
// 排序搜索评论
|
||||
void queryBySort() {
|
||||
EasyThrottle.throttle('queryBySort', const Duration(seconds: 1), () {
|
||||
feedBack();
|
||||
switch (sortType.value) {
|
||||
case ReplySortType.time:
|
||||
sortType.value = ReplySortType.hot;
|
||||
mode.value = Mode.MAIN_LIST_HOT;
|
||||
break;
|
||||
case ReplySortType.hot:
|
||||
sortType.value = ReplySortType.time;
|
||||
mode.value = Mode.MAIN_LIST_TIME;
|
||||
break;
|
||||
}
|
||||
onReload();
|
||||
});
|
||||
if (isLoading) return;
|
||||
feedBack();
|
||||
switch (sortType.value) {
|
||||
case ReplySortType.time:
|
||||
sortType.value = ReplySortType.hot;
|
||||
mode.value = Mode.MAIN_LIST_HOT;
|
||||
break;
|
||||
case ReplySortType.hot:
|
||||
sortType.value = ReplySortType.time;
|
||||
mode.value = Mode.MAIN_LIST_TIME;
|
||||
break;
|
||||
}
|
||||
onReload();
|
||||
}
|
||||
|
||||
(bool inputDisable, String? hint) get replyHint {
|
||||
|
||||
@@ -135,6 +135,7 @@ class MemberVideoCtr
|
||||
);
|
||||
|
||||
void queryBySort() {
|
||||
if (isLoading) return;
|
||||
if (type == ContributeType.video) {
|
||||
isLocating.value = false;
|
||||
order.value = order.value == 'pubdate' ? 'click' : 'pubdate';
|
||||
|
||||
@@ -117,6 +117,7 @@ class PgcReviewController
|
||||
}
|
||||
|
||||
void queryBySort() {
|
||||
if (isLoading) return;
|
||||
sortType.value = sortType.value == PgcReviewSortType.def
|
||||
? PgcReviewSortType.latest
|
||||
: PgcReviewSortType.def;
|
||||
|
||||
@@ -126,6 +126,7 @@ class HorizontalMemberPageController
|
||||
}
|
||||
|
||||
void queryBySort() {
|
||||
if (isLoading) return;
|
||||
order.value = order.value == 'pubdate' ? 'click' : 'pubdate';
|
||||
onReload();
|
||||
}
|
||||
|
||||
@@ -141,6 +141,7 @@ class VideoReplyReplyController extends ReplyController
|
||||
|
||||
@override
|
||||
void queryBySort() {
|
||||
if (isLoading) return;
|
||||
mode.value = mode.value == Mode.MAIN_LIST_HOT
|
||||
? Mode.MAIN_LIST_TIME
|
||||
: Mode.MAIN_LIST_HOT;
|
||||
|
||||
Reference in New Issue
Block a user