优化讲解详情正文按钮显示
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
lyf
2026-07-07 18:15:45 +08:00
parent 349f9b03e5
commit 64ad7acfa8

View File

@@ -78,7 +78,7 @@
:class="{ disabled: detailTextLoading }" :class="{ disabled: detailTextLoading }"
@tap="handleLoadDetailText" @tap="handleLoadDetailText"
> >
<text class="text-load-btn-text">{{ detailTextLoading ? '正在加载' : '查看图文讲解' }}</text> <text class="text-load-btn-text">{{ detailTextLoading ? '正在加载' : detailTextLoadActionText }}</text>
</view> </view>
<text v-if="detailTextUnavailableMessage" class="section-hint">{{ detailTextUnavailableMessage }}</text> <text v-if="detailTextUnavailableMessage" class="section-hint">{{ detailTextUnavailableMessage }}</text>
</view> </view>
@@ -239,15 +239,37 @@ const visibleLanguageOptions = computed(() => (
languageOptions.filter((option) => supportedDetailLanguages.value.has(option.value)) languageOptions.filter((option) => supportedDetailLanguages.value.has(option.value))
)) ))
const isLanguageSwitchVisible = computed(() => visibleLanguageOptions.value.length > 1) const isLanguageSwitchVisible = computed(() => visibleLanguageOptions.value.length > 1)
const isTextLoadActionVisible = computed(() => ( const hasTextLoadTarget = computed(() => Boolean(
exhibit.value.audio.playTargetId || exhibit.value.id
))
const normalizedDetailSummary = computed(() => exhibit.value.summary.trim())
const hasMeaningfulDetailSummary = computed(() => (
normalizedDetailSummary.value
&& normalizedDetailSummary.value !== defaultDetail.summary
))
const isDetailSummaryLikelyComplete = computed(() => (
hasMeaningfulDetailSummary.value
&& normalizedDetailSummary.value.length >= 120
))
const hasDeferredDetailText = computed(() => (
exhibit.value.audio.hasText === true exhibit.value.audio.hasText === true
&& !detailTextLoaded.value && !detailTextLoaded.value
&& !detailTextUnavailableMessage.value && !detailTextUnavailableMessage.value
&& hasTextLoadTarget.value
&& !isDetailSummaryLikelyComplete.value
))
const isTextLoadActionVisible = computed(() => hasDeferredDetailText.value)
const detailTextLoadActionText = computed(() => (
hasMeaningfulDetailSummary.value
? '查看完整讲解词'
: '加载讲解正文'
)) ))
const detailBodyText = computed(() => ( const detailBodyText = computed(() => (
detailTextLoaded.value detailTextLoaded.value
? exhibit.value.body || exhibit.value.summary ? exhibit.value.body || exhibit.value.summary
: exhibit.value.summary : hasDeferredDetailText.value && !hasMeaningfulDetailSummary.value
? '已找到当前语言讲解词,可加载查看完整正文。'
: exhibit.value.summary
)) ))
// 讲解详情页只定位到所属展厅,不再追踪具体展品点位。 // 讲解详情页只定位到所属展厅,不再追踪具体展品点位。