import { Component } from '@angular/core'; import { CommonModule } from '@angular/common'; // 导入 CommonModule import { IonHeader, IonToolbar, IonTitle, IonContent, IonSearchbar, IonCard, IonCardHeader, IonCardTitle, IonCardSubtitle, IonCardContent, IonItem, IonLabel, IonList, IonFooter } from '@ionic/angular/standalone'; import { ExploreContainerComponent } from '../explore-container/explore-container.component'; import { EditRatingStarComponent } from '../edit-rating-star/edit-rating-star.component'; import { Router } from '@angular/router'; import { IonButton } from '@ionic/angular/standalone'; @Component({ selector: 'app-tab1', templateUrl: 'tab1.page.html', styleUrls: ['tab1.page.scss'], standalone: true, imports: [ CommonModule, // 在 imports 中加入 CommonModule IonHeader, IonToolbar, IonTitle, IonContent, IonSearchbar, IonCard, IonCardHeader, IonCardTitle, IonCardSubtitle, IonCardContent, IonItem, IonLabel, IonList, IonFooter, ExploreContainerComponent , EditRatingStarComponent, IonButton ], }) export class Tab1Page { constructor(private router: Router) {} goToPage1(){ this.router.navigate(['/tabs/picture']) } goToPage2(){ } currentScore: number = 0; // 初始分值 handleScoreChange(newScore: number) { this.currentScore = newScore; console.log('新分值:', newScore); // 处理分值变化 } items = [ { title: '医疗技术', description: '我们提供最新的医疗设备和技术,帮助提高医护质量和效率。', image: 'https://tse3-mm.cn.bing.net/th/id/OIP-C.NHe6NqhU0qZ_qLO0DQ08pAHaFj?rs=1&pid=ImgDetMain' }, { title: '健康管理', description: '专业的健康管理方案,确保您的身体健康得到最佳维护。', image: '' }, { title: '护理服务', description: '我们提供全面的护理服务,为患者提供贴心的照顾。', image: 'https://tse1-mm.cn.bing.net/th/id/OIP-C.N6uSj6zCe2pDw7vA4fcYuAHaE7?w=214&h=180&c=7&r=0&o=5&dpr=1.5&pid=1.7' } ]; search(event: CustomEvent) { const searchTerm = event.detail.value; console.log('搜索内容:', searchTerm); // 在这里可以添加搜索逻辑,如过滤 items 数组 } }