| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582 |
- <template>
- <view class="home-container page-home d-flex flex-col bg-base">
- <image
- class="w-100 position-absolute"
- src="https://mncdn.wenlvti.net/app_static/minnan/images/home/BackgroundBanner5.jpg"
- mode="widthFix"
- />
- <view class="content d-flex flex-col wing-l">
- <!-- 分栏 -->
- <view class="shadow-l radius-l bg-base p-3">
- <view
- class="main-banner-box"
- @click="navTo('home/introduction')"
- >
- <text class="title">闽南文化生态保护区(厦门市)</text>
- <text>世界闽南文化交流中心</text>
- <view class="more">
- <text>查看详情</text>
- </view>
- <image
- class="footer"
- src="https://mncdn.wenlvti.net/app_static/minnan/images/home/MainBanner2.png"
- mode="widthFix"
- />
- </view>
- <view class="position-relative d-flex flex-row flex-wrap justify-between mt-3">
- <view
- v-for="(tab, k) in subTabs"
- :key="k"
- class="d-flex flex-column align-center width-1-4 mt-2 mb-2"
- @click="tab.onClick"
- >
- <image class="width-100" :src="tab.icon" mode="widthFix" :style="{ maxHeight: '100rpx' }" />
- <text class="color-second-text mt-2 size-base text-align-center">{{ tab.name }}</text>
- </view>
- <Box1AudioPlay
- class="w-100 mt-3"
- :title="indexAudioPlayer.currentTitle.value"
- :image="indexAudioPlayer.currentItem?.value?.image"
- :playState="indexAudioPlayer.isPlaying.value"
- :playTime="indexAudioPlayer.timeString.value"
- @playPauseClick="indexAudioPlayer.playpause"
- @nextClick="indexAudioPlayer.next"
- @prevClick="indexAudioPlayer.prev"
- @click="handleGoAudioList"
- />
- </view>
- </view>
- <!-- 数据统计 -->
- <SimplePageContentLoader :loader="statsLoader">
- <view v-if="statsLoader.content.value" class="d-flex flex-col justify-center mt-3 pt-3 b-3">
- <view class="d-flex flex-row align-center">
- <view class="d-flex flex-col w-50">
- <StatsText
- :title="statsLoader.content.value[0].title"
- :data="statsLoader.content.value[0].datas"
- :type="statsLoader.content.value[0].type"
- />
- <view class="p-2">
- <HorizontalScrollText :text="statsText1" :fontSize="26" color="text.second" :outerStyle="{ height: '40rpx' }" />
- </view>
- </view>
- <view class="d-flex flex-col w-50">
- <StatsText
- classNames="border-left-forth"
- :title="statsLoader.content.value[1].title"
- :data="statsLoader.content.value[1].datas"
- :type="statsLoader.content.value[1].type"
- />
- <view class="p-2">
- <HorizontalScrollText :text="statsText2" :fontSize="26" color="text.second" :outerStyle="{ height: '40rpx' }" />
- </view>
- </view>
- </view>
- <view class="border-top-forth pt-2 mt-3"></view>
- <StatsText
- :data="statsLoader.content.value[2].datas"
- :type="statsLoader.content.value[2].type"
- />
- </view>
- </SimplePageContentLoader>
- <!-- 文化地图 -->
- <HomeTitle title="文化地图" />
- <view class="position-relative radius-l overflow-hidden">
- <map
- id="map"
- class="w-100 height-400"
- :markers="mapLoader.content.value || []"
- :enable-zoom="false"
- :enable-scroll="false"
- :scale="15"
- @click="navTo('inhert/map/index', { tab: mapTab })"
- />
- <scroll-view class="map-tags position-absolute" :scroll-x="true">
- <view class="tag-bar d-flex flex-row flex-nowrap">
- <view :class="mapTab == 1 ? 'active' : ''" @click="mapTab=1">
- <text class="iconfont icon-read" />
- 非遗项目
- </view>
- <view :class="mapTab == 2 ? 'active' : ''" @click="mapTab=2">
- <text class="iconfont icon-task-trip" />
- 非遗传习所
- </view>
- <view :class="mapTab == 3 ? 'active' : ''" @click="mapTab=3">
- <text class="iconfont icon-task-buliding" />
- 文物古迹
- </view>
- <view :class="mapTab == 4 ? 'active' : ''" @click="mapTab=4">
- <text class="iconfont icon-place" />
- 传统村落
- </view>
- <view :class="mapTab == 5 ? 'active' : ''" @click="mapTab=5">
- <text class="iconfont icon-task-environment-3" />
- 闽南文化景区
- </view>
- </view>
- </scroll-view>
- </view>
-
- <!-- 精彩推荐 -->
- <HomeTitle title="精彩推荐" />
- <SimplePageContentLoader :loader="recommendLoader">
- <view class="d-flex flex-row justify-between flex-wrap">
- <view
- v-for="(tab, k) in recommendLoader.content.value"
- :key="k"
- class="grid4-item position-relative mb-3"
- @click="handleGoDetails(tab)"
- >
- <text
- class="tag bg-mask-white color-primary radius-l p-1 position-absolute size-s text-lines-1"
- >
- {{ tab.title }}
- </text>
- <image
- class="w-100 height-250 radius-base"
- :src="tab.thumbnail || tab.image || AppCofig.defaultImage"
- :style="{
- backgroundImage: `url('${tab.thumbnail || tab.image}')`,
- backgroundSize: 'cover',
- }"
- mode="aspectFit"
- />
- </view>
- </view>
- </SimplePageContentLoader>
- </view>
- </view>
- <tabbar :current="0"></tabbar>
- </template>
- <script setup lang="ts">
- const MainBoxIcon1 = 'https://mncdn.wenlvti.net/app_static/minnan/images/home/MainBoxIcon10.png';
- const MainBoxIcon2 = 'https://mncdn.wenlvti.net/app_static/minnan/images/home/MainBoxIcon2.png';
- const MainBoxIcon3 = 'https://mncdn.wenlvti.net/app_static/minnan/images/home/MainBoxIcon3.png';
- const MainBoxIcon4 = 'https://mncdn.wenlvti.net/app_static/minnan/images/home/MainBoxIcon4.png';
- const MainBoxIcon5 = 'https://mncdn.wenlvti.net/app_static/minnan/images/home/MainBoxIcon5.png';
- const MainBoxIcon6 = 'https://mncdn.wenlvti.net/app_static/minnan/images/home/MainBoxIcon6.png';
- const MainBoxIcon7 = 'https://mncdn.wenlvti.net/app_static/minnan/images/home/MainBoxIcon9.png';
- const MainBoxIcon8 = 'https://mncdn.wenlvti.net/app_static/minnan/images/home/MainBoxIcon8.png';
- const ImageTest = 'https://mncdn.wenlvti.net/app_static/minnan/images/home/ImageTest.jpg';
- import { ref, watch } from 'vue';
- import { onShareTimeline, onShareAppMessage } from '@dcloudio/uni-app';
- import { navTo } from '@/components/utils/PageAction';
- import { useSimpleDataLoader } from '@/common/composeabe/SimpleDataLoader';
- import { useSimpleListAudioPlayer } from '@/common/composeabe/SimpleAudioPlayer';
- import CommonContent, { GetContentListParams } from '@/api/CommonContent';
- import UnmoveableContent from '@/api/inheritor/UnmoveableContent';
- import SeminarContent from '@/api/inheritor/SeminarContent';
- import ProjectsContent from '@/api/inheritor/ProjectsContent';
- import ProductsContent from '@/api/inheritor/ProductsContent';
- import AppCofig from '@/common/config/AppCofig';
- import VillageApi from '@/api/inhert/VillageApi';
- import ScenicSpotContent from '@/api/fusion/ScenicSpotContent';
- import IndexContent from '@/api/introduction/IndexContent';
- import StatsText, { type StatsTextItem } from './parts/StatsText.vue';
- import HomeTitle from '@/pages/parts/HomeTitle.vue';
- import Tabbar from '@/common/components/tabs/tabbar.vue';
- import Box1AudioPlay from '@/pages/parts/Box1AudioPlay.vue';
- import SimplePageContentLoader from "@/common/components/SimplePageContentLoader.vue";
- import HorizontalScrollText from '@/components/typography/HorizontalScrollText.vue';
- import { navHomePageMiniCommonListGo } from './article/common/CommonContent';
- const subTabs = [
- {
- name: '非遗项目',
- icon: MainBoxIcon6 ,
- onClick: () => navTo('/pages/inhert/intangible/list')
- },
- {
- name: '文物古迹',
- icon: MainBoxIcon5 ,
- onClick: () => navTo('/pages/inhert/artifact/list')
- },
- {
- name: '语言文化',
- icon: MainBoxIcon1,
- onClick: () => navHomePageMiniCommonListGo({
- title: '语言文化',
- mainBodyColumnId: 235,
- modelId: 5,
- itemType: 'article-common',
- detailsPage: '/pages/article/details',
- })
- }, {
- name: '建筑文化',
- icon: MainBoxIcon8 ,
- onClick: () => navHomePageMiniCommonListGo({
- title: '建筑文化',
- mainBodyColumnId: 252,
- modelId: 3,
- itemType: 'article-common',
- detailsPage: '/pages/article/details',
- })
- },
- { name: '历史人物', icon: MainBoxIcon3, onClick: () => navTo('/pages/introduction/character/list') },
- {
- name: '民间习俗',
- icon: MainBoxIcon4,
- onClick: () => navHomePageMiniCommonListGo({
- title: '民间习俗',
- modelId: 4,
- itemType: 'article-common',
- detailsPage: '/pages/article/details',
- })
- },
- {
- name: '饮食文化',
- icon: MainBoxIcon2,
- onClick: () => navHomePageMiniCommonListGo({
- title: '饮食文化',
- mainBodyColumnId: 253,
- modelId: 3,
- itemType: 'article-common',
- detailsPage: '/pages/article/details',
- })
- },
- {
- name: '海洋文化',
- icon: 'https://mncdn.wenlvti.net/app_static/minnan/images/home/MainBoxIcon11.png',
- onClick: () => navHomePageMiniCommonListGo({
- title: '海洋文化',
- mainBodyColumnId: 254,
- modelId: 3,
- itemType: 'article-common',
- detailsPage: '/pages/article/details',
- })
- },
- /* {
- name: '老字号',
- icon: MainBoxIcon7 ,
- onClick: () => navTo('/pages/inhert/old/list')
- }, */
- ];
- const mapCtx = uni.createMapContext('map');
- const mapTab = ref(1);
- const mapLoader = useSimpleDataLoader(async () => {
- let list ;
- switch (mapTab.value) {
- default:
- case 1:
- list = (await ProjectsContent.getContentList(new GetContentListParams(), 1, 6)).list
- break;
- case 2:
- list = (await SeminarContent.getContentList(new GetContentListParams(), 1, 6)).list
- break;
- case 3:
- list = (await UnmoveableContent.getContentList(new GetContentListParams(), 1, 6)).list
- break;
- case 4:
- list = (await VillageApi.getVallageList()).slice(1, 10)
- break;
- case 5:
- list = (await ScenicSpotContent.getContentList(new GetContentListParams(), 1, 6)).list
- break;
- }
- const res = list.map((p) => {
- return {
- ...p,
- id: p.id,
- longitude: Number(p.longitude),
- latitude: Number(p.latitude),
- iconPath: p.thumbnail,
- width: 40,
- height: 40,
- };
- });
- mapCtx.includePoints({
- points: res.map(p => {
- if (!p.longitude || !p.latitude) {
- p.longitude = AppCofig.defaultLonLat[0];
- p.latitude = AppCofig.defaultLonLat[1];
- }
- return {
- latitude: p.latitude,
- longitude: p.longitude,
- }
- }),
- padding: [20, 20, 20, 20],
- });
- return res;
- }, true, undefined, true);
- watch(mapTab, () => mapLoader.loadData(undefined, true));
- const indexAudioPlayer = useSimpleListAudioPlayer(async () => {
- return (await CommonContent.getContentList(new GetContentListParams()
- .setModelId(5)
- .setMainBodyColumnId(313)
- , 1, 6)).list.sort(() => Math.random()>0.5?-1:1).map((p) => {
- return {
- id: p.id,
- title: p.title,
- image: p.thumbnail || p.image,
- src: p.audio as string,
- }
- });
- })
- function handleGoAudioList() {
- navTo('/pages/inhert/language/list')
- }
- const recommendLoader = useSimpleDataLoader(async () => {
- const list = [];
- list.push(...(await ProjectsContent.getContentList(new GetContentListParams(), 1, 6)).list.map((p) => {
- p.itemType = 'intangible';
- return p;
- }));
- list.push(...(await CommonContent.getContentList(new GetContentListParams()
- .setModelId(1)
- , 1, 6)).list.map((p) => {
- p.itemType = p.type == GetContentListParams.TYPE_VIDEO ? 'video' : 'artifact';
- return p;
- }));
- /* list.push(...(await ProductsContent.getContentList(new GetContentListParams(), 1, 6)).list.map((p) => {
- p.itemType = p.type == GetContentListParams.TYPE_VIDEO ? 'video' : 'intangible';
- return p;
- })); */
- return list;
- });
- const statsText1 = ref('');
- const statsText2 = ref('');
- const statsLoader = useSimpleDataLoader(async () => {
- const data = (await IndexContent.getStats());
- const semiCount = (await SeminarContent.getContentList(new GetContentListParams(), 1, 6)).total;
- const unmoveableCount = (await UnmoveableContent.getContentList(new GetContentListParams(), 1, 6)).total;
-
- let sumInheritor = 0;
- let sumProject = 0;
- const topLevelProject = data.ichData.find((p: any) => p.level_text == '人类非遗')?.total || 0;
- const secondLevelProject = data.ichData.find((p: any) => p.level_text == '国家级')?.total || 0;
- const thirdLevelProject = data.ichData.find((p: any) => p.level_text == '省级')?.total || 0;
- const forthLevelProject = data.ichData.find((p: any) => p.level_text == '市级')?.total || 0;
- const topLevelInheritor = data.ichData.find((p: any) => p.level_text == '国家级')?.total || 0;
- const secondLevelInheritor = data.ichData.find((p: any) => p.level_text == '省级')?.total || 0;
- const thirdLevelInheritor = data.ichData.find((p: any) => p.level_text == '市级')?.total || 0;
- const projects = (data.ichData as any[]).filter((p: any) => [ '人类非遗', '国家级', '省级', '市级' ].includes(p.level_text)).map((item: any) => {
- if (item.level_text != '人类非遗')
- sumProject += item.total;
- return {
- title: item.level_text,
- value: item.total,
- onClick: () => navTo('/pages/inhert/intangible/list', { tab: 0, level: item.level }),
- } as StatsTextItem
- });
- const inheritors = data.inheritorData.filter((p: any) => [ '国家级', '省级', '市级' ].includes(p.title)).map((item: any) => {
- sumInheritor += item.total;
- return {
- title: item.title,
- value: item.total,
- onClick: () => navTo('/pages/inhert/inheritor/list', { level: item.level }),
- }
- }).concat([
- {
- title: '',
- value: '',
- }
- ]);
- statsText1.value = `目前厦门市非遗项目市级以上共有 ${sumProject} 项,其中:国家级 ${secondLevelProject} 项(含 ${topLevelProject} 项为人类非遗)、省级 ${thirdLevelProject} 项、市级 ${forthLevelProject} 项。`;
- statsText2.value = `目前厦门市非遗传承人市级以上共有 ${sumInheritor} 人,其中:国家级 ${topLevelInheritor} 人、省级 ${secondLevelInheritor} 人、市级 ${thirdLevelInheritor} 人。`;
-
- /* projects.splice(1, 0, {
- title: `(其中${topLevelProject}项为人类非遗)`,
- value: ' ',
- longTitle: true,
- onClick: () => navTo('/pages/inhert/intangible/list', { tab: 0, level: 0 }),
- }) */
- return [
- {
- title: '非遗项目',
- datas: projects
- },
- {
- title: '非遗传承人',
- datas: inheritors
- },
- {
- datas: [
- {
- title: '非遗传习所',
- value: semiCount,
- onClick: () => navTo('/pages/inhert/map/index', { tab: 2 }),
- },
- {
- title: '传统村落',
- value: data.villageData[0].total,
- onClick: () => navTo('/pages/inhert/village/list'),
- },
- {
- title: '文物古迹',
- value: unmoveableCount,
- onClick: () => navTo('/pages/inhert/artifact/list'),
- },
- ],
- },
- {
- title: '不可移动文物',
- type: 'none',
- datas: data.crData.map((item: any) => {
- return {
- title: item.title,
- value: item.total
- }
- })
- },
- {
- title: '闽南文化重要相关文物古迹',
- type: 'none',
- datas: data.minnanCr.map((item: any) => {
- return {
- title: item.title,
- value: item.total
- }
- })
- },
- {
- title: '重要相关历史风貌区',
- type: 'none',
- datas: data.historyData.map((item: any) => {
- return {
- title: item.title,
- value: item.total
- }
- })
- },
- {
- title: '传习中心',
- type: 'none',
- datas: data.ichCenter.map((item: any) => {
- return {
- title: item.title,
- value: item.total
- }
- })
- },
- ]
- });
- function handleGoDetails(item: any) {
- switch (item.itemType) {
- case 'artifact':
- navTo('/pages/inhert/artifact/details', { id: item.id });
- break;
- case 'intangible':
- navTo('/pages/inhert/intangible/details', { id: item.id });
- break;
- case 'video':
- navTo('/pages/video/details', { id: item.id, modelId: item.modelId, mainBodyColumnId: item.mainBodyColumnId });
- break;
- default:
- navTo('/pages/article/details', { id: item.id, modelId: item.modelId, mainBodyColumnId: item.mainBodyColumnId });
- break;
- }
- }
- onShareTimeline(() => {
- return {};
- })
- onShareAppMessage(() => {
- return {};
- })
- </script>
- <style lang="scss">
- .page-home {
- .content {
- margin-top: 470rpx;
- }
- .map-tags {
- left: 0;
- top: 0;
- padding: 15rpx 0;
- font-size: 25rpx;
- .tag-bar {
- padding: 0 20rpx;
- view {
- display: flex;
- flex-direction: row;
- align-items: center;
- flex-shrink: 0;
- border-radius: 40rpx;
- padding: 10rpx 15rpx;
- background-color: #f7f3e8;
- color: #d9492e;
- margin-right: 10rpx;
- .iconfont {
- margin-right: 8rpx;
- }
- &.active {
- background-color: #d9492e;
- color: #f7f3e8;
- }
- }
- }
- }
- .grid4-item {
- width: 320rpx;
- .tag {
- top: 2rpx;
- right: 2rpx;
- }
- }
- .main-banner-box {
- position: relative;
- display: flex;
- flex-direction: column;
- overflow: hidden;
- border-radius: 15rpx;
- background: linear-gradient(180deg, #E5CDAB 0%, #F0E3D6 100%), #F7F3E8;
- padding: 20rpx;
- font-family: "SongtiSCBlack";
- color: #432A04;
- .title {
- font-size: 40rpx;
- }
- text {
- font-size: 35rpx;
- margin-top: 10rpx;
- }
- .more {
- margin-top: 30rpx;
- padding: 10rpx 20rpx;
- width: 150rpx;
- background-image: url('https://mncdn.wenlvti.net/app_static/minnan/images/home/MainBanner.png');
- background-size: 100% auto;
- background-repeat: no-repeat;
- text {
- font-family: initial;
- font-size: 30rpx;
- }
- }
- .footer {
- position: absolute;
- right: 0;
- bottom: 0;
- width: 370rpx;
- z-index: 2;
- height: auto;
- }
- }
- }
- </style>
|