<ion-header>
  <ion-toolbar color="primary">
    <ion-buttons slot="start">
      <ion-back-button defaultHref="/tabs/tab1"></ion-back-button> <!-- 添加返回按钮 -->
    </ion-buttons>
    <ion-title>我的病例</ion-title>
    <ion-buttons slot="end">
      <ion-button (click)="addNewCase()">
        <ion-icon name="add-circle"></ion-icon>
        新增病例
      </ion-button>
    </ion-buttons>
  </ion-toolbar>
</ion-header>

<ion-content>
  <ion-list>
    <ion-item *ngFor="let case of cases; let i = index" (click)="viewCaseDetails(i)">
      <ion-label>
        <h2>{{ case.title }}</h2>
        <p>{{ case.date | date: 'yyyy-MM-dd' }}</p>
      </ion-label>
      <ion-button fill="clear" slot="end" (click)="deleteCase(i)">
        <ion-icon name="trash"></ion-icon>
      </ion-button>
    </ion-item>
  </ion-list>
</ion-content>