|
{order.pointsDelta} 泥点
+ {order.membershipChange ? (
+ {formatMembershipChangeSummary(order.membershipChange)}
+ ) : null}
|
累计 {formatMoney(order.cumulativeSuccessRefundCents)}
@@ -1115,7 +1148,8 @@ function RechargeOrderRow({
|
可消费 {order.wallet.spendableBalance}
- 永久 {order.wallet.permanentPoints} / 占用 {order.wallet.heldPoints}
+ 永久 {order.wallet.permanentPoints} / 月度{' '}
+ {order.wallet.monthlyPoints} / 占用 {order.wallet.heldPoints}
{order.wallet.manualFrozen ? 人工冻结 : null}
@@ -1260,6 +1294,26 @@ function parseYuanToCents(value: string) {
return Number.isSafeInteger(cents) && cents > 0 ? cents : null;
}
+function formatMembershipChangeSummary(
+ change: AdminMembershipOrderChangePayload,
+): string {
+ const action = change.changeKind === 'upgrade' ? '升级' : '新购';
+ const before = change.planBefore
+ ? formatMembershipPlan(change.planBefore)
+ : null;
+ const after = change.planAfter
+ ? formatMembershipPlan(change.planAfter)
+ : null;
+ const planPath =
+ before && after && before !== after
+ ? `${before}→${after}`
+ : (after ?? before ?? '-');
+ const cycle = formatMembershipCycleKind(
+ change.cycleKindAfter ?? change.cycleKindBefore ?? '',
+ );
+ return `${action} ${planPath} / ${cycle}`;
+}
+
function formatMoney(cents: number) {
return `¥${(cents / 100).toFixed(2)}`;
}
diff --git a/scripts/admin-web-fake-api.mjs b/scripts/admin-web-fake-api.mjs
index 171af14d1..102703ee4 100644
--- a/scripts/admin-web-fake-api.mjs
+++ b/scripts/admin-web-fake-api.mjs
@@ -455,6 +455,19 @@ const userDetail = {
manualFrozen: false,
refundDebtFrozen: false,
},
+ membership: {
+ plan: 'plus',
+ status: 'active',
+ cycleKind: 'monthly',
+ cycleIndex: 2,
+ cycleCount: 1,
+ cycleGrantedPoints: 600,
+ cycleRemainingPoints: 320,
+ startedAtMicros: 1_790_640_000_000_000,
+ expiresAtMicros: 1_793_232_000_000_000,
+ cycleResetsAtMicros: 1_793_232_000_000_000,
+ updatedAtMicros: 1_790_640_000_000_000,
+ },
rechargeOrders: [],
restrictions: {},
tags: ['vip', '内测'],
@@ -617,7 +630,7 @@ function route(pathname, method, url) {
totalBalance: 1_860,
spendableBalance: 1_660,
dailyFreePoints: 0,
- membershipLimitedPoints: 0,
+ monthlyPoints: 0,
permanentPoints: 1_200,
heldPoints: 200,
refundDebtPoints: 0,
|