Explorar o código

fix: add detectChanges in doRecharge/refreshBalance for payment success UI update

gangvy hai 5 meses
pai
achega
522b92944c
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      src/app/app.ts

+ 3 - 0
src/app/app.ts

@@ -462,6 +462,7 @@ export class App implements OnInit {
   async doRecharge(): Promise<void> {
     this.showQrModal = false;
     this.showSuccess = true;
+    this.cdr.detectChanges();
     const oldCount = this.apig!.count || 0;
     const tier = this.apig!.priceStep![this.selectedIndex];
     console.log('═══ [RECHARGE] 开始 ═══ oldCount:', oldCount, 'addCount:', tier.count, 'fun_id:', this.funId);
@@ -473,6 +474,7 @@ export class App implements OnInit {
       await this.refreshBalance();
       if (this.apig!.count! > oldCount) {
         console.log('[RECHARGE] ✅ 后端回调充值成功! 余额:', oldCount, '→', this.apig!.count);
+        this.cdr.detectChanges();
         this.loadOrderHistory();
         return;
       }
@@ -511,6 +513,7 @@ export class App implements OnInit {
       console.warn('[RECHARGE] ⚠️ 充值可能延迟,请稍后刷新页面查看');
     }
     console.log('═══ [RECHARGE] 结束 ═══ 最终余额:', this.apig!.count);
+    this.cdr.detectChanges();
     this.loadOrderHistory();
   }