import { Component } from '@angular/core';
import { NavController } from '@ionic/angular';

@Component({
  selector: 'app-home',
  templateUrl: 'home.page.html',
  styleUrls: ['home.page.scss'],
})
export class HomePage {
  // 假设这些数据从后端API获取
  weather = {
    temperature: 22,
    condition: '晴天',
    icon: 'sunny'
  };

  todos = [
    { text: '完成日报', completed: false },
    { text: '参加会议', completed: false },
    { text: '买菜', completed: false }
  ];

  traffic = {
    status: '路况良好，预计10分钟到达'
  };

  constructor(private navCtrl: NavController) {}

  // 打开设置页面
  openSettings() {
    this.navCtrl.navigateForward('/settings');
  }

  // 打开个人资料页面
  openProfile() {
    this.navCtrl.navigateForward('/profile');
  }

  // 跳转到注册页面
  goToRegister() {
    this.navCtrl.navigateForward('/register');
  }

  // 跳转到登录页面
  goToLogin() {
    this.navCtrl.navigateForward('/login');
  }

  // 查看交通详情
  viewTrafficDetails() {
    this.navCtrl.navigateForward('/traffic-details');
  }
}