tab1.page.ts 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import { Component } from '@angular/core';
  2. import { CommonModule } from '@angular/common'; // 导入 CommonModule
  3. import { IonHeader, IonToolbar, IonTitle, IonContent, IonSearchbar, IonCard, IonCardHeader, IonCardTitle, IonCardSubtitle, IonCardContent, IonItem, IonLabel, IonList, IonFooter } from '@ionic/angular/standalone';
  4. import { ExploreContainerComponent } from '../explore-container/explore-container.component';
  5. import { EditRatingStarComponent } from '../edit-rating-star/edit-rating-star.component';
  6. import { Router } from '@angular/router';
  7. import { IonButton } from '@ionic/angular/standalone';
  8. @Component({
  9. selector: 'app-tab1',
  10. templateUrl: 'tab1.page.html',
  11. styleUrls: ['tab1.page.scss'],
  12. standalone: true,
  13. imports: [
  14. CommonModule, // 在 imports 中加入 CommonModule
  15. IonHeader, IonToolbar, IonTitle, IonContent, IonSearchbar,
  16. IonCard, IonCardHeader, IonCardTitle, IonCardSubtitle, IonCardContent,
  17. IonItem, IonLabel, IonList, IonFooter, ExploreContainerComponent ,
  18. EditRatingStarComponent, IonButton
  19. ],
  20. })
  21. export class Tab1Page {
  22. constructor(private router: Router) {}
  23. goToPage1(){
  24. this.router.navigate(['/tabs/picture'])
  25. }
  26. goToPage2(){
  27. }
  28. currentScore: number = 0; // 初始分值
  29. handleScoreChange(newScore: number) {
  30. this.currentScore = newScore;
  31. console.log('新分值:', newScore); // 处理分值变化
  32. }
  33. items = [
  34. {
  35. title: '医疗技术',
  36. description: '我们提供最新的医疗设备和技术,帮助提高医护质量和效率。',
  37. image: 'https://tse3-mm.cn.bing.net/th/id/OIP-C.NHe6NqhU0qZ_qLO0DQ08pAHaFj?rs=1&pid=ImgDetMain'
  38. },
  39. {
  40. title: '健康管理',
  41. description: '专业的健康管理方案,确保您的身体健康得到最佳维护。',
  42. image: ''
  43. },
  44. {
  45. title: '护理服务',
  46. description: '我们提供全面的护理服务,为患者提供贴心的照顾。',
  47. 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'
  48. }
  49. ];
  50. search(event: CustomEvent) {
  51. const searchTerm = event.detail.value;
  52. console.log('搜索内容:', searchTerm);
  53. // 在这里可以添加搜索逻辑,如过滤 items 数组
  54. }
  55. }