和平小店可以返回所有商品

This commit is contained in:
yml2213
2026-08-08 00:30:58 +08:00
parent 85813a5095
commit de23d87087
5 changed files with 107 additions and 35 deletions
+2 -2
View File
@@ -242,7 +242,7 @@ function xpdGoodsLabel(item: DouyuGoodsItem): string {
].filter(Boolean);
const stock = xpd.goods_left;
const stockText = stock != null && Number.isFinite(Number(stock))
? `库存${stock}`
? (Number(stock) < 0 ? '库存未公开' : `库存${stock}`)
: '库存未知';
return `${item.name || item.commodity_id}${prices.length ? ` / ${prices.join(' 或 ')}` : ' / 暂不可兑换'} / ${stockText}`;
}
@@ -885,7 +885,7 @@ export default function DouyuTasksPage({ handbook }: { handbook: HandbookKind })
);
const selectedXpdGoodsSoldOut = (() => {
const stock = (selectedXpdGoods as (DouyuGoodsItem & { goods_left?: number | null }) | undefined)?.goods_left;
return stock != null && Number.isFinite(Number(stock)) && Number(stock) <= 0;
return stock != null && Number.isFinite(Number(stock)) && Number(stock) === 0;
})();
useEffect(() => {