|
@@ -41,14 +41,15 @@
|
|
|
<div class="content">
|
|
|
<h4>{{ stat.title || '\u200b' }}</h4>
|
|
|
<div class="descs">
|
|
|
- <div
|
|
|
+ <a
|
|
|
v-for="(data, key2) in stat.datas"
|
|
|
+ class="box"
|
|
|
:key="key2"
|
|
|
- @click="data.onClick"
|
|
|
+ :href="data.link"
|
|
|
>
|
|
|
<h5>{{ data.title }}</h5>
|
|
|
<p>{{ data.value }}</p>
|
|
|
- </div>
|
|
|
+ </a>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -97,14 +98,17 @@
|
|
|
|
|
|
<SimplePageContentLoader :loader="recommend2Data">
|
|
|
<div class="main-grid9 d-flex flex-row flex-wrap justify-content-between">
|
|
|
- <ImageTitleBlock
|
|
|
+ <NuxtLink
|
|
|
v-for="(item, index) in recommend2Data.content.value"
|
|
|
:key="index"
|
|
|
- :image="item.image"
|
|
|
- :title="item.title"
|
|
|
- :desc="item.desc"
|
|
|
- @click="router.push({ path: '/details/intangible', query: { id: item.id } })"
|
|
|
- />
|
|
|
+ :to="{ path: '/details/intangible', query: { id: item.id } }"
|
|
|
+ >
|
|
|
+ <ImageTitleBlock
|
|
|
+ :image="item.image"
|
|
|
+ :title="item.title"
|
|
|
+ :desc="item.desc"
|
|
|
+ />
|
|
|
+ </NuxtLink>
|
|
|
</div>
|
|
|
</SimplePageContentLoader>
|
|
|
</div>
|
|
@@ -119,14 +123,17 @@
|
|
|
|
|
|
<SimplePageContentLoader :loader="recommend1Data">
|
|
|
<div class="main-grid9 d-flex flex-row flex-wrap justify-content-between">
|
|
|
- <ImageTitleBlock
|
|
|
+ <NuxtLink
|
|
|
v-for="(item, index) in recommend1Data.content.value"
|
|
|
:key="index"
|
|
|
- :image="item.image"
|
|
|
- :title="item.title"
|
|
|
- :desc="item.desc"
|
|
|
- @click="router.push({ path: '/details/artifact', query: { id: item.id } })"
|
|
|
- />
|
|
|
+ :to="{ path: '/details/artifact', query: { id: item.id } }"
|
|
|
+ >
|
|
|
+ <ImageTitleBlock
|
|
|
+ :image="item.image"
|
|
|
+ :title="item.title"
|
|
|
+ :desc="item.desc"
|
|
|
+ />
|
|
|
+ </NuxtLink>
|
|
|
</div>
|
|
|
</SimplePageContentLoader>
|
|
|
</div>
|
|
@@ -144,13 +151,14 @@
|
|
|
<Slide
|
|
|
v-for="(item, index) in recommend3Data.content.value"
|
|
|
:key="index"
|
|
|
- @click="router.push({ path: '/news/detail', query: { id: item.id } })"
|
|
|
>
|
|
|
- <ImageTitleBlock
|
|
|
- :image="item.image"
|
|
|
- :title="item.title"
|
|
|
- :desc="item.desc"
|
|
|
- />
|
|
|
+ <NuxtLink :to="{ path: '/news/detail', query: { id: item.id } }">
|
|
|
+ <ImageTitleBlock
|
|
|
+ :image="item.image"
|
|
|
+ :title="item.title"
|
|
|
+ :desc="item.desc"
|
|
|
+ />
|
|
|
+ </NuxtLink>
|
|
|
</Slide>
|
|
|
</Carousel>
|
|
|
</SimplePageContentLoader>
|
|
@@ -167,22 +175,27 @@
|
|
|
<div class="content">
|
|
|
<div class="title left-right">
|
|
|
<h2>最新资讯动态</h2>
|
|
|
- <div class="small-more" @click="router.push({ path: '/news' })">
|
|
|
- <span>更多动态信息</span>
|
|
|
- <img src="@/assets/images/index/ButtonMore.png" alt="更多" />
|
|
|
+ <div class="small-more">
|
|
|
+ <NuxtLink :to="{ path: '/news' }">
|
|
|
+ <span>更多动态信息</span>
|
|
|
+ <img src="@/assets/images/index/ButtonMore.png" alt="更多" />
|
|
|
+ </NuxtLink>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<SimplePageContentLoader :loader="newsData">
|
|
|
<div class="main-grid9 d-flex flex-row flex-wrap justify-content-between">
|
|
|
- <ImageTitleBlock
|
|
|
+ <NuxtLink
|
|
|
v-for="(item, index) in newsData.content.value"
|
|
|
:key="index"
|
|
|
- :image="item.image"
|
|
|
- :title="item.title"
|
|
|
- :desc="item.typeText"
|
|
|
- @click="router.push({ path: '/news/detail', query: { id: item.id } })"
|
|
|
- />
|
|
|
+ :to="{ path: '/news/detail', query: { id: item.id } }"
|
|
|
+ >
|
|
|
+ <ImageTitleBlock
|
|
|
+ :image="item.image"
|
|
|
+ :title="item.title"
|
|
|
+ :desc="item.typeText"
|
|
|
+ />
|
|
|
+ </NuxtLink>
|
|
|
</div>
|
|
|
</SimplePageContentLoader>
|
|
|
</div>
|
|
@@ -211,25 +224,25 @@
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
import { Carousel, Slide, Pagination, Navigation } from 'vue3-carousel'
|
|
|
-import { onMounted, ref } from 'vue';
|
|
|
+import { ref } from 'vue';
|
|
|
import { useRouter } from 'vue-router';
|
|
|
-import { useSimpleDataLoader } from '@/composeable/SimpleDataLoader';
|
|
|
-import CommonContent, { GetColumListParams, GetContentListParams, type GetContentListItem } from '@/api/CommonContent';
|
|
|
+import { useSSrSimpleDataLoader } from '@/composeable/SimpleDataLoader';
|
|
|
import { NO_CONTENT_STRING } from '@/common/ConstStrings';
|
|
|
-import NewsIndexContent from '@/api/news/NewsIndexContent';
|
|
|
+import { DataDateUtils } from '@imengyu/js-request-transform';
|
|
|
+import { ScrollRect } from '@imengyu/vue-scroll-rect';
|
|
|
import ImageTitleBlock from '@/components/parts/ImageTitleBlock.vue';
|
|
|
+import SimpleRemoveRichHtml from '@/components/display/SimpleRemoveRichHtml.vue';
|
|
|
import SimplePageContentLoader from '@/components/content/SimplePageContentLoader.vue';
|
|
|
import IndexContent from '@/api/introduction/IndexContent';
|
|
|
-import SimpleRemoveRichHtml from '@/components/display/SimpleRemoveRichHtml.vue';
|
|
|
+import NewsIndexContent from '@/api/news/NewsIndexContent';
|
|
|
import UnmoveableContent from '@/api/inheritor/UnmoveableContent';
|
|
|
import ProjectContent from '@/api/research/ProjectContent';
|
|
|
import ActivityContent from '@/api/inheritor/ActivityContent';
|
|
|
import ProductContent from '@/api/fusion/ProductContent';
|
|
|
import ProductsContent from '@/api/inheritor/ProductsContent';
|
|
|
import ProjectsContent from '@/api/inheritor/ProjectsContent';
|
|
|
-import { DataDateUtils } from '@imengyu/js-request-transform';
|
|
|
-import { ScrollRect } from '@imengyu/vue-scroll-rect';
|
|
|
import SeminarContent from '@/api/inheritor/SeminarContent';
|
|
|
+import CommonContent, { GetColumListParams, GetContentListParams, type GetContentListItem } from '@/api/CommonContent';
|
|
|
|
|
|
const router = useRouter();
|
|
|
|
|
@@ -245,35 +258,33 @@ const carousel2Config = {
|
|
|
}
|
|
|
const carousel6Ref = ref<any>(null);
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-const bannerData = useSimpleDataLoader(async () => {
|
|
|
- return await IndexContent.getBanner()
|
|
|
+const bannerData = await useSSrSimpleDataLoader('banner', async () => {
|
|
|
+ return (await IndexContent.getBanner()).map(p => p.toJSON());
|
|
|
});
|
|
|
-const overviewData = useSimpleDataLoader(async () => {
|
|
|
+const overviewData = await useSSrSimpleDataLoader('overview', async () => {
|
|
|
return (await IndexContent.getColumList(new GetColumListParams().setSelfValues({
|
|
|
modelId: 17,
|
|
|
mainBodyColumnId: 234,
|
|
|
}))).list[0]?.overview || NO_CONTENT_STRING
|
|
|
});
|
|
|
-const recommend1Data = useSimpleDataLoader<GetContentListItem[]>(async () => {
|
|
|
- return (await UnmoveableContent.getContentList(new GetContentListParams(), 1, 9)).list;
|
|
|
+const recommend1Data = await useSSrSimpleDataLoader('recommend1', async () => {
|
|
|
+ return (await UnmoveableContent.getContentList(new GetContentListParams(), 1, 9)).list.map(p => p.toJSON());
|
|
|
});
|
|
|
-const recommend2Data = useSimpleDataLoader<GetContentListItem[]>(async () => {
|
|
|
- return (await ProjectsContent.getContentList(new GetContentListParams().setMainBodyColumnId([]), 1, 9)).list
|
|
|
+const recommend2Data = await useSSrSimpleDataLoader('recommend2', async () => {
|
|
|
+ return (await ProjectsContent.getContentList(new GetContentListParams().setMainBodyColumnId([]), 1, 9)).list.map(p => p.toJSON());
|
|
|
});
|
|
|
-const recommend3Data = useSimpleDataLoader<GetContentListItem[]>(async () => {
|
|
|
+const recommend3Data = await useSSrSimpleDataLoader('recommend3', async () => {
|
|
|
return (await CommonContent.getContentList(new GetContentListParams()
|
|
|
.setModelId(17)
|
|
|
.setMainBodyColumnId(273)
|
|
|
- , 1, 8)).list
|
|
|
+ , 1, 8)).list.map(p => p.toJSON());
|
|
|
});
|
|
|
-const newsData = useSimpleDataLoader<GetContentListItem[]>(async () => {
|
|
|
+const newsData = await useSSrSimpleDataLoader('news', async () => {
|
|
|
return (await NewsIndexContent.getContentList(new GetContentListParams()
|
|
|
.setMainBodyColumnId([ 228/* , 298, 299 */ ])
|
|
|
- , 1, 9)).list
|
|
|
+ , 1, 9)).list.map(p => p.toJSON());
|
|
|
});
|
|
|
-const statsData = useSimpleDataLoader(async () => {
|
|
|
+const statsData = await useSSrSimpleDataLoader('stats', async () => {
|
|
|
const data = (await IndexContent.getStats());
|
|
|
const semiCount = (await SeminarContent.getContentList(new GetContentListParams(), 1, 1)).total;
|
|
|
const unmoveableCount = (await UnmoveableContent.getContentList(new GetContentListParams(), 1, 1)).total;
|
|
@@ -286,9 +297,7 @@ const statsData = useSimpleDataLoader(async () => {
|
|
|
return {
|
|
|
title: item.level_text,
|
|
|
value: item.total,
|
|
|
- onClick: () => {
|
|
|
- router.push({ path: '/inheritor/projects', query: { level: item.level } });
|
|
|
- },
|
|
|
+ link: router.resolve({ path: '/inheritor/projects', query: { level: item.level } }).href,
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -299,9 +308,7 @@ const statsData = useSimpleDataLoader(async () => {
|
|
|
return {
|
|
|
title: item.title,
|
|
|
value: item.total,
|
|
|
- onClick: () => {
|
|
|
- router.push({ path: '/inheritor/inheritor', query: { level: item.level } });
|
|
|
- },
|
|
|
+ link: router.resolve({ path: '/inheritor/inheritor', query: { level: item.level } }).href
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -312,17 +319,17 @@ const statsData = useSimpleDataLoader(async () => {
|
|
|
{
|
|
|
title: '传习所',
|
|
|
value: semiCount,
|
|
|
- onClick: () => router.push({ path: '/inheritor/seminar' }),
|
|
|
+ link: router.resolve({ path: '/inheritor/seminar' }).href,
|
|
|
},
|
|
|
{
|
|
|
title: '传统村落',
|
|
|
value: data.villageData[0]?.total ?? 0,
|
|
|
- onClick: () => router.push({ path: '/village/index' }),
|
|
|
+ link: router.resolve({ path: '/village/index' }).href,
|
|
|
},
|
|
|
{
|
|
|
title: '文物古迹',
|
|
|
value: unmoveableCount,
|
|
|
- onClick: () => router.push({ path: '/inheritor/unmoveable' }),
|
|
|
+ link: router.resolve({ path: '/inheritor/unmoveable' }).href,
|
|
|
},
|
|
|
],
|
|
|
},
|
|
@@ -368,14 +375,14 @@ const statsData = useSimpleDataLoader(async () => {
|
|
|
},*/
|
|
|
];
|
|
|
});
|
|
|
-const recordData = useSimpleDataLoader<GetContentListItem[]>(async () => {
|
|
|
+const recordData = await useSSrSimpleDataLoader('record', async () => {
|
|
|
return (await CommonContent.getContentList(new GetContentListParams()
|
|
|
.setSelfValues({
|
|
|
order: 'publish_at',
|
|
|
})
|
|
|
.setModelId(18)
|
|
|
.setMainBodyColumnId(316)
|
|
|
- , 1, 50)).list
|
|
|
+ , 1, 50)).list.map(p => p.toJSON());
|
|
|
});
|
|
|
</script>
|
|
|
|
|
@@ -410,10 +417,12 @@ const recordData = useSimpleDataLoader<GetContentListItem[]>(async () => {
|
|
|
flex-direction: row;
|
|
|
flex-wrap: wrap;
|
|
|
|
|
|
- div {
|
|
|
+ .box {
|
|
|
flex: 1 1 50%;
|
|
|
margin-bottom: 32px;
|
|
|
cursor: pointer;
|
|
|
+ color: #fff;
|
|
|
+ text-decoration: none;
|
|
|
|
|
|
h5 {
|
|
|
font-size: 1rem;
|