fix ProductDetail.vue style

This commit is contained in:
Timi
2026-09-03 15:11:34 +08:00
parent 333999fe21
commit 2acdf46d5d
3 changed files with 177 additions and 120 deletions
+6 -7
View File
@@ -33,7 +33,11 @@
fit="cover"
class="avatar"
/>
<div v-else class="avatar placeholder" v-text="(item.name || item.code || '产').slice(0, 1)" />
<div
v-else
class="avatar placeholder"
v-text="(item.name || item.code || '产').slice(0, 1)"
/>
</template>
<template #title>
<div class="text-bold" v-text="item.name || '未命名产品'" />
@@ -79,7 +83,7 @@ import type { NavBarAction } from "@/types/NavBarAction";
import type { Product, ProductCategory, ProductStatus, ProductType } from "@/types/Product";
import { getAttachmentReadURL } from "@/utils/attachment";
import { getErrorMessage } from "@/utils/error";
import { getProductStatusText, getProductStatusTheme, getProductTypeText } from "@/utils/product";
import { getProductPhotoURL, getProductStatusText, getProductStatusTheme, getProductTypeText } from "@/utils/product";
import { Message } from "@/utils/message";
import { permissionCodes } from "@/utils/permission";
@@ -128,11 +132,6 @@ const categoryOptions = computed(() => [{ label: "全部分类", value: "ALL" },
}))]);
const emptyText = computed(() => isLoading.value ? "正在加载产品" : keyword.value ? "未找到匹配产品" : "暂无产品");
function getProductPhotoURL(item: Product): string {
const attachment = item.attachmentList?.find(item => item.attachType === "PHOTO" && !!item.id);
return attachment?.id ? getAttachmentReadURL(attachment.id, 128) : "";
}
async function loadCategories(): Promise<void> {
const result = await ProductAPI.categoryList({ index: 0, size: 1000, status: "ACTIVE" });
categoryList.value = result.list || [];