update
Some checks failed
deploy / deploy (push) Has been cancelled

This commit is contained in:
toom1996
2026-08-22 20:47:03 +08:00
parent 0df14036cf
commit c8d9735751
20 changed files with 228 additions and 125 deletions

View File

@ -1,6 +1,7 @@
---
import Breadcrumb from "@/components/Breadcrumb.astro"
import { getBrands, getYears, type BrandEntry } from "@/lib/api"
import { clientHref, PATH } from '@/lib/routes'
import { getI18n } from '@/i18n/utils'
@ -23,7 +24,6 @@ try {
if (!yearChips.length) yearChips = yearSeed
---
<div class="showsroot w-full" x-data="showsPage()" data-locale={locale}>
@ -185,7 +185,7 @@ if (!yearChips.length) yearChips = yearSeed
<!-- Card List -->
<template x-for="it in items" :key="it.id">
<a class="showscard" :href="`/${locale}/runway-looks/${it.id}`" :aria-label="`${it.brand_name} ${it.title}`">
<a class="showscard" :href="itemHref(it)" :aria-label="`${it.brand_name} ${it.title}`">
<div class="showscard-left">
<div class="showscard-img" :class="{ 'is-loaded': it._imgLoaded }">
<span class="showsspin" aria-hidden="true" x-html="SPIN_SVG"></span>
@ -270,7 +270,6 @@ if (!yearChips.length) yearChips = yearSeed
</div>
<script id="showsbrands-data" type="application/json" set:html={JSON.stringify(sidebarBrands)}></script>
<style>
@reference "tailwindcss";
@ -585,7 +584,7 @@ if (!yearChips.length) yearChips = yearSeed
reqToken: 0,
init() {
this.locale = this.$el.dataset.locale || 'zh-cn';
this.locale = this.$el.dataset.locale || 'en';
this.loadPage(1, false)
},
@ -717,6 +716,7 @@ if (!yearChips.length) yearChips = yearSeed
if (kw) {
this.modalLetter = ""
this.modalLoading = true
this.modalResults = []
try {
this.modalResults = await getBrands({ keyword: kw, size: 60 })
} catch {
@ -809,6 +809,7 @@ if (!yearChips.length) yearChips = yearSeed
// 辅助辅助工具函数
toAbsUrl(url: string) { return toAbs(url) },
itemHref(it: { id: string | number }) { return clientHref(this.locale, PATH.runwayLooks(it.id)) },
ctLabel(ct?: string) {
const map: Record<string, string> = { rtw: "Ready-to-Wear", menswear: "Menswear", couture: "Couture", resort: "Resort", pre_fall: "Pre-Fall" }
return ct && map[ct] ? map[ct] : (ct || "")