fix sku display

This commit is contained in:
Timi
2026-09-19 22:28:24 +08:00
parent 79d9efad73
commit 2aa29da3ff
15 changed files with 148 additions and 82 deletions
+18 -9
View File
@@ -16,8 +16,8 @@
v-for="(item, index) in result.list"
:key="item.id"
class="item"
:title="item.product?.name || item.sku?.name || '未命名产品'"
arrow
:description="item.unit?.name || '单位未知'"
v-entrance-transition="index * 30"
@click="toEdit(item)"
>
@@ -35,19 +35,23 @@
v-text="(item.product?.name || item.sku?.name || '产').slice(0, 1)"
/>
</template>
<template #title>
<div class="title">
<strong v-text="item.product?.name || item.sku?.name || '未命名产品'" />
<template #note>
<span class="orange" v-text="formatPoint(item.defaultPointCost)" />
</template>
<template #description>
<div class="description">
<t-tag
size="small"
:theme="item.status === 'ACTIVE' ? 'success' : 'default'"
:content="statusText(item.status)"
/>
<product-sku-tags
:product-name="item.product?.name"
:fallback="item.sku?.specSummary || item.sku?.name || '默认 SKU'"
:unit="item.unit?.name"
/>
</div>
</template>
<template #note>
<span class="orange" v-text="formatPoint(item.defaultPointCost)" />
</template>
</t-cell>
</t-cell-group>
<t-empty v-else :description="isLoading ? '正在加载兑换配置' : '暂无兑换配置'" />
@@ -63,6 +67,7 @@
<script setup lang="ts">
import { Toolkit } from "timi-web";
import PointAPI from "@/api/PointAPI";
import ProductSkuTags from "@/components/ProductSkuTags.vue";
import { useNavBarStore } from "@/store/navBarStore";
import type { PointRedeemSku, PointRedeemSkuStatus } from "@/types/Point";
import { Message } from "@/utils/message";
@@ -202,12 +207,16 @@ onUnmounted(() => {
.item {
padding: 10px;
border-radius: 1rem;
.avatar {
width: 3.5rem;
height: 3.5rem;
border-radius: .875rem;
}
.description {
gap: .5rem;
display: flex;
align-items: center;
}
}