mirror of
https://github.com/wgh136/pixes.git
synced 2025-09-27 04:57:23 +00:00
search popular
This commit is contained in:
@@ -259,26 +259,43 @@ enum FavoriteNumber {
|
||||
enum SearchSort {
|
||||
newToOld,
|
||||
oldToNew,
|
||||
popular;
|
||||
popular,
|
||||
popularMale,
|
||||
popularFemale;
|
||||
|
||||
bool get isPremium => appdata.account?.user.isPremium == true;
|
||||
|
||||
static List<SearchSort> get availableValues => [
|
||||
SearchSort.newToOld,
|
||||
SearchSort.oldToNew,
|
||||
SearchSort.popular,
|
||||
if(appdata.account?.user.isPremium == true)
|
||||
SearchSort.popularMale,
|
||||
if(appdata.account?.user.isPremium == true)
|
||||
SearchSort.popularFemale
|
||||
];
|
||||
|
||||
@override
|
||||
toString() {
|
||||
if(this == SearchSort.popular) {
|
||||
return isPremium ? "Popular" : "Popular(limited)";
|
||||
} else if(this == SearchSort.newToOld) {
|
||||
return "New to old";
|
||||
} else {
|
||||
} else if(this == SearchSort.oldToNew){
|
||||
return "Old to new";
|
||||
} else if(this == SearchSort.popularMale){
|
||||
return "Popular(Male)";
|
||||
} else {
|
||||
return "Popular(Female)";
|
||||
}
|
||||
}
|
||||
|
||||
String toParam() => switch(this) {
|
||||
SearchSort.newToOld => "date_desc",
|
||||
SearchSort.oldToNew => "date_asc",
|
||||
// TODO: 等我开个会员
|
||||
SearchSort.popular => "",
|
||||
SearchSort.popular => "popular_desc",
|
||||
SearchSort.popularMale => "popular_male_desc",
|
||||
SearchSort.popularFemale => "popular_female_desc",
|
||||
};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user