|
|
@@ -30,7 +30,6 @@ export class HomePageComponent implements OnInit, OnDestroy {
|
|
|
readonly balances=signal<Record<string,unknown>|null>(null);
|
|
|
readonly balanceError=signal('');
|
|
|
readonly balanceLoading=signal(false);
|
|
|
- readonly balanceRefreshedAt=signal('');
|
|
|
readonly commissionHidden = signal(true);
|
|
|
readonly totalIncome = computed(() => {
|
|
|
const amount = (value: unknown): number | null => {
|
|
|
@@ -205,10 +204,9 @@ export class HomePageComponent implements OnInit, OnDestroy {
|
|
|
this.requests.add(this.dailyCache.load('balances', () =>
|
|
|
this.api.get<{ profile: Record<string, unknown> }>('app_account_overview', { uid, refresh: true }).pipe(map(({ result }) => result.profile)), force,
|
|
|
).pipe(finalize(() => this.balanceLoading.set(false))).subscribe({
|
|
|
- next: ({ value, updatedAt }) => {
|
|
|
+ next: ({ value }) => {
|
|
|
this.balances.set(value);
|
|
|
this.balanceError.set('');
|
|
|
- this.balanceRefreshedAt.set(new Date(updatedAt).toLocaleTimeString('zh-CN', { timeZone: 'Asia/Shanghai', hour: '2-digit', minute: '2-digit' }));
|
|
|
},
|
|
|
error: () => this.balanceError.set('课时余额暂时无法更新'),
|
|
|
}));
|