<ion-header>
  <ion-toolbar>
    <ion-title>作物管家</ion-title>
    <ion-buttons slot="end">
      <ion-button routerLink="/user-profile">
        <ion-icon name="person-circle"></ion-icon>
      </ion-button>
    </ion-buttons>
  </ion-toolbar>
</ion-header>

<ion-content [fullscreen]="true">
  <ion-card>
    <ion-card-header>
      <ion-card-title>种植方案</ion-card-title>
    </ion-card-header>
    <ion-card-content>
      <ion-item>
        <ion-label position="floating">选择种植地点</ion-label>
        <ion-input type="text" [(ngModel)]="location"></ion-input>
      </ion-item>
      <ion-item>
        <ion-label position="floating">选择作物</ion-label>
        <ion-input type="text" [(ngModel)]="crop"></ion-input>
      </ion-item>
      <ion-button expand="full" (click)="getPlantingPlan()">获取种植方案</ion-button>
      <div *ngIf="plantingPlan">
        <h3>生成的种植方案:</h3>
        <p>{{ plantingPlan }}</p>
      </div>
    </ion-card-content>
  </ion-card>

  <ion-card>
    <ion-card-header>
      <ion-card-title>植物医生</ion-card-title>
    </ion-card-header>
    <ion-card-content>
      <ion-item>
        <ion-label position="floating">输入作物症状</ion-label>
        <ion-input type="text" [(ngModel)]="symptom"></ion-input>
      </ion-item>
      <ion-button expand="full" (click)="getPlantDoctorAdvice()">获取病虫害处理建议</ion-button>
      <div *ngIf="plantDoctorAdvice">
        <h3>处理建议:</h3>
        <p>{{ plantDoctorAdvice }}</p>
      </div>
    </ion-card-content>
  </ion-card>
</ion-content>
