import { CommonModule } from '@angular/common';
import { Component } from '@angular/core';
import { Router } from '@angular/router';
import { 
  IonButton, 
  IonCard, 
  IonCardContent, 
  IonCardHeader, 
  IonCardTitle, 
  IonItem, 
  IonLabel, 
  IonList, 
  IonSearchbar, 
  IonThumbnail, 
  IonHeader, 
  IonToolbar, 
  IonTitle, 
  IonContent,  
  IonButtons, 
  IonTabButton,
  IonIcon,
  IonTabBar,
  IonMenuButton
} from '@ionic/angular/standalone'; // 从Ionic导入组件
import { IonAvatar } from '@ionic/angular/standalone';

@Component({
  selector: 'app-tab1',
  templateUrl: 'tab1.page.html',
  styleUrls: ['tab1.page.scss'],
  standalone: true,
  imports:[
    CommonModule,
    IonAvatar, 
    IonButton, 
    IonCard, 
    IonCardContent, 
    IonCardHeader, 
    IonCardTitle, 
    IonItem, 
    IonLabel, 
    IonList, 
    IonSearchbar, 
    IonThumbnail, 
    IonHeader, 
    IonToolbar, 
    IonTitle, 
    IonContent, 
    IonButtons,
    IonTabButton,
    IonTabBar,
    IonMenuButton,
    IonIcon
  ]
})
export class Tab1Page {
  recommendedRoutes = [
    { title: '滕王阁经典游', description: '探索滕王阁的美丽与历史', thumbnail: './assets/img/滕王阁.png' },
    { title: '南昌博物馆', description: '了解南昌的文化与历史', thumbnail: './assets/img/博物馆.png' }
  ]; // 推荐路线数据示例

  personalizedRoutes = [
    { title: '情侣浪漫之旅', reason: '适合情侣，包含浪漫晚餐和夜景' },
    { title: '家庭亲子游', reason: '适合家庭，包含儿童乐园' }
  ]; // 个性化推荐数据示例

  popularAttractions = [
    { name: '八一起义纪念馆', description: '纪念南昌起义的历史', image: './assets/img/八一起义.png' },
    { name: '南昌青山湖', description: '美丽的湖泊，适合休闲游玩', image: './assets/img/青山湖.png' }
  ]; // 热门景点数据示例

  userFeedbacks = [
    { userAvatar: './assets/img/用户1.png', username: '张三', content: '这条路线非常棒！', rating: 5 },
    { userAvatar: './assets/img/用户2.png', username: '李四', content: '我喜欢这个地方！', rating: 4 }
  ]; // 用户反馈数据示例

  constructor(private router: Router) {}

  onSearch(event: any) {
    const query = event.target.value;
    // 处理搜索逻辑，例如过滤推荐路线或热门景点
    console.log('Searching for:', query);
  }

  viewRoute(route: any) {
    // 导航到路线详情页面
    console.log('Viewing route:', route);
  }

  viewAttraction(attraction: any) {
    // 导航到景点详情页面
    console.log('Viewing attraction:', attraction);
  }
}