Files
jinshen-website/app/pages/about/index.vue
R2m1liA f2533767d2
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m3s
fix: 调整关于我们页面渲染机制
- 骨架屏:骨架屏由el-skeleton模板控制
2025-12-19 12:53:01 +08:00

114 lines
2.6 KiB
Vue

<template>
<div class="page-container">
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
<div class="content">
<el-skeleton :loading="pending" :rows="10" animated>
<template #default>
<!-- eslint-disable-next-line vue/no-v-html -->
<div class="html-typography" v-html="companyProfile?.content || ''" />
<!-- <div v-if="!hydrated" v-html="companyProfile.content || ''" /> -->
<!-- <div v-else> -->
<!-- <html-renderer -->
<!-- class="html-typography" -->
<!-- :html="companyProfile.content || ''" -->
<!-- /> -->
<!-- </div> -->
<el-divider content-position="left">{{
$t('learn-more')
}}</el-divider>
<div class="button-group">
<learn-more-card
:title="$t('navigation.contact-info')"
:icon="ElIconService"
:to="$localePath('/support/contact-us')"
/>
<learn-more-card
:title="$t('navigation.address')"
:icon="ElIconMapLocation"
@click="openMap"
/>
</div>
</template>
</el-skeleton>
</div>
</div>
</template>
<script setup lang="ts">
const localePath = useLocalePath();
const hydrated = ref(false);
const breadcrumbItems = [
{ label: $t('navigation.home'), to: localePath('/') },
{ label: $t('navigation.about-us') },
];
const { data, pending, error } = useCompanyProfile();
const companyProfile = computed(() => data.value ?? null);
const openMap = () => {
window.open(localePath('/locate'));
};
watch(error, (value) => {
if (value) {
logger.error('数据获取失败: ', value);
}
});
const pageTitle = computed(() => $t('page-title.about-us'));
useHead({
title: pageTitle,
});
onMounted(() => {
hydrated.value = true;
});
</script>
<style scoped>
.page-container {
padding: 2rem 1rem;
max-width: 1200px;
margin: 0 auto;
}
.breadcrumb {
padding: 1rem 1rem;
}
.content {
padding: 1rem;
margin-bottom: 2rem;
}
:deep(.el-divider__text) {
color: var(--el-color-info);
font-size: 1em;
}
.button-group {
display: flex;
justify-content: left;
margin-top: 2rem;
margin-left: 2rem;
gap: 2rem;
}
.loading {
display: flex;
justify-content: center;
align-items: center;
margin-top: 1rem;
}
@media (max-width: 768px) {
.button-group {
align-items: center;
margin-left: 0;
gap: 0.5rem;
}
}
</style>