fix: simplify recharge copy
This commit is contained in:
parent
dfec8d7ee3
commit
35c4c02579
@ -172,7 +172,7 @@ async function handleNotify(request: NextRequest) {
|
||||
userId: paidOrder.userId,
|
||||
amount: paidOrder.points,
|
||||
reason: "recharge",
|
||||
note: `DuluPay 充值 (${paidOrder.outTradeNo})`,
|
||||
note: "充值积分",
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@ -32,6 +32,15 @@ function mapLedgerReasonLabel(reason: string) {
|
||||
return reason || "积分变动";
|
||||
}
|
||||
|
||||
function formatLedgerDetail(reason: string, note: string | null | undefined) {
|
||||
if (reason === "recharge") {
|
||||
return "充值积分";
|
||||
}
|
||||
|
||||
const trimmedNote = typeof note === "string" ? note.trim() : "";
|
||||
return trimmedNote || mapLedgerReasonLabel(reason);
|
||||
}
|
||||
|
||||
export async function GET() {
|
||||
try {
|
||||
const session = await auth();
|
||||
@ -92,7 +101,7 @@ export async function GET() {
|
||||
|
||||
const usageRecords = ledger.map((item) => ({
|
||||
id: item.id,
|
||||
detail: item.note || mapLedgerReasonLabel(item.reason),
|
||||
detail: formatLedgerDetail(item.reason, item.note),
|
||||
status: item.amount < 0 ? "consumed" : "earned",
|
||||
amount: item.amount,
|
||||
createdAt: item.createdAt?.toISOString() || new Date().toISOString(),
|
||||
|
||||
@ -2774,9 +2774,8 @@ export function LovartHome({
|
||||
{siteSettingsData?.dulupayConfig?.enabled === true &&
|
||||
enabledPointsPackages.length > 0 ? (
|
||||
<section className="mb-5 rounded-2xl border border-black/10 bg-white p-3.5 dark:border-white/10 dark:bg-[#17171b]">
|
||||
<div className="mb-2 flex items-center justify-between">
|
||||
<div className="mb-2 flex items-center">
|
||||
<h4 className="text-base font-semibold text-black dark:text-white">积分充值</h4>
|
||||
<span className="text-[11px] text-black/45 dark:text-white/45">支持 DuluPay 即时到账</span>
|
||||
</div>
|
||||
<div className="grid grid-cols-1 gap-2.5 md:grid-cols-3">
|
||||
{enabledPointsPackages.map((pkg) => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user