C端SKU数量小于等于1不展示chip

后端修复规格轴数据错乱显示问题
This commit is contained in:
2026-08-26 07:43:26 +08:00
parent 1f4506f60b
commit c7cd0f6cf2
6 changed files with 58 additions and 40 deletions
@@ -140,7 +140,8 @@ export default function ProductDetailPage() {
const attrs = product?.specAttrs ?? [];
const skus = product?.skus ?? [];
const specEnabled = !!(product?.specEnabled && attrs.length > 0);
const onSaleSkuCount = skus.filter((s) => s.status === 'ON_SALE').length;
const specEnabled = onSaleSkuCount > 1 && attrs.length > 0;
const activeSku = useMemo(() => {
if (!product) return undefined;
if (!specEnabled) {