page-user-inquery.component.html 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <!-- 我的预约页面 -->
  2. <ion-header [translucent]="true">
  3. <ion-toolbar>
  4. <ion-buttons slot="start">
  5. <ion-back-button defaultHref="/"></ion-back-button>
  6. </ion-buttons>
  7. <ion-title>我的预约</ion-title>
  8. </ion-toolbar>
  9. </ion-header>
  10. <ion-content>
  11. <ion-refresher slot="fixed" (ionRefresh)="handleRefresh($event)">
  12. <ion-refresher-content></ion-refresher-content>
  13. </ion-refresher>
  14. <ion-list>
  15. <ion-card *ngFor="let appointment of appointmentList" class="appointment-card">
  16. <ion-card-content>
  17. <!-- 姓名和电话号码始终显示 -->
  18. <ion-item lines="none">
  19. <ion-label>
  20. <h2 class="appointment-name">姓名:{{appointment.get("username")}}</h2>
  21. </ion-label>
  22. </ion-item>
  23. <ion-item lines="none">
  24. <ion-icon name="call" slot="start" color="primary"></ion-icon>
  25. <ion-label class="appointment-phone">{{appointment.get("userPhone")}}</ion-label>
  26. </ion-item>
  27. <!-- 折叠按钮 -->
  28. <ion-button fill="clear" size="small" class="toggle-button" (click)="toggleDetails(appointment?.id)">
  29. <ion-icon [name]="isExpanded(appointment.id) ? 'chevron-up' : 'chevron-down'"></ion-icon>
  30. {{ isExpanded(appointment.id) ? '收起' : '展开' }}
  31. </ion-button>
  32. <!-- 折叠的内容 -->
  33. <div class="additional-details" *ngIf="isExpanded(appointment?.id)">
  34. <ion-item lines="none">
  35. <ion-icon name="calendar" slot="start" color="primary"></ion-icon>
  36. <ion-label class="appointment-type">预约方式:{{appointment.get("type")}}</ion-label>
  37. </ion-item>
  38. <ion-item lines="none">
  39. <ion-icon name="time" slot="start" color="primary"></ion-icon>
  40. <ion-label class="appointment-time">时间:{{appointment.updatedAt | date:'short'}}</ion-label>
  41. </ion-item>
  42. <ion-button
  43. expand="block"
  44. color="primary"
  45. class="action-button"
  46. (click)="presentAlert(appointment.get('username'), appointment.get('userPhone'))">
  47. 立即前往
  48. </ion-button>
  49. <ion-button color="danger" expand="block" (click)="deleteAppoint(appointment)">
  50. 删除预约
  51. </ion-button>
  52. </div>
  53. </ion-card-content>
  54. </ion-card>
  55. </ion-list>
  56. <!-- 空状态处理 -->
  57. <div *ngIf="appointmentList.length === 0" class="empty-state">
  58. <ion-icon name="calendar-outline" size="large" color="medium"></ion-icon>
  59. <p>您当前没有预约</p>
  60. </div>
  61. </ion-content>