// record.page.ts
import { Component } from '@angular/core';
import { NavController } from '@ionic/angular';

@Component({
  selector: 'app-tab2',
  templateUrl: 'tab2.page.html',
  styleUrls: ['tab2.page.scss'],
  standalone: false // 确保设置为 false 或不设置
})
export class Tab2Page {
  records: any[] = [
    {
      type: 'ride',
      date: '甲辰年三月初五',
      time: '辰时',
      duration: 120,
      intensity: '高强度',
      fatigue: 7,
      location: '虎牢关马场'
    },
    {
      type: 'archery',
      date: '甲辰年三月初四',
      time: '午时',
      duration: 90,
      intensity: '中强度',
      fatigue: 5,
      location: '洛阳射圃'
    },
    {
      type: 'martial',
      date: '甲辰年三月初三',
      time: '酉时',
      duration: 60,
      intensity: '高强度',
      fatigue: 8,
      location: '玄武门演武场'
    },
    {
      type: 'run',
      date: '甲辰年三月初二',
      time: '卯时',
      duration: 45,
      intensity: '低强度',
      fatigue: 3,
      location: '长安城墙'
    },
    {
      type: 'swim',
      date: '甲辰年三月初一',
      time: '未时',
      duration: 30,
      intensity: '中强度',
      fatigue: 6,
      location: '赤壁水寨'
    },
    {
      type: 'ride',
      date: '甲辰年二月廿九',
      time: '申时',
      duration: 150,
      intensity: '高强度',
      fatigue: 9,
      location: '潼关古道'
    }
  ];

  constructor(private navCtrl: NavController) {}
  goRecord(record?:any){
    console.log(record)
    this.navCtrl.navigateForward(["tabs","tab2","record"],{
      queryParams:record
    })
  }

  addRecord() {
    // 导航到添加记录页面
    this.navCtrl.navigateForward(['/add-record']);
  }
}