mine.page.html 1.1 KB

1234567891011121314151617181920212223242526272829
  1. <ion-header [translucent]="true">
  2. <ion-toolbar>
  3. <ion-title>我的</ion-title>
  4. </ion-toolbar>
  5. </ion-header>
  6. <ion-content [fullscreen]="true">
  7. <ion-header collapse="condense">
  8. <ion-toolbar>
  9. <ion-title size="large">我的</ion-title>
  10. </ion-toolbar>
  11. </ion-header>
  12. <ion-card>
  13. <img alt="" src="https://ionicframework.com/docs/img/demos/card-media.png" />
  14. <ion-card-header>
  15. <ion-card-title>{{user?.get("username") || '未登录'}}</ion-card-title>
  16. <ion-card-subtitle *ngIf="!user?.id">请您登陆后继续使用</ion-card-subtitle>
  17. <ion-card-subtitle *ngIf="user?.id">{{user?.get("name")}}-{{user?.get("gender")}}</ion-card-subtitle>
  18. </ion-card-header>
  19. <!-- 新增:根据用户状态,显示登录/登出按钮,执行跳转或登出函数 -->
  20. <ion-button *ngIf="!user?.id" fill="clear" routerLink="/user/login">登录</ion-button>
  21. <ion-button *ngIf="user?.id" fill="clear" routerLink="/user/edit/info">编辑资料</ion-button>
  22. <ion-button *ngIf="user?.id" fill="clear" (click)="logout()">登出</ion-button>
  23. </ion-card>
  24. </ion-content>