| | |
| | | <div class="detailTop"> |
| | | <div class="image-container"> |
| | | <van-swipe :autoplay="3000" indicator-color="#4C85FF"> |
| | | <van-swipe-item v-for="(img, index) in getImageList" :key="index"> |
| | | <van-swipe-item v-for="(img, index) in [imgSrc]" :key="index"> |
| | | <van-image class="detailImage" :src="img" fit="cover" width="100%" height="235px" |
| | | @click="openPreview(index)" preview-visible="false" /> |
| | | </van-swipe-item> |
| | |
| | | import { showToast, showNotify, showImagePreview } from 'vant' |
| | | import { getShowImg, getSmallImg } from '@/utils/util' |
| | | import { useRoute,useRouter } from 'vue-router' |
| | | import { getAiImg } from '@ztzf/utils' |
| | | const keyword = ref('') |
| | | const route = useRoute() |
| | | const router = useRouter() |
| | |
| | | } |
| | | return imageArr |
| | | }) |
| | | const openPreview = index => { |
| | | const detail = workDetailData.value |
| | | const showUrl = detail.eventImageUrl |
| | | const openPreview = () => { |
| | | showImagePreview({ |
| | | images: [showUrl], |
| | | images: [imgSrc.value], |
| | | startPosition: 0, |
| | | }) |
| | | } |
| | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const imgSrc = ref('') |
| | | onMounted(async () => { |
| | | keyword.value = JSON.parse(route.query.workDetailData) |
| | | try { |
| | | const res = await getSharingDetailsApi({ cacheKey: keyword.value }) |
| | | workDetailData.value = res.data.data |
| | | const {eventImageUrl,geojson} = workDetailData.value |
| | | if (eventImageUrl){ |
| | | imgSrc.value = geojson ? await getAiImg(eventImageUrl,geojson) : eventImageUrl |
| | | } |
| | | } catch (error) { |
| | | showToast('分享链接失效') |
| | | } |