fix sku display
This commit is contained in:
@@ -30,7 +30,6 @@
|
||||
<t-cell
|
||||
class="item"
|
||||
v-for="item in config.itemList || []"
|
||||
:title="getItemTitle(item)"
|
||||
:key="item.id || `${item.skuId}-${item.skuUnitId}`"
|
||||
:note="`${item.defaultQuantity} ${item.unitSnapshot || ''}${item.remark ? `|${item.remark}` : ''}`"
|
||||
>
|
||||
@@ -48,12 +47,14 @@
|
||||
v-text="(item.productNameSnapshot || '产').slice(0, 1)"
|
||||
/>
|
||||
</template>
|
||||
<template #description>
|
||||
<t-tag
|
||||
:content="item.skuCodeSnapshot || item.sku?.code || 'SKU'"
|
||||
theme="primary"
|
||||
variant="light"
|
||||
/>
|
||||
<template #title>
|
||||
<div class="title">
|
||||
<span v-text="item.productNameSnapshot || '未命名产品'" />
|
||||
<product-sku-tags
|
||||
:product-name="item.productNameSnapshot"
|
||||
:fallback="item.specSummarySnapshot || item.skuNameSnapshot || '默认 SKU'"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</t-cell>
|
||||
<div v-if="!config.itemList?.length" class="empty" v-text="'暂无产品权益'" />
|
||||
@@ -82,6 +83,7 @@ import { DialogPlugin } from "tdesign-mobile-vue";
|
||||
import { Time } from "timi-web";
|
||||
import { useUserStore } from "timi-web-api";
|
||||
import PackageAPI from "@/api/PackageAPI";
|
||||
import ProductSkuTags from "@/components/ProductSkuTags.vue";
|
||||
import { useCurrentStoreStore } from "@/store/currentStoreStore";
|
||||
import { useNavBarStore } from "@/store/navBarStore";
|
||||
import type { GaoPackageConfig, PackageConfigItem, PackageConfigStatus } from "@/types/Package";
|
||||
@@ -89,7 +91,7 @@ import { getErrorMessage } from "@/utils/error";
|
||||
import { formatPackageAmount, getPackageConfigStatusText } from "@/utils/package";
|
||||
import { Message } from "@/utils/message";
|
||||
import { gaoRoleCodes, permissionCodes } from "@/utils/permission";
|
||||
import { getProductPhotoURL as getProductPhotoUrl, getProductSkuSnapshotText } from "@/utils/product";
|
||||
import { getProductPhotoURL as getProductPhotoUrl } from "@/utils/product";
|
||||
|
||||
defineOptions({ name: "PackageConfigDetail" });
|
||||
|
||||
@@ -116,11 +118,6 @@ function getItemPhotoURL(item: PackageConfigItem): string {
|
||||
return getProductPhotoUrl(item.sku || {});
|
||||
}
|
||||
|
||||
function getItemTitle(item: PackageConfigItem): string {
|
||||
const skuText = getProductSkuSnapshotText(item.productNameSnapshot, item.skuNameSnapshot, item.specSummarySnapshot);
|
||||
return `${item.productNameSnapshot || "未命名产品"}${skuText ? ` · ${skuText}` : ""}`;
|
||||
}
|
||||
|
||||
async function loadData(): Promise<void> {
|
||||
const id = String(route.params.id || "");
|
||||
if (!id) {
|
||||
@@ -286,16 +283,20 @@ onUnmounted(() => navBarStore.clearRight());
|
||||
.item {
|
||||
padding: 10px;
|
||||
|
||||
.item-title {
|
||||
gap: .5rem;
|
||||
:deep(.t-cell__title) {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
width: 3.5rem;
|
||||
height: 3.5rem;
|
||||
width: 2.5rem;
|
||||
height: 2.5rem;
|
||||
}
|
||||
|
||||
.title {
|
||||
gap: .5rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,9 +52,6 @@
|
||||
@update:model-value="applyProduct(index, $event)"
|
||||
@select="applyProductSelection(index, $event)"
|
||||
/>
|
||||
<t-form-item v-if="item.skuId" label="SKU 单位" content-align="right">
|
||||
<span v-text="getUnit(item)?.name || '未选择单位'" />
|
||||
</t-form-item>
|
||||
<t-form-item label="默认配额" content-align="right" required-mark>
|
||||
<t-stepper
|
||||
v-model="item.defaultQuantity"
|
||||
|
||||
Reference in New Issue
Block a user