/*
 * @Author: 危齐晟 1913361097@qq.com
 * @Date: 2024-11-26 10:29:57
 * @LastEditors: 危齐晟 1913361097@qq.com
 * @LastEditTime: 2024-12-15 19:56:21
 * @FilePath: \202226701045\poem-life-app\src\app\tab1\tab1.page.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { Component } from '@angular/core';
import { IonHeader, IonToolbar, IonTitle, IonContent,IonButtons, IonButton, IonIcon,IonDatetime } from '@ionic/angular/standalone';
import { ExploreContainerComponent } from '../explore-container/explore-container.component';
import { addIcons } from 'ionicons';
import { calendar } from 'ionicons/icons';
import { FormsModule } from '@angular/forms';
import { CommonModule } from '@angular/common';
import { Router } from '@angular/router';
@Component({
  selector: 'app-tab1',
  templateUrl: 'tab1.page.html',
  styleUrls: ['tab1.page.scss'],
  standalone: true,
  imports: [FormsModule,CommonModule,IonHeader, IonToolbar, IonTitle, IonContent,IonButtons, IonButton,IonDatetime, IonIcon,ExploreContainerComponent],
})
export class Tab1Page {

  selectedDate!: string; // 定义 selectedDate
  contentItems = [
    {
      title: '清平调',
      snippet: '云想衣裳花想容，春风拂槛露华浓。若非群玉山头见，会向瑶台月下逢。',
      image: '../assets/image/01/Vx_03.jpg'
    },
    {
      title: '短歌行',
      snippet: '对酒当歌，人生几何！譬如朝露，去日苦多。...',
      image: '../assets/image/02/duangexing.jpg'
    },
    {
      title: '念奴娇·赤壁怀古',
      snippet: '赤壁之战的还原视频...',
      image: '../assets/image/03/chibizhizhan.jpg' // 替换为视频封面图
    },
    {
      title: '出师表',
      snippet: '对出师表进行的精彩扩写...',
      image: '../assets/image/04/chushibiao.jpg' // 替换为文章封面图
    },
    {
      title: '吟诵音频',
      snippet: '一段优美的吟诵音频...',
      image: '' // 替换为音频封面图
    }
  ];


  // poems = []; // 假设有一些诗
  // pastPoems = []; // 假设有一些往期诗篇

  constructor(private router:Router) {
    addIcons({calendar});
  }
  navigateToDiary() {
    this.router.navigateByUrl('/daily-content')
    // 导航到日历页面的逻辑
  }

  navigateToToday() {
    // 返回到今天内容的逻辑
  }

  onDateChange(event: any) {
    // 处理日期改变的逻辑
  }

  viewItemDetails(card: any) {
    this.router.navigate(['/card-detail'], { queryParams: { id: card.id } }); // 传递卡片ID
  }
}
