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

@Component({
  selector: 'app-page-register',
  templateUrl: './page-register.component.html',
  styleUrls: ['./page-register.component.scss']
})
export class PageRegisterComponent {
  constructor(
    private router: Router,
    private alertController: AlertController
  ) { }

  async register() {
    // 处理注册逻辑，例如发送注册请求到后端
    // 显示注册成功的提示框
    const alert = await this.alertController.create({
      header: '提示',
      message: '注册成功',
      buttons: ['确定']
    });
    await alert.present();

    // 导航到登录页面
    this.router.navigate(['/user/login']);
  }
  goBack() {
    this.router.navigate(['/user/login']);
  }
}
