123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295 |
- <template>
- <!-- 传播交流页 -->
- <div class=" 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/fusion/Banner.jpg" />
- </Slide>
- <template #addons>
- <Navigation />
- <Pagination />
- </template>
- </Carousel>
- <!-- 闽南节庆日历 -->
- <section class="main-section pb-0">
- <div class="content">
- <div class="title">
- <h2>闽南节庆日历</h2>
- </div>
- <div class="calandar row">
- <div class="col col-12 col-lg-6 col-xl-6 p-0">
- <scroll-rect class="left-list">
- <h3 class="month-title">{{monthSelected}}月</h3>
- <ImageTitleDescBlock
- v-for="(item, index) in daysData"
- :key="index"
- :title="item.title"
- :image="item.image"
- :desc="item.desc || item.title"
- @click="goDetail(item.id)"
- />
- </scroll-rect>
- </div>
- <div class="month-grid col-12 col-lg-6 col-xl-6 p-0">
- <scroll-rect
- class="grid"
- v-for="(month, k) in monthData"
- :key="k"
- :class="[ monthSelected === month.month ? 'active' : '' ]"
- @click="monthChange(month.month)"
- >
- <h3>{{ month.month }}月</h3>
- <div class="tags">
- <span
- v-for="(holiday, index) in month.holidays"
- :key="index"
- >
- {{ holiday.title }}
- </span>
- </div>
- </scroll-rect>
- </div>
- </div>
- </div>
- </section>
- <!-- 文旅融合 -->
- <section class="main-section">
- <div class="content">
- <div class="title">
- <h2>文旅融合</h2>
- </div>
- <ThreeImageList :list="list" />
- </div>
- </section>
- </div>
- </template>
- <script setup lang="ts">
- import { Carousel, Slide, Pagination, Navigation } from 'vue3-carousel'
- import { onMounted, ref, type Ref } from 'vue';
- import Image1 from '@/assets/images/fusion/Image1.jpg'
- import Image2 from '@/assets/images/fusion/Image2.jpg'
- import Image3 from '@/assets/images/fusion/Image3.jpg'
- import Image4 from '@/assets/images/fusion/Image4.jpg'
- import Image5 from '@/assets/images/fusion/Image5.jpg'
- import LeftRightBox from '@/components/parts/LeftRightBox.vue';
- import ImageTitleDescBlock from '@/components/parts/ImageTitleDescBlock.vue';
- import ThreeImageList from '@/components/parts/ThreeImageList.vue';
- import { usePageAction } from '@/composeable/PageAction';
- import CommonContent, { GetContentListItem, GetContentListParams } from '@/api/CommonContent';
- import CalendarContent from '@/api/fusion/CalendarContent';
- const carouselConfig = {
- itemsToShow: 1,
- wrapAround: true,
- autoPlay: 5000,
- }
- const list = [
- {
- title: '闽南文化景区',
- desc: '让文化因传承而永存',
- image: Image1,
- onClick: () => {
- navTo('/fusion/scenic-spot');
- }
- },
- {
- title: '文化旅游路线',
- desc: '让文化因传承而永存',
- image: Image2,
- onClick: () => {
- navTo('/fusion/route');
- }
- },
- {
- title: '文化产品',
- desc: '让文化因传承而永存',
- image: Image3,
- onClick: () => {
- navTo('/fusion/products');
- }
- },
- {
- title: '非旅融合',
- desc: '非遗与旅游融合发展推荐目录',
- image: Image4,
- onClick: () => {
- navTo('/fusion/demo-site');
- }
- },
- {
- title: '闽南时尚',
- desc: '让文化因传承而永存',
- image: Image5,
- onClick: () => {
- navTo('/fusion/fashion');
- }
- },
- {
- title: '',
- desc: '',
- image: '',
- }
- ]
- const daysData = ref<GetContentListItem[]>([]) as Ref<GetContentListItem[]>
- const monthSelected = ref(new Date().getMonth() + 1)
- const monthData = ref<{
- month: number;
- holidays: GetContentListItem[];
- }[]>([
- {
- month: 1,
- holidays: []
- },
- {
- month: 2,
- holidays: []
- },
- {
- month: 3,
- holidays: []
- },
- {
- month: 4,
- holidays: []
- },
- {
- month: 5,
- holidays: []
- },
- {
- month: 6,
- holidays: []
- },
- {
- month: 7,
- holidays: []
- },
- {
- month: 8,
- holidays: []
- },
- {
- month: 9,
- holidays: []
- },
- {
- month: 10,
- holidays: []
- },
- {
- month: 11,
- holidays: []
- },
- {
- month: 12,
- holidays: []
- },
- ])
- onMounted(async () => {
- const res = await CalendarContent.getCalendarList(new GetContentListParams(), 1, 50)
- const year = new Date().getFullYear();
- res.list.filter(p =>
- p.dateYear === year
- ).forEach(item => {
- if (!item.desc)
- item.desc = item.title;
- item.title = item.title.substring(0, 10);
- });
- res.list.forEach(item => {
- monthData.value[item.dateMonth - 1]?.holidays?.push(item)
- })
- daysData.value = monthData.value[ monthSelected.value - 1].holidays as GetContentListItem[];
-
- });
- function goDetail(id: number) {
- navTo(`/news/detail`, { id, modelId: 18 });
- }
- function monthChange(month: number) {
- monthSelected.value = month;
- daysData.value = monthData.value[month - 1].holidays as GetContentListItem[];
- }
- const { navTo } = usePageAction();
- </script>
- <style lang="scss">
- @use '@/assets/scss/colors.scss' as *;
- .calandar {
- background-color: $box-color;
- .left-list {
- height: 750px;
- }
- .month-title {
- margin: 24px 24px 0 24px;
- }
- .month-grid {
- display: grid;
- grid-template-columns: repeat(4, 25%);
- > .grid {
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- background-color: $text-color-light;
- padding: 12px ;
- border: 1px solid $border-split-color;
- height: 250px;
- h3 {
- font-size: 18px;
- }
- .tags {
- display: flex;
- flex-direction: row;
- flex-wrap: wrap;
- > span {
- font-size: 13px;
- margin-right: 8px;
- margin-top: 8px;
- padding: 0 8px;
- border-radius: 12px;
- background-color: rgba(#FF961B, 0.1);
- display: -webkit-box;
- -webkit-line-clamp: 1;
- -webkit-box-orient: vertical;
- overflow: hidden;
- text-overflow: ellipsis;
- word-break: break-all;
- line-height: 28px;
- }
- }
- &.active {
- background-color: $primary-color;
- color: $text-color-light;
- }
- }
- }
- }
- @media (max-width: 500px) {
- .calandar .month-grid {
- grid-template-columns: repeat(2, 50%);
- }
- }
- </style>
|