import { Component } from '@angular/core';
import { Router } from '@angular/router';  // 导入 Router 模块

@Component({
  selector: 'app-page-exercise',
  templateUrl: './page-exercise.component.html',
  styleUrls: ['./page-exercise.component.scss'],
})
export class PageExerciseComponent {
  user = {
    name: '',
    age: null,
    height: null,
    weight: null,
    goal: ''
  };

  constructor(private router: Router) {}

  submitForm() {
    // 提交表单数据并跳转到第二个页面
    this.router.navigate(['/page-exercise-result'], {
      state: {
        userData: this.user
      }
    });
  }

  goToSettings() {
    // 跳转到设置页面的逻辑
  }

  goToLogin() {
    // 登录页面的跳转逻辑
  }

  goToRegister() {
    // 注册页面的跳转逻辑
  }
}
