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