@@ -78,7 +78,7 @@
|
||||
:class="{ disabled: detailTextLoading }"
|
||||
@tap="handleLoadDetailText"
|
||||
>
|
||||
<text class="text-load-btn-text">{{ detailTextLoading ? '正在加载' : '查看图文讲解' }}</text>
|
||||
<text class="text-load-btn-text">{{ detailTextLoading ? '正在加载' : detailTextLoadActionText }}</text>
|
||||
</view>
|
||||
<text v-if="detailTextUnavailableMessage" class="section-hint">{{ detailTextUnavailableMessage }}</text>
|
||||
</view>
|
||||
@@ -239,14 +239,36 @@ 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
|
||||
: hasDeferredDetailText.value && !hasMeaningfulDetailSummary.value
|
||||
? '已找到当前语言讲解词,可加载查看完整正文。'
|
||||
: exhibit.value.summary
|
||||
))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user