Эх сурвалжийг харах

为套餐分账号额度显示个数单位

sy 17 цаг өмнө
parent
commit
48e6473912

+ 3 - 3
web-scaffold/src/pages/PackageManagementPage.tsx

@@ -31,7 +31,7 @@ type CatalogTab = "fixed" | "custom" | "exits";
 function intCell(value: number | null | undefined, unit?: string) {
   if (value === undefined) return <Tri tone="fail" text={WORD_FETCH_FAILED} />;
   if (value === null) return <Tri tone="missing" text={WORD_UNCONFIGURED} />;
-  return <><span className="table-number">{value}</span>{unit ? <small>{unit}</small> : null}</>;
+  return <><span className="table-number">{value}</span>{unit && <span className="catalog-value-unit">/{unit}</span>}</>;
 }
 
 /** 价格按年或按月标明单位,成本金额沿用千分位和两位小数。 */
@@ -47,7 +47,7 @@ function ledgerMoney(cents: number | null | undefined, period?: "年" | "月") {
     <span className={annual ? "catalog-price catalog-price-annual" : "catalog-price"} title={`¥${amount}/${period}`}>
       <span className="catalog-price-currency">¥</span>
       <span className={annual ? "table-annual-price" : "table-number"}>{amount}</span>
-      <span className="catalog-price-period">/{period}</span>
+      <span className="catalog-value-unit">/{period}</span>
     </span>
   );
 }
@@ -167,7 +167,7 @@ function PlanRow({ plan, index, custom, writable, readOnlyNote, onEdit, onDelete
     <CatalogField label="年订阅价格">{ledgerMoney(plan.annual_price_cents, "年")}</CatalogField>
     <CatalogField label="月结算标准">{ledgerMoney(plan.monthly_settle_cents, "月")}</CatalogField>
     <CatalogField label="月成本">{ledgerCostCell(plan)}</CatalogField>
-    <CatalogField label="分账号额度">{intCell(plan.sub_account_quota)}</CatalogField>
+    <CatalogField label="分账号额度">{intCell(plan.sub_account_quota, "个")}</CatalogField>
     <CatalogField label="总带宽">{ledgerBandwidth(plan)}</CatalogField>
     <CatalogField label="订阅量" title="被合同条目或订阅引用的数量">{intCell(plan.referred_count)}</CatalogField>
     {custom && <>

+ 2 - 2
web-scaffold/src/styles/packages.css

@@ -93,8 +93,8 @@
 .catalog-ledger .catalog-sequence { color: var(--text-secondary); }
 .catalog-price { display: inline-flex; align-items: baseline; color: var(--foreground); font-weight: 600; white-space: nowrap; }
 .catalog-price-annual { color: var(--primary-soft-foreground); font-weight: 700; }
-.catalog-price-currency, .catalog-price-period { font-size: var(--type-meta); }
-.catalog-price-period { margin-inline-start: 2px; color: var(--muted-foreground); font-weight: 500; }
+.catalog-price-currency, .catalog-value-unit { font-size: var(--type-meta); }
+.catalog-value-unit { margin-inline-start: 2px; color: var(--muted-foreground); font-weight: 500; }
 .catalog-ledger .catalog-plan-row td { overflow: hidden; text-overflow: ellipsis; }
 .catalog-ledger th:last-child, .catalog-ledger .catalog-actions-cell {
   position: sticky;