修复商品库存与网络摘要并校验订购编号

This commit is contained in:
cieanyau committed 2026-11-06 04:48:38 +08:00
1 parent 28894e0813
commit d8224ec5b7
15 files changed
+529 -68

No files matched your search

+4 -10
View File
@@ -20,6 +20,8 @@ import { t as product_name_t } from "~/lib/product-name.js";
import { a as storage_capacity_a } from "~/lib/storage-capacity.js";
import { t as storage_capacity_t } from "~/lib/storage-capacity.js";
import { t as product_order_module_t } from "~/lib/product-order-module.js";
import { resourceOptionValue as k } from "~/lib/resource-option-value.js";
import { productId } from "~/lib/product-id.js";
var y = {
timeoutMs: 5e3,
},
@@ -142,14 +144,6 @@ function O(e) {
: ``);
return `${e.min}${t}`;
}
function k(e) {
return (
e &&
(e.type === `step` || e.type === `total`
? (e.min_value ?? e.value)
: e.value)
);
}
function A(e, t, n = ``) {
return {
label: e,
@@ -158,7 +152,7 @@ function A(e, t, n = ``) {
}
// 按真实订单模块读取配置;含级联或高级限制且无法安全推导默认值时不生成摘要。
async function j(e, t) {
if (!product_name_t(t.name)) return [];
if (!product_name_t(t.name) || productId(t.id) === null) return [];
let n = (t, n) => e.get(t, n, !1, y);
try {
let r = await product_order_module_t(
@@ -252,7 +246,7 @@ async function j(e, t) {
if (e.bill_type === `bw`) s.push(A(`带宽`, k(e.bw?.[0]), `Mbps`));
else if (e.bill_type === `flow`) {
let t = e.flow?.[0];
s.push(A(`流量`, t?.value, `GB`));
s.push(A(`流量`, k(t), `GB`));
let n = t?.bw?.[0] ?? t?.other_config;
n &&
s.push(