替换讲解展厅列表预览图
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
lyf
2026-07-09 16:48:53 +08:00
parent 2c4028433f
commit 05c37db414
9 changed files with 16 additions and 16 deletions

View File

@@ -32,10 +32,10 @@
@tap="handleHallClick(hall.id)"
>
<image
v-if="hallIconUrl(hall)"
v-if="hallPreviewUrl(hall)"
class="hall-thumb"
:src="hallIconUrl(hall)"
mode="aspectFit"
:src="hallPreviewUrl(hall)"
mode="aspectFill"
/>
<view v-else class="hall-thumb placeholder">
<text class="hall-thumb-text">{{ hallIconText(hall.name) }}</text>
@@ -201,19 +201,19 @@ const emit = defineEmits<{
back: []
}>()
const HALL_ICON_BASE = '/static/icons/halls'
const HALL_PREVIEW_BASE = '/static/explain/hall-previews'
const failedUnitPreviewIds = ref(new Set<string>())
const hallIconMap: Record<string, string> = {
宇宙厅: `${HALL_ICON_BASE}/universe.jpg`,
地球厅: `${HALL_ICON_BASE}/earth.jpg`,
演化厅: `${HALL_ICON_BASE}/evolution.jpg`,
恐龙厅: `${HALL_ICON_BASE}/dinosaur.jpg`,
人类厅: `${HALL_ICON_BASE}/human.jpg`,
动物厅: `${HALL_ICON_BASE}/animal.jpg`,
生物厅: `${HALL_ICON_BASE}/biology.jpg`,
生态厅: `${HALL_ICON_BASE}/ecology.jpg`,
家园厅: `${HALL_ICON_BASE}/homeland.jpg`
const hallPreviewMap: Record<string, string> = {
宇宙厅: `${HALL_PREVIEW_BASE}/universe.webp`,
地球厅: `${HALL_PREVIEW_BASE}/earth.webp`,
演化厅: `${HALL_PREVIEW_BASE}/evolution.webp`,
恐龙厅: `${HALL_PREVIEW_BASE}/dinosaur.webp`,
人类厅: `${HALL_PREVIEW_BASE}/human.webp`,
动物厅: `${HALL_PREVIEW_BASE}/biology.webp`,
生物厅: `${HALL_PREVIEW_BASE}/biology.webp`,
生态厅: `${HALL_PREVIEW_BASE}/ecology.webp`,
家园厅: `${HALL_PREVIEW_BASE}/homeland.webp`
}
const filteredHalls = computed(() => props.halls)
@@ -243,8 +243,8 @@ const emptyDescription = computed(() => {
return '暂无可选择的展厅讲解。'
})
const hallIconUrl = (hall: ExplainHallSelectItem) => {
return hall.image || hallIconMap[hall.name.trim()] || ''
const hallPreviewUrl = (hall: ExplainHallSelectItem) => {
return hallPreviewMap[hall.name.trim()] || hall.image || ''
}
const hallIconText = (name: string) => name.trim().slice(0, 1) || '讲'

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB