| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142 |
- <template>
- <FlexCol :padding="30" :gap="20">
- <ImageSwiper
- :images="imageList"
- :radius="20"
- round
- mode="widthFix"
- :width="690"
- />
- <FlexCol v-if="overviewLoader.content.value">
- <SubTitle :title="overviewLoader.content.value.villageName || querys.villageName" />
- <IntroBlock
- small
- :descItems="[
- {
- label: '村落类型',
- value: overviewLoader.content.value.villageTypeText ,
- },
- {
- label: '地址',
- value: overviewLoader.content.value.cityAddress?.join(' '),
- },
- ]"
- />
- <FlexCol :margin="[20, 0, 0, 0]">
- <Parse :content="overviewLoader.content.value.overview" :tagStyle="commonParserStyle" />
- <Text v-if="!overviewLoader.content.value.overview" fontConfig="subText">暂无采编简内容</Text>
- </FlexCol>
- </FlexCol>
- <FlexCol :gap="20">
- <CollectModuleList
- :villageId="querys.villageId"
- :villageVolunteerId="querys.villageVolunteerId"
- :taskName="''"
- :taskTitle="''"
- :taskPid="0"
- isView
- />
- </FlexCol>
- <FlexCol :margin="[20, 0, 30, 0]">
- <SubTitle title="地理位置" />
- <FlexCol :radius="20" backgroundColor="white" :margin="[20, 0, 0, 0]">
- <map
- id="map"
- :latitude="center[1]"
- :longitude="center[0]"
- :markers="markers"
- :scale="15"
- :style="{
- width: '100%',
- height: '350rpx',
- }"
- />
- </FlexCol>
- </FlexCol>
- <XBarSpace />
- </FlexCol>
- </template>
- <script setup lang="ts">
- import { computed, ref } from 'vue';
- import { useLoadQuerys } from '@/common/composeabe/LoadQuerys';
- import { useSimpleDataLoader } from '@/common/composeabe/SimpleDataLoader';
- import { useCollectStore } from '@/store/collect';
- import FlexCol from '@/components/layout/FlexCol.vue';
- import CollectModuleList from '../components/CollectModuleList.vue';
- import XBarSpace from '@/components/layout/space/XBarSpace.vue';
- import ImageSwiper from '@/common/components/parts/ImageSwiper.vue';
- import VillageInfoApi, { CommonInfoModel } from '@/api/inhert/VillageInfoApi';
- import SubTitle from '@/components/display/title/SubTitle.vue';
- import IntroBlock from '@/pages/article/common/IntroBlock.vue';
- import Parse from '@/components/display/parse/Parse.vue';
- import Text from '@/components/basic/Text.vue';
- import commonParserStyle from '@/common/style/commonParserStyle';
- import ImagesUrls from '@/common/config/ImagesUrls';
- const { querys } = useLoadQuerys({
- villageId: 0,
- villageName: '',
- villageVolunteerId: 0,
- });
- const { getCollectModuleId } = useCollectStore();
- const center = ref([118.15723, 24.48147]);
- const markers = ref<any>([]);
-
- const imageList = computed(() => {
- const content = overviewLoader.content.value;
- if (!content) return [];
- if (content.images && content.images.length > 0)
- return content.images;
- if (content.image)
- return [content.image];
- return ["https://mn.wenlvti.net/app_static/xiangan/banner_dig_1.jpg" ];
- });
- const overviewLoader = useSimpleDataLoader<CommonInfoModel>(async () => {
- const subType = 'overview';
- const collectModuleId = getCollectModuleId('overview');
- const list = await VillageInfoApi.getList(
- collectModuleId, subType, undefined, undefined,
- querys.value.villageId, querys.value.villageVolunteerId
- );
- if (list.length > 0) {
- const info = (await VillageInfoApi.getInfo(
- collectModuleId,
- subType,
- undefined,
- undefined,
- querys.value.villageId,
- querys.value.villageVolunteerId,
- undefined,
- list[0].id,
- )) as CommonInfoModel
- if (info.longitude && info.latitude) {
- center.value = [Number(info.longitude), Number(info.latitude)];
- } else {
- center.value = [118.11593, 24.467580];
- }
- markers.value = [
- {
- id: 1,
- latitude: center.value[1],
- longitude: center.value[0],
- iconPath: ImagesUrls.IconMarker,
- width: 40,
- height: 40,
- }
- ];
- return info;
- }
- return new CommonInfoModel();
- });
- </script>
|