| | |
| | | <template> |
| | | <view class="page"> |
| | | <view class="custom-nav"><view class="safe-space" :style="'height:' + navTop + 'px'"></view><view class="nav-row" :style="'height:' + navHeight + 'px;padding-right:' + navRight + 'px'"><view class="back-button" hover-class="back-button-active" @tap="goBack"><image src="/static/news-assets/arrow-left.svg"></image></view><text class="nav-title">人才政策</text><view class="capsule-space" :style="'width:' + navWidth + 'px'"></view></view></view> |
| | | <scroll-view class="content" scroll-y> |
| | | <scroll-view :show-scrollbar="false" class="content" scroll-y> |
| | | <view v-if="initialLoading" class="detail-state"><view class="loading-spinner"></view><text>正在加载政策详情</text></view> |
| | | <view v-else-if="policyUnavailable" class="detail-state error-state"><text>政策已失效</text><text class="retry-text" @tap="goBack">返回政策列表</text></view> |
| | | <view v-else-if="initialError" class="detail-state error-state"><text>政策详情加载失败</text><text class="retry-text" @tap="loadPolicy">重新加载</text></view> |
| | |
| | | const policyCategory = ref('东区政策') |
| | | const policyContent = ref('') |
| | | const policyContentImages = ref<string[]>([]) |
| | | const policyCover = ref('/static/home-assets/home-banner-v2.jpg') |
| | | const policyCover = ref('') |
| | | const policyId = ref('') |
| | | const initialLoading = ref(true) |
| | | const initialError = ref(false) |
| | |
| | | policyCategory.value = data != null && data.subtitle != null && (data.subtitle as string).trim() != '' ? data.subtitle as string : '人才政策' |
| | | // 正文直接取后台政策内容;contentText 为空时兼容后台仅返回富文本 content 的情况。 |
| | | policyContent.value = policyContentText(data) |
| | | policyCover.value = '/static/home-assets/home-banner-v2.jpg' |
| | | policyCover.value = '' |
| | | const heroImage = data != null && data.heroImage != null ? data.heroImage : (data != null ? data.coverUrl : null) |
| | | if (heroImage != null && (heroImage as string).length > 0) policyCover.value = resolveApiUrl(heroImage as string) |
| | | const images: string[] = [] |
| | |
| | | initialError.value = !policyUnavailable.value |
| | | }) |
| | | } |
| | | const useHeroFallback = () => { policyCover.value = '/static/home-assets/home-banner-v2.jpg' } |
| | | const useHeroFallback = () => { policyCover.value = '' } |
| | | const useContentImageFallback = (index: number) => { |
| | | const next = policyContentImages.value.slice() |
| | | next[index] = '/static/policy-assets/policy-explanation.jpg' |
| | | next[index] = '/static/common/image-placeholder.png' |
| | | policyContentImages.value = next |
| | | } |
| | | const goBack = () => safeBack('/pages/policy/policy') |