首页增加比例筛选并优化排序

This commit is contained in:
yml
2026-06-18 16:18:41 +08:00
parent a0b5ed2efb
commit b7d5dbd1d3
13 changed files with 153 additions and 4 deletions
@@ -180,6 +180,8 @@ function applyRouteQueryToHomeState() {
filters.skinName = readQueryString(query, 'skin_name')
filters.minCoin = readQueryNumber(query, 'min_coin')
filters.maxCoin = readQueryNumber(query, 'max_coin')
filters.minRatio = readQueryNumber(query, 'min_ratio')
filters.maxRatio = readQueryNumber(query, 'max_ratio')
filters.minPrice = readQueryNumber(query, 'min_price')
filters.maxPrice = readQueryNumber(query, 'max_price')
filters.minDeposit = readQueryNumber(query, 'min_deposit')
@@ -224,6 +226,8 @@ function buildDesktopHomeQueryValues(): Record<string, HomeQueryValue> {
skin_name: filters.skinName,
min_coin: filters.minCoin,
max_coin: filters.maxCoin,
min_ratio: filters.minRatio,
max_ratio: filters.maxRatio,
min_price: filters.minPrice,
max_price: filters.maxPrice,
min_deposit: filters.minDeposit,
@@ -111,6 +111,12 @@ const rangePresets: Record<string, Array<{ label: string; min: string; max: stri
{ label: '300-500', min: '300', max: '500' },
{ label: '500以上', min: '500', max: '' },
],
ratio: [
{ label: '0-20', min: '0', max: '20' },
{ label: '20-30', min: '20', max: '30' },
{ label: '30-40', min: '30', max: '40' },
{ label: '40以上', min: '40', max: '' },
],
deposit: [
{ label: '0-50', min: '0', max: '50' },
{ label: '50-100', min: '50', max: '100' },
@@ -191,6 +197,14 @@ const filterSections = computed<FilterSection[]>(() => [
minPlaceholder: '最低',
maxPlaceholder: '最高',
},
{
key: 'ratio',
title: '比例',
type: 'range',
unit: 'w/元',
minPlaceholder: '最低比例',
maxPlaceholder: '最高比例',
},
{ key: 'server', title: '区服', type: 'chips', options: serverFilterOptions.value },
{ key: 'region', title: '资产地区', type: 'chips', options: regionFilterOptions.value },
{ key: 'login', title: '上号方式', type: 'chips', options: loginMethodFilterOptions.value },
@@ -436,6 +450,9 @@ function buildListingQuery(page: number): PublicListingQuery {
} else if (key === 'coin') {
query.min_coin = min
query.max_coin = max
} else if (key === 'ratio') {
query.min_ratio = min
query.max_ratio = max
} else if (key === 'secretKd') {
query.min_secret_kd = min
query.max_secret_kd = max