perf(listings): 优化详情页图片加载链路支持公开变体与分级秒开
This commit is contained in:
@@ -40,6 +40,9 @@ import {
|
||||
readAssetString,
|
||||
getRatioValue,
|
||||
isTopTierInsurance,
|
||||
getScreenshotThumbURL,
|
||||
getScreenshotMediumURL,
|
||||
getScreenshotRawURL,
|
||||
type ListingDisplayResource,
|
||||
} from '@/shared/utils/listingDisplay'
|
||||
|
||||
@@ -165,7 +168,9 @@ const detailScreenshots = computed(() => {
|
||||
url,
|
||||
}))
|
||||
})
|
||||
const detailScreenshotUrls = computed(() => detailScreenshots.value.map(shot => shot.url))
|
||||
const detailScreenshotRawUrls = computed(() =>
|
||||
detailScreenshots.value.map(shot => getScreenshotRawURL(shot.url))
|
||||
)
|
||||
|
||||
const activeScreenshot = computed(() => {
|
||||
if (detailScreenshots.value.length === 0) return null
|
||||
@@ -533,12 +538,12 @@ function goBack() {
|
||||
<div class="gallery-stage">
|
||||
<div v-if="activeScreenshot" class="stage-viewer">
|
||||
<AuthImage
|
||||
:source="activeScreenshot.url"
|
||||
:source="getScreenshotMediumURL(activeScreenshot.url)"
|
||||
:alt="activeScreenshot.label"
|
||||
image-class="stage-image"
|
||||
fallback-class="stage-image"
|
||||
fit="contain"
|
||||
:preview-src-list="detailScreenshotUrls"
|
||||
:preview-src-list="detailScreenshotRawUrls"
|
||||
:preview-initial-index="activeImageIndex"
|
||||
/>
|
||||
<!-- 左上角分类角标 -->
|
||||
@@ -566,7 +571,7 @@ function goBack() {
|
||||
@mouseenter="activeImageIndex = idx"
|
||||
>
|
||||
<AuthImage
|
||||
:source="shot.url"
|
||||
:source="getScreenshotThumbURL(shot.url)"
|
||||
:alt="shot.label"
|
||||
image-class="thumb-img"
|
||||
fallback-class="thumb-img"
|
||||
|
||||
@@ -37,6 +37,9 @@ import {
|
||||
readAssetString,
|
||||
getRatioValue,
|
||||
isTopTierInsurance,
|
||||
getScreenshotThumbURL,
|
||||
getScreenshotMediumURL,
|
||||
getScreenshotRawURL,
|
||||
} from '@/shared/utils/listingDisplay'
|
||||
|
||||
const route = useRoute()
|
||||
@@ -164,7 +167,9 @@ const detailScreenshots = computed(() => {
|
||||
url,
|
||||
}))
|
||||
})
|
||||
const detailScreenshotUrls = computed(() => detailScreenshots.value.map(shot => shot.url))
|
||||
const detailScreenshotRawUrls = computed(() =>
|
||||
detailScreenshots.value.map(shot => getScreenshotRawURL(shot.url))
|
||||
)
|
||||
|
||||
const activeScreenshot = computed(() => {
|
||||
if (detailScreenshots.value.length === 0) return null
|
||||
@@ -505,12 +510,12 @@ function handleToggleFavorite() {
|
||||
<div class="gallery-stage">
|
||||
<div v-if="activeScreenshot" class="stage-viewer">
|
||||
<AuthImage
|
||||
:source="activeScreenshot.url"
|
||||
:source="getScreenshotMediumURL(activeScreenshot.url)"
|
||||
:alt="activeScreenshot.label"
|
||||
image-class="stage-image"
|
||||
fallback-class="stage-image"
|
||||
fit="contain"
|
||||
:preview-src-list="detailScreenshotUrls"
|
||||
:preview-src-list="detailScreenshotRawUrls"
|
||||
:preview-initial-index="activeImageIndex"
|
||||
/>
|
||||
<span class="stage-tag">{{ activeScreenshot.label }}</span>
|
||||
@@ -535,7 +540,7 @@ function handleToggleFavorite() {
|
||||
@click="activeImageIndex = idx"
|
||||
>
|
||||
<AuthImage
|
||||
:source="shot.url"
|
||||
:source="getScreenshotThumbURL(shot.url)"
|
||||
:alt="shot.label"
|
||||
image-class="thumb-img"
|
||||
fallback-class="thumb-img"
|
||||
|
||||
Reference in New Issue
Block a user