feat(aigc): 新增升视频生成类型并修复相关展示逻辑
- 添加生成类型2的“升视频”映射到详情页和记录卡片配置中 - 优化共享作品页面的生成类型文本展示逻辑以适配新类型 - 调整未知生成类型的默认显示文本为“生成作品”
This commit is contained in:
@@ -65,6 +65,7 @@ const pointDialogVisible = ref(false);
|
||||
const GENERATOR_TYPE_TEXT = {
|
||||
0: "图片版",
|
||||
1: "视频版",
|
||||
2: "升视频",
|
||||
};
|
||||
|
||||
const TASK_STATUS_TEXT = {
|
||||
@@ -92,7 +93,7 @@ const result = computed(() => {
|
||||
|
||||
const imageUrl = record.imageResultUrl || "";
|
||||
const videoUrl = record.videoResultUrl || "";
|
||||
const isVideo = [1, 2].includes(Number(record.generatorType));
|
||||
const isVideo = [1, 2].includes(Number(record.generatorType));
|
||||
const typeText = getMappedText(GENERATOR_TYPE_TEXT, record.generatorType, "类型");
|
||||
const statusText = getMappedText(TASK_STATUS_TEXT, record.taskStatus, "状态");
|
||||
const consumedText =
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
<text v-if="isGenerating" class="record-card-media-text">生成中</text>
|
||||
</view>
|
||||
|
||||
<view class="record-card-copy w-full min-w-0">
|
||||
<text class="record-card-title block w-full truncate">{{ title }}</text>
|
||||
<text class="record-card-time block w-full truncate">{{ record.createTime }}</text>
|
||||
<text class="record-card-status block w-full truncate">{{ statusText }}</text>
|
||||
<view class="record-card-copy w-full min-w-0">
|
||||
<text class="record-card-title block w-full truncate">{{ title }}</text>
|
||||
<text class="record-card-time block w-full truncate">{{ record.createTime }}</text>
|
||||
<text class="record-card-status block w-full truncate">{{ statusText }}</text>
|
||||
</view>
|
||||
|
||||
<view v-if="actionText" class="record-card-action">
|
||||
@@ -34,6 +34,7 @@ const emit = defineEmits(["view"]);
|
||||
const GENERATOR_TYPE_TEXT = {
|
||||
0: "图片版",
|
||||
1: "视频版",
|
||||
2: "升视频",
|
||||
};
|
||||
|
||||
const TASK_STATUS_TEXT = {
|
||||
@@ -74,7 +75,7 @@ const statusText = computed(() => {
|
||||
const taskStatus = props.record.taskStatus;
|
||||
const generatorCost = normalizedTaskStatus.value === 3 ? 0 : props.record.generatorCost;
|
||||
const typeText =
|
||||
GENERATOR_TYPE_TEXT[generatorType] || (generatorType === undefined ? "" : `类型${generatorType}`);
|
||||
GENERATOR_TYPE_TEXT[generatorType] || (generatorType === undefined ? "" : `生成作品`);
|
||||
const stateText =
|
||||
TASK_STATUS_TEXT[taskStatus] || (taskStatus === undefined ? "" : `状态${taskStatus}`);
|
||||
const costText =
|
||||
|
||||
@@ -31,7 +31,7 @@ import { computed, ref } from "vue";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import TopNavBar from "@/components/TopNavBar/index.vue";
|
||||
import { checkToken } from "@/hooks/useGoLogin.js";
|
||||
import { getAigcGeneratorTaskShareDetail } from "@/pages-aigc/request/AigcApi.js";
|
||||
import { getAigcGeneratorTaskShareDetail } from "@/pages-aigc/request/AigcApi.js";
|
||||
|
||||
const shareKey = ref("");
|
||||
const shareDetail = ref(null);
|
||||
@@ -52,9 +52,8 @@ const generatorTypeText = computed(() => {
|
||||
const generatorType = shareDetail.value?.generatorType;
|
||||
if (Number(generatorType) === 0) return "图片版";
|
||||
if (Number(generatorType) === 1) return "视频版";
|
||||
return generatorType === undefined || generatorType === null || generatorType === ""
|
||||
? "生成作品"
|
||||
: `类型${generatorType}`;
|
||||
if (Number(generatorType) === 2) return "升视频";
|
||||
return generatorType === undefined || generatorType === null || generatorType === "" || "生成作品";
|
||||
});
|
||||
|
||||
const showToast = (title) => {
|
||||
|
||||
Reference in New Issue
Block a user