优化历史包袱,修复发布页面默认0 恢哈伏笔
This commit is contained in:
@@ -17,7 +17,6 @@ import {
|
||||
import MobileHomeFilterSheet, {
|
||||
type FilterSection,
|
||||
} from "./MobileHomeFilterSheet.vue";
|
||||
import { buildFallbackListings } from "./mobileHomeFallback";
|
||||
import {
|
||||
assetRegions,
|
||||
formatHafCoinM,
|
||||
@@ -32,8 +31,6 @@ import {
|
||||
getServerRegion,
|
||||
getSkinGroup,
|
||||
hasGiftResources,
|
||||
normalizeLoginMethod,
|
||||
normalizeServerRegion,
|
||||
readAssetNumber,
|
||||
readAssetString,
|
||||
} from "./listingDisplay";
|
||||
@@ -77,12 +74,6 @@ const rangePresets: Record<string, Array<{ label: string; min: string; max: stri
|
||||
],
|
||||
};
|
||||
|
||||
const fallbackListings = computed(() => buildFallbackListings(publishOptions.value));
|
||||
|
||||
const sourceListings = computed(() =>
|
||||
loadFailed.value ? fallbackListings.value : listings.value
|
||||
);
|
||||
|
||||
const activeSortLabel = computed(
|
||||
() =>
|
||||
sortOptions.find((option) => option.key === activeSort.value)?.label ||
|
||||
@@ -92,7 +83,7 @@ const activeSortLabel = computed(
|
||||
const serverFilterOptions = computed(() =>
|
||||
uniqueOptions(
|
||||
publishOptions.value.server_options
|
||||
.map((item) => normalizeServerRegion(item))
|
||||
.map((item) => item.trim())
|
||||
.filter(Boolean)
|
||||
)
|
||||
);
|
||||
@@ -100,7 +91,7 @@ const serverFilterOptions = computed(() =>
|
||||
const loginMethodFilterOptions = computed(() =>
|
||||
uniqueOptions(
|
||||
publishOptions.value.login_method_options
|
||||
.map((item) => normalizeLoginMethod(item))
|
||||
.map((item) => item.trim())
|
||||
.filter(Boolean)
|
||||
)
|
||||
);
|
||||
@@ -145,7 +136,7 @@ const activeFilterCount = computed(() => {
|
||||
|
||||
const displayListings = computed(() => {
|
||||
const keyword = searchValue.value.trim().toLowerCase();
|
||||
const filtered = sourceListings.value.filter((item) => {
|
||||
const filtered = listings.value.filter((item) => {
|
||||
if (!matchesFilters(item)) return false;
|
||||
if (!keyword) return true;
|
||||
return searchText(item).includes(keyword);
|
||||
@@ -432,7 +423,7 @@ function uniqueOptions(values: string[]) {
|
||||
left-icon="info-o"
|
||||
color="#6b7a90"
|
||||
background="transparent"
|
||||
text="接口暂不可用,当前展示移动端示例数据。"
|
||||
text="接口暂不可用,请稍后刷新。"
|
||||
/>
|
||||
<van-empty
|
||||
v-else-if="displayListings.length === 0"
|
||||
@@ -454,8 +445,8 @@ function uniqueOptions(values: string[]) {
|
||||
>
|
||||
<div class="card-cover">
|
||||
<img
|
||||
v-if="item.screenshot_urls?.[0]"
|
||||
:src="item.screenshot_urls[0]"
|
||||
v-if="item.cover_url"
|
||||
:src="item.cover_url"
|
||||
:alt="getListingTitle(item)"
|
||||
/>
|
||||
<span v-else>图</span>
|
||||
|
||||
Reference in New Issue
Block a user