Commit 7c88bc77 authored by 王玉鑫's avatar 王玉鑫

feat: 默认图修改

parent f4534a2d
......@@ -2,19 +2,42 @@
<template>
<ElImage :src="src">
<template #placeholder>
<img class="h-full w-full" src="@/assets/images/default-pic.png" />
<img class="h-full w-full" :src="currentdefault" />
</template>
<template #error><img class="h-full w-full" src="@/assets/images/default-pic.png" /></template>
</ElImage>
</template>
<script setup lang="ts">
withDefaults(
import defaultPicIcon from '@/assets/images/default-pic.png';
import defaultParkPic from '@/assets/images/default-pic__park.png';
import defaultDevelopPic from '@/assets/images/default-pic__develop.png';
import defaultCarrierPic from '@/assets/images/default-pic__carrier.png';
import defaultLandPic from '@/assets/images/default-pic__land.png';
import { DetailType } from '@/types/enum.ts';
import { computed } from 'vue';
const props = withDefaults(
defineProps<{
src?: string | null;
defaultPic?: string;
type?: DetailType | null;
}>(),
{
src: null,
defaultPic: defaultPicIcon,
type: null,
},
);
const currentdefault = computed(() => {
const config: Record<DetailType, string> = {
[DetailType.carrier]: defaultCarrierPic,
[DetailType.land]: defaultLandPic,
[DetailType.industrial]: defaultParkPic,
[DetailType.develop]: defaultDevelopPic,
[DetailType.startDevelop]: defaultDevelopPic,
};
return props.type ? config[props.type] : defaultPicIcon;
});
</script>
......@@ -13,6 +13,7 @@
class="h-[434px] w-full"
:class="{ 'cursor-pointer': image?.href }"
:src="image?.url"
:type="detailType"
@click="handleClick(image?.href)"
/>
<div
......@@ -36,6 +37,7 @@
class="h-[92px] w-[130px] cursor-pointer rounded"
:class="{ 'border border-[#2878ff] p-1': index === currentIndex }"
:src="image.url"
:type="detailType"
/>
</SwiperSlide>
</Swiper>
......@@ -65,10 +67,12 @@ import { Swiper, SwiperSlide } from 'swiper/vue';
import { computed, ref } from 'vue';
import CommonImage from '@/components/common/CommonImage.vue';
import type { Swiper as SwiperType } from 'swiper/types';
import type { DetailType } from '@/types/enum.ts';
const props = withDefaults(
defineProps<{
images: { url: string; href?: string }[];
detailType: DetailType;
}>(),
{
images: () => [],
......
......@@ -27,7 +27,7 @@
<!-- main content -->
<div class="mt-4 flex">
<div>
<ImageList :images="mainImageList"></ImageList>
<ImageList :images="mainImageList" :detail-type="type"></ImageList>
</div>
<div class="ml-[30px] mt-4 flex flex-1 flex-col">
<div>
......
......@@ -2,7 +2,11 @@
<template>
<div v-if="detail" class="w-[274px]">
<div @click="handleDetail">
<CommonImage class="h-[204px] w-full cursor-pointer rounded-sm" :src="detail.imgUrl" />
<CommonImage
class="h-[204px] w-full cursor-pointer rounded-sm"
:src="detail.imgUrl"
:type="detailType"
/>
</div>
<div
class="ell2 mt-3 cursor-pointer font-yahei text-lg leading-6 text-[#1A1A1A]"
......@@ -17,6 +21,7 @@
</template>
<script lang="ts" setup>
import CommonImage from '@/components/common/CommonImage.vue';
import type { DetailType } from '@/types/enum.ts';
export interface MiniDetail {
imgUrl: string;
......@@ -27,6 +32,7 @@ export interface MiniDetail {
withDefaults(
defineProps<{
detail: MiniDetail;
detailType: DetailType;
}>(),
{},
);
......
......@@ -26,7 +26,12 @@
:src="item.videourl"
:cover="item.videoCover!"
></CommonVideo>
<CommonImage v-else class="h-full w-full" :src="item.videourl"></CommonImage>
<CommonImage
v-else
class="h-full w-full"
:src="item.videourl"
:type="DetailType.develop"
></CommonImage>
</SwiperSlide>
</Swiper>
<div
......@@ -76,6 +81,7 @@ import { Swiper, SwiperSlide } from 'swiper/vue';
import type { Swiper as SwiperType } from 'swiper/types';
import { Autoplay } from 'swiper/modules';
import { computed, ref, nextTick, onMounted } from 'vue';
import { DetailType } from '@/types/enum.ts';
import CommonVideo from '../common/CommonVideo.vue';
import CommonImage from '../common/CommonImage.vue';
......
......@@ -5,6 +5,7 @@
<CommonImage
class="h-[156px] w-[208px] cursor-pointer rounded-sm"
:src="item.imgUrl"
:type="isDevelop ? DetailType.develop : DetailType.industrial"
:alt="isDevelop ? '开发区' : '产业园'"
/>
<div
......@@ -59,7 +60,7 @@ import type { IndustrialParkItem } from '@/types/api/industrialParkList.ts';
import { filterAddress, formatNumber } from '@/utils/filters.ts';
import { computed } from 'vue';
import type { DevelopZoneItem } from '@/types/api/developZoneList';
import { ParkItemType } from '@/types/enum.ts';
import { DetailType, ParkItemType } from '@/types/enum.ts';
import CommonImage from '@/components/common/CommonImage.vue';
import ListInfo from './ListInfo.vue';
......
<template>
<div class="flex">
<div class="media-left relative mr-4 cursor-pointer" @click="handleDetail">
<CommonImage class="h-[156px] w-[208px]" :src="detail.imgUrl" alt="" />
<CommonImage
class="h-[156px] w-[208px]"
:src="detail.imgUrl"
:type="DetailType.carrier"
alt=""
/>
<div v-if="detail.isVr" class="absolute bottom-2 left-2">
<img class="h-[45px] w-[45px] rounded-[50%]" src="@/assets/images/vr-icon.png" />
</div>
......@@ -36,6 +41,7 @@
import type { CarrierListItem } from '@/types/api/carrierList';
import CommonImage from '@/components/common/CommonImage.vue';
import { formatNumber } from '@/utils/filters.ts';
import { DetailType } from '@/types/enum.ts';
withDefaults(
defineProps<{
......
<template>
<div class="flex">
<div class="media-left relative mr-4 cursor-pointer" @click="handleDetail">
<CommonImage class="h-[156px] w-[208px]" :src="detail.imgUrl" alt="" />
<CommonImage
class="h-[156px] w-[208px]"
:type="DetailType.land"
:src="detail.imgUrl"
alt=""
/>
<div v-if="detail.isVr" class="absolute bottom-2 left-2">
<img class="h-[45px] w-[45px] rounded-[50%]" src="@/assets/images/vr-icon.png" />
</div>
......@@ -42,6 +47,7 @@
import type { LandListItem } from '@/types/api/landList';
import CommonImage from '@/components/common/CommonImage.vue';
import { formatNumber } from '@/utils/filters.ts';
import { DetailType } from '@/types/enum.ts';
withDefaults(
defineProps<{
......
......@@ -58,7 +58,7 @@
<DetailInfoCell v-if="industryFund.length" :infos="industryFund" title="产业基金">
<DetailInfo :infos="industryFund"></DetailInfo>
</DetailInfoCell>
<DetailInfoCell title="周边配套" title-center v-if="detail.latitude">
<DetailInfoCell v-if="detail.latitude" title="周边配套" title-center>
<MapView :lat="detail.latitude" :lng="detail.longitude"></MapView>
</DetailInfoCell>
<DetailInfoCell
......@@ -74,6 +74,7 @@
v-for="item of industrials.slice(0, 4)"
:key="item.name"
:detail="item"
:detail-type="DetailType.industrial"
@to-detail="toIndustrialDetail(item)"
></MiniListItem>
</div>
......@@ -91,6 +92,7 @@
v-for="item of lands.slice(0, 4)"
:key="item.name"
:detail="item"
:detail-type="DetailType.land"
@to-detail="toLandDetail(item)"
></MiniListItem>
</div>
......
......@@ -162,7 +162,12 @@
class="relative w-[272px] cursor-pointer"
@click="toDetail(item)"
>
<CommonImage class="h-[205px] w-[272px] rounded-sm" :src="item.imgUrl" alt="" />
<CommonImage
:type="currentListType"
class="h-[205px] w-[272px] rounded-sm"
:src="item.imgUrl"
alt=""
/>
<span
v-if="item.isSuper"
class="absolute left-0 top-0 block rounded-tl-sm bg-[#C0322B] px-3 text-sm font-semibold leading-[26px] text-white"
......@@ -298,6 +303,7 @@ import { filterAddress, formatNumber } from '@/utils/filters.ts';
import ListInfo from '@/components/list/ListInfo.vue';
import { useMessage } from '@/composable/useMessage.ts';
import { useSearchParamsStore } from '@/stores/searchParams.ts';
import { DetailType } from '@/types/enum.ts';
const { open } = useJump();
const searchParamsStore = useSearchParamsStore();
......@@ -336,6 +342,17 @@ const selectedCity = computed(() => {
return searchParamsStore.globalProvinceName;
});
/** 当前列表类型 */
const currentListType = computed(() => {
const config: Record<string, DetailType> = {
develop: DetailType.develop,
carrier: DetailType.carrier,
industrial: DetailType.industrial,
land: DetailType.land,
};
return config[activeTab.value]!;
});
const toList = (type: string = 'search') => {
let name: RouteName = RouteName.developZoneList;
let filterType: string = searchType.value;
......
......@@ -91,7 +91,7 @@
</div>
</div>
</DetailInfoCell>
<DetailInfoCell title="周边配套" title-center v-if="detail.latitude">
<DetailInfoCell v-if="detail.latitude" title="周边配套" title-center>
<MapView :lat="detail.latitude" :lng="detail.longitude"></MapView>
</DetailInfoCell>
<DetailInfoCell
......@@ -107,6 +107,7 @@
v-for="item of carriers.slice(0, 4)"
:key="item.name"
:detail="item"
:detail-type="DetailType.carrier"
@to-detail="toCarrierDetail(item)"
></MiniListItem>
</div>
......
......@@ -36,6 +36,7 @@
v-for="img of detail.imgUrlList"
:key="img"
class="h-[124px] w-[124px]"
:type="DetailType.develop"
:src="img"
></CommonImage>
</div>
......
......@@ -37,6 +37,7 @@
:key="img"
class="h-[124px] w-[124px]"
:src="img"
:type="DetailType.industrial"
></CommonImage>
</div>
</DetailInfoCell>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment