增加awm数量

This commit is contained in:
yml
2026-06-02 08:49:27 +08:00
parent 4509b22af7
commit a094901b72
3 changed files with 145 additions and 32 deletions
@@ -59,6 +59,7 @@ const supportLoading = ref(false);
const sortOptions = [
{ key: "comprehensive", label: "综合排序" },
{ key: "published", label: "发布时间" },
{ key: "awmDesc", label: "AWM数量" },
{ key: "priceAsc", label: "价格最低" },
{ key: "priceDesc", label: "价格最高" },
];
@@ -251,6 +252,13 @@ function sortListings(items: Listing[]) {
(a, b) => getListingDisplayPrice(b) - getListingDisplayPrice(a)
);
}
if (activeSort.value === "awmDesc") {
return sorted.sort(
(a, b) =>
getResourceQuantity(b, "awmAmmo") - getResourceQuantity(a, "awmAmmo") ||
getCoinWan(b) - getCoinWan(a)
);
}
return sorted.sort((a, b) => {
const bTime = Date.parse(b.published_at || b.created_at || "") || 0;
const aTime = Date.parse(a.published_at || a.created_at || "") || 0;