From 3d782e69f5e4e77e0d7fe24612bc72bc90387430 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E9=A3=9E=E6=B4=8B?= <15778543+xufeiyang6017@user.noreply.gitee.com> Date: Fri, 9 Jan 2026 13:10:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=95=86=E5=93=81=E6=8E=92?= =?UTF-8?q?=E5=BA=8F=E9=97=AE=E9=A2=98=EF=BC=8C=E7=A1=AE=E4=BF=9D=E9=A2=84?= =?UTF-8?q?=E5=94=AE=E5=92=8C=E7=8E=B0=E8=B4=A7=E5=95=86=E5=93=81=E5=9C=A8?= =?UTF-8?q?=E5=94=AE=E7=A9=BA=E5=95=86=E5=93=81=E4=B9=8B=E5=89=8D=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/goods/index.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pages/goods/index.js b/pages/goods/index.js index af10ee3..ad2bd3f 100644 --- a/pages/goods/index.js +++ b/pages/goods/index.js @@ -343,9 +343,18 @@ Page({ // 处理商品状态,将已下架的商品标记为售空 let status = item.status - // 如果商品状态不是已上架(published),则标记为售空(sold_out) - if (status !== 'published') { + // 检查是否为售空状态 + const isSoldOut = status === 'sold_out' || + status === 'sold' || + status === 'out_of_stock' || + (item.supplyStatus && item.supplyStatus.includes('售空')); + + // 如果商品是售空状态,则标记为sold_out + if (isSoldOut) { status = 'sold_out' + } else if (status !== 'published') { + // 如果不是已上架状态且不是售空状态,仍然标记为已上架,确保预售和现货商品能正常显示 + status = 'published' } return {