Commit 0a9171d5 authored by 王玉鑫's avatar 王玉鑫

fix: 详情页vr跳转修正

parent 913a52ac
<!-- 图片展示,方便修改占位图、错误图 --> <!-- 图片展示,方便修改占位图、错误图 -->
<template> <template>
<ElImage :src="src"> <ElImage :src="src" @click="handleClick">
<template #placeholder> <template #placeholder>
<img class="h-full w-full" :src="currentdefault" /> <img class="h-full w-full" :src="currentdefault" @click.stop="handleClick" />
</template>
<template #error>
<img class="h-full w-full" :src="currentdefault" @click.stop="handleClick" />
</template> </template>
<template #error><img class="h-full w-full" :src="currentdefault" /></template>
</ElImage> </ElImage>
</template> </template>
...@@ -30,6 +32,8 @@ const props = withDefaults( ...@@ -30,6 +32,8 @@ const props = withDefaults(
}, },
); );
const emit = defineEmits(['click']);
const currentdefault = computed(() => { const currentdefault = computed(() => {
const config: Record<DetailType, string> = { const config: Record<DetailType, string> = {
[DetailType.carrier]: defaultCarrierPic, [DetailType.carrier]: defaultCarrierPic,
...@@ -40,4 +44,8 @@ const currentdefault = computed(() => { ...@@ -40,4 +44,8 @@ const currentdefault = computed(() => {
}; };
return props.type ? config[props.type] : defaultPicIcon; return props.type ? config[props.type] : defaultPicIcon;
}); });
const handleClick = () => {
emit('click');
};
</script> </script>
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
<div <div
v-if="image?.href" v-if="image?.href"
class="vr-icon absolute left-1/2 top-1/2 z-20 -translate-x-1/2 -translate-y-1/2 cursor-pointer" class="vr-icon absolute left-1/2 top-1/2 z-20 -translate-x-1/2 -translate-y-1/2 cursor-pointer"
@click="handleClick(image?.href)"
></div> ></div>
</SwiperSlide> </SwiperSlide>
</Swiper> </Swiper>
......
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