contact-list.component.html 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <ion-header [translucent]="true">
  2. <ion-toolbar>
  3. <ion-buttons slot="start">
  4. <ion-button routerLink="/lesson/me" fill="clear" color="dark">
  5. <ion-icon name="chevron-back-outline" size="small"></ion-icon>返回</ion-button>
  6. </ion-buttons>
  7. <ion-buttons slot="end">
  8. <ion-button routerLink="/user/add">
  9. <ion-icon slot="start" name="create-outline"></ion-icon>
  10. </ion-button>
  11. </ion-buttons>
  12. </ion-toolbar>
  13. </ion-header>
  14. <ion-content [fullscreen]="true">
  15. <!-- <ion-header collapse="condense">
  16. <ion-toolbar>
  17. <ion-title size="large">通讯录</ion-title>
  18. </ion-toolbar>
  19. </ion-header> -->
  20. <ion-searchbar [(ngModel)]="searchName" (ionInput)="search()" placeholder="搜一搜"></ion-searchbar>
  21. <ion-list>
  22. <ng-container *ngFor="let contact of contactList;let index = index;">
  23. <!-- 分组:根据下标首个出现的元素显示分组分隔符 -->
  24. <ion-item-divider *ngIf="charGroupIndex[contact.get('firstChar')] == index">
  25. <ion-label>{{contact.get('firstChar')}}</ion-label>
  26. </ion-item-divider>
  27. <ion-item lines="none">
  28. <ion-avatar slot="start">
  29. <img [src]="contact.get('avatarUrl') || 'https://ionicframework.com/docs/img/demos/avatar.svg'">
  30. </ion-avatar>
  31. <ion-label>
  32. <h2>{{ contact.get('name') }}</h2>
  33. <p>性别: {{ contact.get('gender') }}</p>
  34. <p>手机: {{ contact.get('mobile') }}</p>
  35. </ion-label>
  36. </ion-item>
  37. </ng-container>
  38. </ion-list>
  39. </ion-content>