Sfoglia il codice sorgente

fix(mobile): hide student balance refresh timestamp

彭峰 1 settimana fa
parent
commit
c858b9ad84

+ 0 - 1
projects/xiaoshu-mobile/src/app/features/home/home-page.component.html

@@ -94,7 +94,6 @@
     </section>
 
     @if(coachStatsError() || balanceError()){<p role="status">{{coachStatsError() || balanceError()}} <button type="button" (click)="retryStudentStats()">重新加载</button></p>}
-      @else if(balanceRefreshedAt()){<small>余额更新于 {{balanceRefreshedAt()}}</small>}
     <section class="student-stats" aria-label="学习统计">
       <div><strong>{{ stat('t_total') }}</strong><span>累积生词</span></div>
       <div><strong>{{ balance('UserPoint') }}</strong><span>剩余陪练时长</span></div>

+ 1 - 3
projects/xiaoshu-mobile/src/app/features/home/home-page.component.ts

@@ -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('课时余额暂时无法更新'),
     }));