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

@Component({
  selector: 'app-medical-services',
  templateUrl: './medical-services.page.html',
  styleUrls: ['./medical-services.page.scss'],
})
export class MedicalServicesPage {
  medicalServices = [
    { title: '预约挂号', description: '选择科室并预约挂号', icon: 'calendar' },
    { title: '在线咨询', description: '在线与医生沟通', icon: 'chatbubbles' },
    { title: '医疗建议', description: '获取专业医疗建议', icon: 'information-circle' },
    // ... 添加更多服务项 ...
  ];

  hasPendingAppointments = true;
  pendingAppointmentsCount = 3;

  constructor(private navCtrl: NavController) {}

  doRefresh(event: any) {
    console.log('Begin async operation');
    setTimeout(() => {
      console.log('Async operations have ended');
      event.target.complete();
    }, 1000);
  }

  viewServiceDetails(service: any) {
    console.log(`查看 ${service.title} 的详情`);
    // 这里可以添加导航到特定服务详情页的逻辑
  }

  manageAppointments() {
    console.log('管理预约');
    // 导航到预约管理页面或弹出预约管理模态框
  }

  consultDoctor() {
    console.log('在线咨询医生');
    this.navCtrl.navigateForward('/consultation');
  }
}