  <ion-buttons slot="start">
      <ion-button class="back-button"(click)="dismissModal()">
        <ion-icon name="chevron-back"></ion-icon>
      </ion-button>
    </ion-buttons>

  <ion-text class="logo-text">
    <h1>慧吃</h1>
  </ion-text>

  <ion-content class="login-page">
  <ion-card class="login-card" >

    <ion-card-content>
      <ion-item class="no-border">
        <ion-input 
          [value]="username" 
          (ionChange)="usernameChange($event)" 
          placeholder="请输入账号/手机号" 
          clearInput>
        </ion-input>
      </ion-item>
      
      <ion-item class="no-border">
        <ion-input 
          [value]="password" 
          (ionChange)="passwordChange($event)" 
          placeholder="请输入密码" 
          type="password" 
          clearInput>
        </ion-input>
      </ion-item>

      @if(type=='signup'){
      <ion-item class="no-border">
        <ion-input 
          [value]="password2" 
          (ionChange)="password2Change($event)"  
          placeholder="请再次输入密码" 
          type="password" 
          clearInput>
        </ion-input>
      </ion-item>
}
      <!-- 登录和注册按钮 -->
      <ion-button 
        expand="block" 
        class="auth-button" 
        (click)="type === 'login' ? login() : signup()">
        {{ type === 'login' ? '登录' : '注册' }}
      </ion-button>

      <!-- 登录/注册切换 -->
      <ion-row class="auth-toggle">
        <ion-col>
          <ion-label 
            color="primary" 
            (click)="toggleType()">
            {{ type === 'login' ? '没有账号？注册' : '已有账号？登录' }}
          </ion-label>
        </ion-col>
      </ion-row>
    </ion-card-content>
  </ion-card>
</ion-content>