123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181 |
- <template>
- <!-- 关于页 -->
- <div class="about main-background main-background-type0">
- <!-- 轮播 -->
- <Carousel v-bind="carouselConfig" class="main-header-box small carousel-light">
- <Slide class="main-header-box small">
- <img src="@/assets/images/about/Banner.jpg" />
- </Slide>
- <template #addons>
- <Navigation />
- <Pagination />
- </template>
- </Carousel>
- <!-- 头部搜索 -->
- <section class="main-section absolute light fit-small-header">
- <div class="content row">
- <div class="col-md-12 col-lg-8 col-xl-6">
- <div class="main-header-title d-flex flex-column">
- </div>
- </div>
- <div class="col-md-12 col-lg-4 col-xl-6">
- </div>
- </div>
- <!-- 头部TAB -->
- <div class="main-header-tab">
- <div class="list">
- <div
- v-for="(tab, k) in mainTabs"
- :key="k"
- :class="[ mainTabActive === tab.value ? 'active' : '' ]"
- @click="mainTabActive = tab.value"
- >
- {{ tab.title }}
- </div>
- </div>
- </div>
- </section>
- <!-- 新闻 -->
- <section v-if="mainTabActive <= 2" class="main-section main-background main-background-type0">
- <div class="content news-list">
- <!-- 新闻列表 -->
- <SimplePageContentLoader :loader="newsLoader">
- <div
- v-for="(item, k) in newsLoader.list.value"
- :key="item.id"
- class="item"
- @click="router.push({ name: 'news-detail', query: { id: item.id }})"
- >
- <img :src="item.image" alt="新闻图片" />
- <TitleDescBlock
- :title="item.title"
- :desc="item.desc || item.title"
- :date="DateUtils.formatDate(item.publishAt, DateUtils.FormatStrings.YearCommon)"
- />
- </div>
- </SimplePageContentLoader>
- <!-- 分页 -->
- <Pagination2
- v-model:currentPage="newsLoader.page.value"
- :totalPages="newsLoader.totalPages.value"
- />
- </div>
- </section>
- <!-- 法律法规 -->
- <section v-if="mainTabActive == 3" class="main-section">
- <div class="content">
- <div class="title left-right">
- <h2>法律法规</h2>
- <div class="small-more" @click="navTo('/introduction/policy')">
- <span>更多信息</span>
- <img src="@/assets/images/index/ButtonMore.png" alt="更多" />
- </div>
- </div>
- <SimplePageContentLoader :loader="lawsData">
- <ImageTextSmallBlock
- v-for="(item, index) in lawsData.content.value"
- :key="index"
- :title="item.title"
- :image="item.image"
- :date="item.date"
- @click="navTo('/news/detail', { id: item.id })"
- />
- </SimplePageContentLoader>
- </div>
- </section>
- </div>
- </template>
- <script setup lang="ts">
- import { Carousel, Slide, Pagination, Navigation } from 'vue3-carousel'
- import { onMounted, ref, watch } from 'vue';
- import { useSimplePagerDataLoader } from '@/composeable/SimplePagerDataLoader';
- import Pagination2 from '@/components/controls/Pagination.vue';
- import TitleDescBlock from '@/components/parts/TitleDescBlock.vue';
- import ImageTextSmallBlock from '@/components/parts/ImageTextSmallBlock.vue';
- import SimplePageContentLoader from '@/components/content/SimplePageContentLoader.vue';
- import CommonContent, { GetContentListParams } from '@/api/CommonContent';
- import DateUtils from '@/common/utils/DateUtils';
- import PolicyContent from '@/api/introduction/PolicyContent';
- import LawsTest from '@/assets/images/inheritor/LawsTest.jpg'
- import { useRouter } from 'vue-router';
- import { useSimpleDataLoader } from '@/composeable/SimpleDataLoader';
- import { usePageAction } from '@/composeable/PageAction';
- const { navTo } = usePageAction();
- const carouselConfig = {
- itemsToShow: 1,
- wrapAround: true,
- autoPlay: 5000,
- }
- const mainTabs = [
- { title: '闽南文化概况', value: 0 },
- { title: '闽南文化生态保护区概况', value: 1 },
- { title: '世界闽南文化交流中心', value: 2 },
- { title: '法律法规', value: 3 },
- ]
- const mainTabActive = ref(0);
- const router = useRouter();
- const newsLoader = useSimplePagerDataLoader(10, async (page, pageSize) => {
- let res;
- switch (mainTabActive.value) {
- default:
- case 0:
- res = await CommonContent.getContentList(new GetContentListParams()
- .setModelId(17)
- .setMainBodyColumnId([ ])
- , page, pageSize);
- break;
- case 1:
- res = await CommonContent.getContentList(new GetContentListParams()
- .setModelId(17)
- .setMainBodyColumnId([ 255, 256, 283, 284, ])
- , page, pageSize);
- break;
- case 2:
- res = await CommonContent.getContentList(new GetContentListParams()
- .setModelId(17)
- .setMainBodyColumnId([ 232 ])
- , page, pageSize);
- break;
- }
- return {
- data: res.list,
- total: res.total,
- };
- });
- const lawsData = useSimpleDataLoader(async () =>
- (await PolicyContent.getContentList(new GetContentListParams(), 1, 8))
- .list?.map(item => ({
- id: item.id,
- title: item.title,
- image: item.image || LawsTest,
- date: DateUtils.formatDate(item.publishAt, DateUtils.FormatStrings.YearCommon),
- }))
- )
- watch(mainTabActive, () => newsLoader.loadData(undefined, true))
- onMounted(async () => {
- newsLoader.loadData(undefined, true);
- })
- </script>
- <style lang="scss">
- @media (max-width: 425px) {
-
- }
- </style>
|