docs(充点弹窗): 说明默认预选第 3 档的原因

- 为点卡默认选中索引 2 的取值补上中文注释,说明其只影响默认选中项、不改变计费。
This commit is contained in:
2026-10-03 17:31:00 +08:00
parent cec4b7ec5e
commit 9af6625514
@@ -1321,8 +1321,10 @@ export function PlatformProfileRechargeModal({
if (pointProducts.length === 0) {
return null;
}
const fallbackProduct =
pointProducts[Math.min(2, pointProducts.length - 1)];
// 中文注释:默认预选第 3 档(索引 2,不足时退回末档),让首屏落在价格居中的档位;
// 充点商品目前同价(¥1 = 10 泥点),这里只影响默认选中项,不改变计费。
const defaultProductIndex = Math.min(2, pointProducts.length - 1);
const fallbackProduct = pointProducts[defaultProductIndex];
return fallbackProduct ? fallbackProduct.productId : null;
});
}, [pointProducts]);