import { Component } from '@angular/core';
import { ToastController } from '@ionic/angular';
import { Router } from '@angular/router';

@Component({
  selector: 'app-page-mine',
  templateUrl: './page-mine.component.html',
  styleUrls: ['./page-mine.component.scss']
})
export class PageMineComponent {
  // 其他代码...
  toastButtons = [
    {
      text: '关闭',
      role: 'cancel'
    }
  ];


  constructor(private toastCtrl: ToastController, private router: Router) {}

  // 其他方法...

  async presentToast(position: 'top' | 'bottom' | 'middle') {
    const toast = await this.toastCtrl.create({
      message: '请先登录！',
      duration: 3000,
      position: position,
      buttons: this.toastButtons
    });

    toast.present();
  }


  
  goToHome() {
    this.router.navigate(['/home']);
  }
}
