| | |
| | | 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') |