|
|
@@ -0,0 +1,193 @@
|
|
|
+<template>
|
|
|
+ <FlexCol :gap="20" :padding="20">
|
|
|
+ <FlexCol :radius="15" overflow="hidden">
|
|
|
+ <ImageSwiper
|
|
|
+ :height="200"
|
|
|
+ :images="[
|
|
|
+ 'https://mn.wenlvti.net/app_static/minnan/images/home/BackgroundBanner5.jpg',
|
|
|
+ 'https://mn.wenlvti.net/app_static/minnan/images/home/BackgroundBanner4.jpg',
|
|
|
+ 'https://mn.wenlvti.net/app_static/minnan/images/home/BackgroundBanner3.jpg',
|
|
|
+ ]"
|
|
|
+ />
|
|
|
+ </FlexCol>
|
|
|
+ <Box title="传统村落分布" icon="/static/images/home/icon-pin-distance.png">
|
|
|
+ <map
|
|
|
+ id="map"
|
|
|
+ class="w-100 height-400 radius-base overflow-hidden"
|
|
|
+ :markers="mapLoader.content.value || []"
|
|
|
+ :enable-zoom="false"
|
|
|
+ :enable-scroll="false"
|
|
|
+ :scale="15"
|
|
|
+ />
|
|
|
+ </Box>
|
|
|
+ <Box title="优秀线上村史馆" icon="/static/images/home/icon-ancient-gate.png">
|
|
|
+ <SimplePageContentLoader :loader="recommendLoader">
|
|
|
+ <FlexRow justify="space-between" align="center" wrap :gap="15">
|
|
|
+ <Touchable
|
|
|
+ v-for="(item, i) in recommendLoader.content.value"
|
|
|
+ :key="i"
|
|
|
+ flex="0 0 48%"
|
|
|
+ align="center"
|
|
|
+ direction="column"
|
|
|
+ >
|
|
|
+ <Image
|
|
|
+ :src="item.thumbnail || item.image"
|
|
|
+ width="100%"
|
|
|
+ height="200rpx"
|
|
|
+ :radius="15"
|
|
|
+ mode="aspectFill"
|
|
|
+ round
|
|
|
+ />
|
|
|
+ <Text :text="item.title" />
|
|
|
+ </Touchable>
|
|
|
+ </FlexRow>
|
|
|
+ </SimplePageContentLoader>
|
|
|
+ </Box>
|
|
|
+ <Box title="发现" icon="/static/images/home/icon-compass.png" showMore @moreClicked="$emit('goDiscover')">
|
|
|
+ <SimplePageContentLoader :loader="discoverLoader">
|
|
|
+ <FlexCol :gap="15">
|
|
|
+ <Touchable
|
|
|
+ v-for="(item, i) in discoverLoader.content.value"
|
|
|
+ :key="i"
|
|
|
+ justify="space-between"
|
|
|
+ align="center"
|
|
|
+ direction="row"
|
|
|
+ >
|
|
|
+ <FlexCol flex="1">
|
|
|
+ <Text :text="item.title" fontConfig="h5" />
|
|
|
+ <Text :text="item.desc" fontConfig="subText" />
|
|
|
+ </FlexCol>
|
|
|
+ <Width :width="25" />
|
|
|
+ <Image
|
|
|
+ :src="item.thumbnail || item.image"
|
|
|
+ :width="120"
|
|
|
+ :height="120"
|
|
|
+ :radius="15"
|
|
|
+ mode="aspectFill"
|
|
|
+ round
|
|
|
+ />
|
|
|
+ </Touchable>
|
|
|
+ </FlexCol>
|
|
|
+ </SimplePageContentLoader>
|
|
|
+ </Box>
|
|
|
+ <Loadmore status="nomore" />
|
|
|
+ <Height :height="150" />
|
|
|
+ </FlexCol>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup lang="ts">
|
|
|
+import Box from '@/common/components/parts/Box.vue';
|
|
|
+import ImageSwiper from '@/common/components/parts/ImageSwiper.vue';
|
|
|
+import SimplePageContentLoader from '@/common/components/SimplePageContentLoader.vue';
|
|
|
+import { useSimpleDataLoader } from '@/common/composeabe/SimpleDataLoader';
|
|
|
+import AppCofig from '@/common/config/AppCofig';
|
|
|
+import Image from '@/components/basic/Image.vue';
|
|
|
+import Text from '@/components/basic/Text.vue';
|
|
|
+import Loadmore from '@/components/display/loading/Loadmore.vue';
|
|
|
+import Touchable from '@/components/feedback/Touchable.vue';
|
|
|
+import FlexCol from '@/components/layout/FlexCol.vue';
|
|
|
+import FlexRow from '@/components/layout/FlexRow.vue';
|
|
|
+import Height from '@/components/layout/space/Height.vue';
|
|
|
+import Width from '@/components/layout/space/Width.vue';
|
|
|
+import { RandomUtils } from '@imengyu/imengyu-utils';
|
|
|
+
|
|
|
+function testImage() {
|
|
|
+ return 'https://mncdn.wenlvti.net/app_static/minnan/images/home/ImageTest' + RandomUtils.genRandom(1, 5) +'.jpg';
|
|
|
+}
|
|
|
+
|
|
|
+const mapCtx = uni.createMapContext('map');
|
|
|
+const mapLoader = useSimpleDataLoader(async () => {
|
|
|
+ const res = [
|
|
|
+ {
|
|
|
+ title: '传统村落',
|
|
|
+ longitude: Number(118.11441371826822),
|
|
|
+ latitude: Number(24.51019917828817),
|
|
|
+ iconPath: testImage(),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '传统村落',
|
|
|
+ longitude: Number(118.18573604529888),
|
|
|
+ latitude: Number(24.485581319259357),
|
|
|
+ iconPath: testImage(),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '传统村落',
|
|
|
+ longitude: Number(118.1242512731751),
|
|
|
+ latitude: Number(24.417297514622685),
|
|
|
+ iconPath: testImage(),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '传统村落',
|
|
|
+ longitude: Number(118.23861292755578),
|
|
|
+ latitude: Number(24.559407658427826),
|
|
|
+ iconPath: testImage(),
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ 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;
|
|
|
+});
|
|
|
+
|
|
|
+const recommendLoader = useSimpleDataLoader(async () => {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ title: '茶艺传承作坊',
|
|
|
+ desc: '',
|
|
|
+ image: testImage(),
|
|
|
+ thumbnail: testImage(),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '茶艺传承作坊',
|
|
|
+ desc: '',
|
|
|
+ image: testImage(),
|
|
|
+ thumbnail: testImage(),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '茶艺传承作坊',
|
|
|
+ desc: '',
|
|
|
+ image: testImage(),
|
|
|
+ thumbnail: testImage(),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '茶艺传承作坊',
|
|
|
+ desc: '',
|
|
|
+ image: testImage(),
|
|
|
+ thumbnail: testImage(),
|
|
|
+ },
|
|
|
+ ]
|
|
|
+});
|
|
|
+
|
|
|
+const discoverLoader = useSimpleDataLoader(async () => {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ title: '茶艺传承作坊',
|
|
|
+ desc: '多馆联展,沉浸式交互体验。多馆联展,沉浸式交互体验。',
|
|
|
+ image: testImage(),
|
|
|
+ thumbnail: testImage(),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '茶艺传承作坊',
|
|
|
+ desc: '多馆联展,沉浸式交互体验。多馆联展,沉浸式交互体验。',
|
|
|
+ image: testImage(),
|
|
|
+ thumbnail: testImage(),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '茶艺传承作坊',
|
|
|
+ desc: '多馆联展,沉浸式交互体验。多馆联展,沉浸式交互体验。',
|
|
|
+ image: testImage(),
|
|
|
+ thumbnail: testImage(),
|
|
|
+ },
|
|
|
+ ]
|
|
|
+});
|
|
|
+</script>
|