<ion-header [translucent]="true">
  <ion-toolbar class="custom-toolbar">
    <ion-buttons slot="start">
      <ion-back-button defaultHref="tabs/person"></ion-back-button>
    </ion-buttons>
    <ion-title class="custom-title">
      我的
    </ion-title>
  </ion-toolbar>
</ion-header>
<ion-content [fullscreen]="true" class="ion-padding"
  style="background-image: url('../../assets/images/background-image6.jpg'); background-size: cover; background-position: center; background-repeat: no-repeat;">


  <ion-refresher slot="fixed" (ionRefresh)="handleRefresh($event)">
    <ion-refresher-content></ion-refresher-content>
  </ion-refresher>
 
  <ion-card>
       
      <ion-card-header class="card-header">
        <img [src]="currentUser?.get('avatar')" onerror="this.src='https://app.fmode.cn/dev/jxnu/202226701019/头像示例.png';" alt="图片加载失败" class="avatar" />
        <div class="user-info">
            <ion-card-title>账号：{{currentUser?.get("username")}}</ion-card-title>
            <ion-card-subtitle>
                姓名: {{currentUser?.get("realname") || "-"}} 
                性别: {{currentUser?.get("gender") || "-"}} 
                年龄: {{currentUser?.get("age") || "-"}}
            </ion-card-subtitle>
        </div>
    </ion-card-header>
      
      <ion-card-content>
      @if(!currentUser?.id){
        <ion-button expand="block" (click)="signup()" color="success">注册</ion-button>
        <ion-button expand="block" (click)="login()" color="success">登录</ion-button>
      }
     @if(currentUser?.id){
      <ion-button expand="block" (click)="editUser()" color="success">编辑资料</ion-button>
      <ion-button expand="block" (click)="logout()" color="medium">登出</ion-button>
    }
    </ion-card-content>
  </ion-card>



</ion-content>
