币商增加
This commit is contained in:
parent
4bae0aca72
commit
91d355b7f1
@ -4,7 +4,7 @@
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
|
||||
<title>Recharge Center</title>
|
||||
<link rel="stylesheet" href="./style.css?v=20260601-0100" />
|
||||
<link rel="stylesheet" href="./style.css?v=20260602-0110" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="recharge-center" aria-label="Recharge Center" data-i18n-aria="page_label" data-loading="true">
|
||||
@ -238,6 +238,6 @@
|
||||
|
||||
<div class="toast" id="toast" role="status" aria-live="polite" hidden></div>
|
||||
</div>
|
||||
<script src="./script.js?v=20260529-1300" defer></script>
|
||||
<script src="./script.js?v=20260602-0110" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -643,6 +643,36 @@
|
||||
}).format(number);
|
||||
}
|
||||
|
||||
function numberValue(value) {
|
||||
const number = Number(String(value ?? "").replace(/,/g, ""));
|
||||
return Number.isFinite(number) ? number : null;
|
||||
}
|
||||
|
||||
function pickRecordUSDAmount(record) {
|
||||
const directCandidates = [
|
||||
record?.usdQuantity,
|
||||
record?.usdAmount,
|
||||
record?.amountUsd,
|
||||
record?.amountUSDT,
|
||||
record?.amountUsdt,
|
||||
record?.usdtAmount,
|
||||
record?.transferAmountUsdt,
|
||||
record?.transferAmountUSD,
|
||||
record?.dollarAmount
|
||||
];
|
||||
for (const candidate of directCandidates) {
|
||||
const number = numberValue(candidate);
|
||||
if (number && number > 0) return number;
|
||||
}
|
||||
|
||||
const rechargeType = String(record?.rechargeType || record?.currency || "").toUpperCase();
|
||||
if (rechargeType.includes("USD")) {
|
||||
const fallback = numberValue(record?.orderAmount ?? record?.amount);
|
||||
if (fallback && fallback > 0) return fallback;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function pickCoinAmount(body) {
|
||||
if (typeof body === "number" || typeof body === "string") return body;
|
||||
if (body && typeof body === "object") {
|
||||
@ -989,11 +1019,13 @@
|
||||
const amount = document.createElement("div");
|
||||
const isIncome = Number(record?.type) === 0;
|
||||
amount.className = `history-record-amount ${isIncome ? "is-income" : "is-expense"}`;
|
||||
amount.textContent = `${isIncome ? "+" : "-"}${formatCoins(record?.quantity)} ${message("coins")}`;
|
||||
const usdAmount = isIncome ? pickRecordUSDAmount(record) : null;
|
||||
amount.textContent = `${isIncome ? "+" : "-"}${formatCoins(record?.quantity)} ${message("coins")}${usdAmount !== null ? ` ≈ $${formatMoney(usdAmount)}` : ""}`;
|
||||
const time = document.createElement("div");
|
||||
time.className = "history-record-time";
|
||||
time.textContent = formatRecordTime(record?.createTime);
|
||||
side.append(amount, time);
|
||||
side.appendChild(amount);
|
||||
side.appendChild(time);
|
||||
|
||||
item.append(userWrap, side);
|
||||
return item;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user