import { Component } from '@angular/core';
import { IonCardHeader, IonHeader, IonToolbar, IonTitle, IonContent, IonTabButton, IonSearchbar, IonLabel, IonItem, IonList, NavController, IonCard, IonCardTitle, IonCardSubtitle, IonCardContent, IonThumbnail } from '@ionic/angular/standalone';
import { ExploreContainerComponent } from '../explore-container/explore-container.component';
import { IonButton } from '@ionic/angular/standalone';
import { IonIcon } from '@ionic/angular/standalone';
import { Router } from '@angular/router';
import { CommonModule } from '@angular/common';
import { ModalController } from '@ionic/angular';
import { HttpClient } from '@angular/common/http';
import { addIcons } from 'ionicons';
import { documentText, chatbubbles, person, calendar, newspaper,
   medkit,clipboard, podium, videocam, people } from 'ionicons/icons';
addIcons({ documentText, chatbubbles, person, calendar, newspaper,
   medkit,clipboard, podium, videocam, people
 });
@Component({
  selector: 'app-tab1',
  templateUrl: 'tab1.page.html',
  styleUrls: ['tab1.page.scss'],
  standalone: true,
  imports: [
    IonHeader, IonToolbar, IonTitle, IonContent, ExploreContainerComponent, IonTabButton, IonButton,
    IonIcon,IonSearchbar,IonLabel,IonItem,IonList,CommonModule,IonCard,IonCardHeader,IonCardTitle,IonCardSubtitle,
    IonCardContent, IonThumbnail, 
  ],
})
export class Tab1Page {

  constructor(
    private router: Router,
    // private modalController: ModalController,
    // private navCtrl: NavController,
    // private http: HttpClient // 注入 HttpClient
  ) {}
  /**
   * Go to the ai page
   */
  goToPage1(){
    this.router.navigate(['/tabs/inquiry/ai'])
  }

  /**
   * Go to the human page
   */
  goToPage2(){
    this.router.navigate(['/tabs/inquiry/human'])
  }

  goToPicture(){
    this.router.navigate(['/tabs/picture'])
  }
  searchContent:string = ''; //搜索内容

  handleInput(ev:any) {
    console.log("ev.detail.value: ",ev.detail.value)
    this.searchContent = ev.detail.value;
  }

  search(){
    if (this.searchContent == ''){
      console.log("请输入搜索内容")
    }
    else {
      console.log("搜索内容: ",this.searchContent)
      this.searchContent = '';
    }
  }

  // 功能按钮数据
  functionItems1 = [
    { label: '我的健康', icon: 'document-text', route: '/medical-records' },
    { label: '健康档案', icon: 'person', route: '/health-profile' },
    { label: '电话问诊', icon: 'calendar', route: '/appointment' },
    { label: '购买药品', icon: 'medkit', route: '/telemedicine' },
  ];

  functionItems2 = [
    { label: '专业男科', icon: 'clipboard', route: '/medicine-purchase' },
    { label: '权威专家', icon: 'podium', route: '/expert-lectures' },
    { label: '健康资讯', icon: 'newspaper', route: '/health-news' },
    { label: '智慧社区', icon: 'people', route: '/health-community' }
  ];

  // 导航到指定路由
  navigateTo(route: string) {
    // this.router.navigate([route]);
    console.log("route: ",route)

  }

  ngOnInit() {}
}
