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