From 4aef5bddc79beaea3355eac085819f7f085e8859 Mon Sep 17 00:00:00 2001 From: Timi Date: Mon, 7 Sep 2026 13:32:58 +0800 Subject: [PATCH] fix ProductStockSkuList.vue style --- src/pages/product/ProductStockSkuList.vue | 207 ++++++++++------------ 1 file changed, 90 insertions(+), 117 deletions(-) diff --git a/src/pages/product/ProductStockSkuList.vue b/src/pages/product/ProductStockSkuList.vue index a0acb35..4637286 100644 --- a/src/pages/product/ProductStockSkuList.vue +++ b/src/pages/product/ProductStockSkuList.vue @@ -1,10 +1,5 @@ @@ -75,7 +71,7 @@ import ProductAPI from "@/api/ProductAPI"; import { useNavBarStore } from "@/store/navBarStore"; import type { Product, ProductStock } from "@/types/Product"; import { getErrorMessage } from "@/utils/error"; -import { getProductQuantityText, getProductSkuSpecEntries } from "@/utils/product"; +import { getProductQuantityText } from "@/utils/product"; import { Message } from "@/utils/message"; import { permissionCodes } from "@/utils/permission"; @@ -110,15 +106,6 @@ let keywordTimer: number | undefined; let requestToken = 0; let suppressKeywordFetch = false; -function getSkuSpecText(item: ProductStock): string { - const sku = item.sku; - if (!sku) { - return "未配置规格"; - } - const entries = getProductSkuSpecEntries(sku, product.value?.specList || []); - return entries.length ? entries.map(entry => `${entry.specName}:${entry.valueName}`).join(" · ") : sku.specSummary || "无多规格"; -} - function getCurrentRouteDepth(): number { const transitionDepth = Array.isArray(route.query.transitionDepth) ? route.query.transitionDepth[0] @@ -250,26 +237,6 @@ onUnmounted(() => { .product-stock-sku-list { padding: var(--app-nav-height) 0 1rem; - .product-context { - gap: .25rem; - display: flex; - padding: .75rem 1rem; - background: var(--td-bg-color-container); - flex-direction: column; - - strong, - span { - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - } - - span { - color: var(--td-text-color-secondary); - font-size: .75rem; - } - } - .search { top: var(--app-nav-height); z-index: 10; @@ -288,67 +255,73 @@ onUnmounted(() => { .list-wrap { min-height: 70vh; + padding-top: .75rem; - .list { - padding-top: .75rem; + .content { + gap: 1rem; + display: flex; + flex-direction: column; - .item { - padding: 10px; + .list { - .avatar { - width: 3.5rem; - height: 3.5rem; - } + .item { + padding: 10px; - .fallback { - color: var(--td-brand-color); - display: flex; - align-items: center; - justify-content: center; - background: var(--td-brand-color-1); - border-radius: .75rem; - font-size: 1.5rem; - font-weight: 700; - } + .avatar { + width: 3.5rem; + height: 3.5rem; + } - .title { - gap: .5rem; - min-width: 0; - flex: 1; - display: flex; - align-items: center; - justify-content: space-between; + .fallback { + color: var(--td-brand-color); + display: flex; + align-items: center; + justify-content: center; + background: var(--td-brand-color-1); + border-radius: .75rem; + font-size: 1.5rem; + font-weight: 700; + } - strong { + .title { + gap: .5rem; min-width: 0; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; + flex: 1; + display: flex; + align-items: center; + justify-content: space-between; + + strong { + min-width: 0; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } } - } - .sku-spec { - color: var(--td-text-color-secondary); - } - - .stock { - gap: .5rem; - display: flex; - margin-top: .5rem; - flex-wrap: wrap; - - strong { - display: inline-block; - margin-left: .25rem; + .sku-spec { + color: var(--td-text-color-secondary); } - } - .reserved { - color: var(--td-warning-color); - } + .stock { + gap: .5rem; + display: flex; + margin-top: .5rem; + flex-wrap: wrap; - .available { - color: var(--td-success-color); + strong { + display: inline-block; + margin-left: .25rem; + } + } + + .reserved { + color: var(--td-warning-color); + } + + .available { + color: var(--td-success-color); + } } } }