refactor: remove unused CustomEmpty and related code
clean up dead code by removing all CustomEmpty component imports, template usages and the associated detailEmptyText state variable
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
<view class="aigc-detail-content">
|
||||
<template v-if="taskDetail">
|
||||
<ResultPreview v-if="result.cover" :result="result" />
|
||||
<CustomEmpty v-else :statusText="result.resultLabel" />
|
||||
<ResultMeta :items="metaItems" />
|
||||
<ResultActions :saving="isSaving" @save="handleSave" />
|
||||
|
||||
@@ -15,7 +14,6 @@
|
||||
<view class="aigc-detail-text-action" @tap="handleOpenRecords">历史记录</view>
|
||||
</view>
|
||||
</template>
|
||||
<CustomEmpty v-else :statusText="detailEmptyText" />
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -23,7 +21,6 @@
|
||||
<script setup>
|
||||
import { computed, ref } from "vue";
|
||||
import { onLoad, onShareAppMessage, onShow } from "@dcloudio/uni-app";
|
||||
import CustomEmpty from "@/components/CustomEmpty/index.vue";
|
||||
import AigcTopBar from "@/pages-aigc/components/AigcTopBar/index.vue";
|
||||
import { useCurrentCredit } from "@/pages-aigc/hooks/useCurrentCredit.js";
|
||||
import { getAigcGeneratorTaskDetail } from "@/request/api/AigcApi.js";
|
||||
@@ -34,7 +31,6 @@ import ResultPreview from "./components/ResultPreview/index.vue";
|
||||
const { pointBalance, fetchCurrentCredit } = useCurrentCredit();
|
||||
const taskId = ref("");
|
||||
const taskDetail = ref(null);
|
||||
const detailEmptyText = ref("加载中...");
|
||||
const isSaving = ref(false);
|
||||
|
||||
const GENERATOR_TYPE_TEXT = {
|
||||
@@ -114,7 +110,6 @@ const showPlaceholderToast = (title) => {
|
||||
};
|
||||
|
||||
const fetchTaskDetail = async () => {
|
||||
detailEmptyText.value = "加载中...";
|
||||
uni.showLoading({
|
||||
title: "加载中",
|
||||
mask: true,
|
||||
@@ -128,12 +123,10 @@ const fetchTaskDetail = async () => {
|
||||
}
|
||||
|
||||
taskDetail.value = null;
|
||||
detailEmptyText.value = "未获取到生成结果";
|
||||
showPlaceholderToast("获取任务详情失败");
|
||||
} catch (error) {
|
||||
console.error("获取AIGC生成任务详情失败", error);
|
||||
taskDetail.value = null;
|
||||
detailEmptyText.value = "未获取到生成结果";
|
||||
showPlaceholderToast("获取任务详情失败");
|
||||
} finally {
|
||||
uni.hideLoading();
|
||||
@@ -143,7 +136,6 @@ const fetchTaskDetail = async () => {
|
||||
onLoad((query = {}) => {
|
||||
taskId.value = String(query.taskId || "").trim();
|
||||
if (!taskId.value) {
|
||||
detailEmptyText.value = "缺少任务信息";
|
||||
showPlaceholderToast("缺少任务ID");
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user