feat(aigc): 新增升视频生成类型并修复相关展示逻辑

- 添加生成类型2的“升视频”映射到详情页和记录卡片配置中
- 优化共享作品页面的生成类型文本展示逻辑以适配新类型
- 调整未知生成类型的默认显示文本为“生成作品”
This commit is contained in:
duanshuwen
2026-08-05 19:58:01 +08:00
parent 9f0881a284
commit 8de0038742
3 changed files with 11 additions and 10 deletions

View File

@@ -65,6 +65,7 @@ const pointDialogVisible = ref(false);
const GENERATOR_TYPE_TEXT = { const GENERATOR_TYPE_TEXT = {
0: "图片版", 0: "图片版",
1: "视频版", 1: "视频版",
2: "升视频",
}; };
const TASK_STATUS_TEXT = { const TASK_STATUS_TEXT = {
@@ -92,7 +93,7 @@ const result = computed(() => {
const imageUrl = record.imageResultUrl || ""; const imageUrl = record.imageResultUrl || "";
const videoUrl = record.videoResultUrl || ""; 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 typeText = getMappedText(GENERATOR_TYPE_TEXT, record.generatorType, "类型");
const statusText = getMappedText(TASK_STATUS_TEXT, record.taskStatus, "状态"); const statusText = getMappedText(TASK_STATUS_TEXT, record.taskStatus, "状态");
const consumedText = const consumedText =

View File

@@ -7,10 +7,10 @@
<text v-if="isGenerating" class="record-card-media-text">生成中</text> <text v-if="isGenerating" class="record-card-media-text">生成中</text>
</view> </view>
<view class="record-card-copy w-full min-w-0"> <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-title block w-full truncate">{{ title }}</text>
<text class="record-card-time block w-full truncate">{{ record.createTime }}</text> <text class="record-card-time block w-full truncate">{{ record.createTime }}</text>
<text class="record-card-status block w-full truncate">{{ statusText }}</text> <text class="record-card-status block w-full truncate">{{ statusText }}</text>
</view> </view>
<view v-if="actionText" class="record-card-action"> <view v-if="actionText" class="record-card-action">
@@ -34,6 +34,7 @@ const emit = defineEmits(["view"]);
const GENERATOR_TYPE_TEXT = { const GENERATOR_TYPE_TEXT = {
0: "图片版", 0: "图片版",
1: "视频版", 1: "视频版",
2: "升视频",
}; };
const TASK_STATUS_TEXT = { const TASK_STATUS_TEXT = {
@@ -74,7 +75,7 @@ const statusText = computed(() => {
const taskStatus = props.record.taskStatus; const taskStatus = props.record.taskStatus;
const generatorCost = normalizedTaskStatus.value === 3 ? 0 : props.record.generatorCost; const generatorCost = normalizedTaskStatus.value === 3 ? 0 : props.record.generatorCost;
const typeText = const typeText =
GENERATOR_TYPE_TEXT[generatorType] || (generatorType === undefined ? "" : `类型${generatorType}`); GENERATOR_TYPE_TEXT[generatorType] || (generatorType === undefined ? "" : `生成作品`);
const stateText = const stateText =
TASK_STATUS_TEXT[taskStatus] || (taskStatus === undefined ? "" : `状态${taskStatus}`); TASK_STATUS_TEXT[taskStatus] || (taskStatus === undefined ? "" : `状态${taskStatus}`);
const costText = const costText =

View File

@@ -31,7 +31,7 @@ import { computed, ref } from "vue";
import { onLoad } from "@dcloudio/uni-app"; import { onLoad } from "@dcloudio/uni-app";
import TopNavBar from "@/components/TopNavBar/index.vue"; import TopNavBar from "@/components/TopNavBar/index.vue";
import { checkToken } from "@/hooks/useGoLogin.js"; 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 shareKey = ref("");
const shareDetail = ref(null); const shareDetail = ref(null);
@@ -52,9 +52,8 @@ const generatorTypeText = computed(() => {
const generatorType = shareDetail.value?.generatorType; const generatorType = shareDetail.value?.generatorType;
if (Number(generatorType) === 0) return "图片版"; if (Number(generatorType) === 0) return "图片版";
if (Number(generatorType) === 1) return "视频版"; if (Number(generatorType) === 1) return "视频版";
return generatorType === undefined || generatorType === null || generatorType === "" if (Number(generatorType) === 2) return "升视频";
? "生成作品" return generatorType === undefined || generatorType === null || generatorType === "" || "生成作品";
: `类型${generatorType}`;
}); });
const showToast = (title) => { const showToast = (title) => {