diff --git a/src/pages/exhibit/detail.vue b/src/pages/exhibit/detail.vue index 8a76462..99e4cef 100644 --- a/src/pages/exhibit/detail.vue +++ b/src/pages/exhibit/detail.vue @@ -78,7 +78,7 @@ :class="{ disabled: detailTextLoading }" @tap="handleLoadDetailText" > - {{ detailTextLoading ? '正在加载' : '查看图文讲解' }} + {{ detailTextLoading ? '正在加载' : detailTextLoadActionText }} {{ detailTextUnavailableMessage }} @@ -239,15 +239,37 @@ const visibleLanguageOptions = computed(() => ( languageOptions.filter((option) => supportedDetailLanguages.value.has(option.value)) )) 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 && !detailTextLoaded.value && !detailTextUnavailableMessage.value + && hasTextLoadTarget.value + && !isDetailSummaryLikelyComplete.value +)) +const isTextLoadActionVisible = computed(() => hasDeferredDetailText.value) +const detailTextLoadActionText = computed(() => ( + hasMeaningfulDetailSummary.value + ? '查看完整讲解词' + : '加载讲解正文' )) const detailBodyText = computed(() => ( detailTextLoaded.value ? exhibit.value.body || exhibit.value.summary - : exhibit.value.summary + : hasDeferredDetailText.value && !hasMeaningfulDetailSummary.value + ? '已找到当前语言讲解词,可加载查看完整正文。' + : exhibit.value.summary )) // 讲解详情页只定位到所属展厅,不再追踪具体展品点位。