fix(aigc): correct generated media preview handling
update ResultPreview component to use proper image and video result URLs refine isVideo detection logic across detail and shared work pages add pointer-events none to preview elements to avoid blocking user interactions standardize media URL usage between AIGC detail and shared work components
This commit is contained in:
@@ -7,9 +7,9 @@
|
||||
|
||||
<view class="shared-work-scroll">
|
||||
<template v-if="shareDetail">
|
||||
<video v-if="isVideo" class="shared-work-media is-video" :src="shareDetail.videoUrl"
|
||||
:poster="shareDetail.imageUrl" controls object-fit="cover" />
|
||||
<image v-else-if="shareDetail.imageUrl" class="shared-work-media" :src="shareDetail.imageUrl"
|
||||
<video v-if="isVideo" class="shared-work-media is-video" :src="videoResultUrl"
|
||||
:poster="imageResultUrl" controls object-fit="cover" />
|
||||
<image v-else-if="imageResultUrl" class="shared-work-media" :src="imageResultUrl"
|
||||
mode="aspectFill" />
|
||||
|
||||
<view class="shared-work-meta">
|
||||
@@ -37,8 +37,16 @@ import { getAigcGeneratorTaskShareDetail } from "@/request/api/AigcApi.js";
|
||||
const shareKey = ref("");
|
||||
const shareDetail = ref(null);
|
||||
|
||||
const imageResultUrl = computed(() => {
|
||||
return shareDetail.value?.imageResultUrl || shareDetail.value?.imageUrl || "";
|
||||
});
|
||||
|
||||
const videoResultUrl = computed(() => {
|
||||
return shareDetail.value?.videoResultUrl || shareDetail.value?.videoUrl || "";
|
||||
});
|
||||
|
||||
const isVideo = computed(() => {
|
||||
return Number(shareDetail.value?.generatorType) === 1 && Boolean(shareDetail.value?.videoUrl);
|
||||
return Number(shareDetail.value?.generatorType) === 1 && Boolean(videoResultUrl.value);
|
||||
});
|
||||
|
||||
const generatorTypeText = computed(() => {
|
||||
|
||||
Reference in New Issue
Block a user