Browse Source

上传文件至 '项目'

Gorilla 3 months ago
parent
commit
6fe7be3ab4
4 changed files with 179 additions and 0 deletions
  1. 82 0
      项目/tab2.page.html
  2. 17 0
      项目/tab2.page.ts
  3. 33 0
      项目/tab3.page.html
  4. 47 0
      项目/tab3.page.ts

+ 82 - 0
项目/tab2.page.html

@@ -0,0 +1,82 @@
+<ion-header>
+  <ion-toolbar>
+    <!-- 左侧 Logo -->
+    <ion-title>
+      <ion-icon name="logo-ionic" slot="start"></ion-icon>
+      <span>品牌名称</span>
+    </ion-title>
+    
+    <!-- 右侧 用户头像 -->
+    <ion-buttons slot="end">
+      <ion-avatar>
+        <img src="path_to_avatar.jpg" />
+      </ion-avatar>
+    </ion-buttons>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content>
+  <!-- 主功能区 -->
+  <div class="welcome-section">
+    <h2>欢迎回来,Gorilla!</h2>
+  </div>
+
+  <!-- AI问诊入口 -->
+  <ion-card>
+    <ion-card-header>
+      <ion-card-title>AI问诊</ion-card-title>
+    </ion-card-header>
+    <ion-card-content>
+      <ion-button expand="full" routerLink="/ai-consultation">
+        开始AI问诊
+      </ion-button>
+      <p>根据您的症状,AI将为您提供健康管理建议。</p>
+    </ion-card-content>
+  </ion-card>
+
+  <!-- 病例识别入口 -->
+  <ion-card>
+    <ion-card-header>
+      <ion-card-title>病例识别</ion-card-title>
+    </ion-card-header>
+    <ion-card-content>
+      <ion-button expand="full" routerLink="/case-recognition">
+        上传病例图像
+      </ion-button>
+      <p>上传您的胸部CT图片,AI帮助您分析潜在病症。</p>
+    </ion-card-content>
+  </ion-card>
+
+  <!-- BMI记录入口 -->
+  <ion-card>
+    <ion-card-header>
+      <ion-card-title>BMI记录</ion-card-title>
+    </ion-card-header>
+    <ion-card-content>
+      <ion-button expand="full" routerLink="/bmi-record">
+        记录BMI数据
+      </ion-button>
+      <p>输入您的体重和身高,查看健康曲线。</p>
+    </ion-card-content>
+  </ion-card>
+</ion-content>
+
+<!-- 底部导航栏 -->
+<ion-footer>
+  <ion-toolbar>
+    <ion-buttons>
+      <ion-button routerLink="/home">
+        <ion-icon name="home" slot="icon-only"></ion-icon>
+      </ion-button>
+      <ion-button routerLink="/records">
+        <ion-icon name="document-text" slot="icon-only"></ion-icon>
+      </ion-button>
+      <ion-button routerLink="/settings">
+        <ion-icon name="settings" slot="icon-only"></ion-icon>
+      </ion-button>
+      <ion-button routerLink="/health-data">
+        <ion-icon name="bar-chart" slot="icon-only"></ion-icon>
+      </ion-button>
+    </ion-buttons>
+  </ion-toolbar>
+</ion-footer>

+ 17 - 0
项目/tab2.page.ts

@@ -0,0 +1,17 @@
+import { Component } from '@angular/core';
+import { IonCardTitle,IonAvatar ,IonCardContent,IonIcon ,IonButtons,IonFooter,IonButton, IonCard ,IonHeader, IonToolbar, IonTitle, IonContent, IonCardHeader } from '@ionic/angular/standalone';
+import { ExploreContainerComponent } from '../explore-container/explore-container.component';
+
+
+@Component({
+  selector: 'app-tab2',
+  templateUrl: 'tab2.page.html',
+  styleUrls: ['tab2.page.scss'],
+  standalone: true,
+  imports: [IonCardContent,IonHeader,IonAvatar,IonCardContent,IonCardHeader,IonCardTitle,IonFooter,IonButtons, IonToolbar, IonTitle, IonContent, ExploreContainerComponent,IonHeader,IonCard,IonButton,IonIcon]
+})
+export class Tab2Page {
+
+  constructor() {}
+
+}

+ 33 - 0
项目/tab3.page.html

@@ -0,0 +1,33 @@
+<!-- src/app/tab3/tab3.page.html -->
+<ion-header>
+  <ion-toolbar>
+    <ion-title>BMI记录</ion-title>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content class="ion-padding">
+  <!-- 身高输入 -->
+  <ion-item>
+    <ion-label position="floating">身高 (cm)</ion-label>
+    <ion-input type="number" (ionInput)="onHeightInput($event)"></ion-input>
+  </ion-item>
+
+  <!-- 体重输入 -->
+  <ion-item>
+    <ion-label position="floating">体重 (kg)</ion-label>
+    <ion-input type="number" (ionInput)="onWeightInput($event)"></ion-input>
+  </ion-item>
+
+  <!-- 计算BMI按钮 -->
+  <ion-button expand="full" (click)="calculateBMI()">计算BMI</ion-button>
+
+  <!-- 显示BMI结果 -->
+  <ion-card *ngIf="bmi !== null">
+    <ion-card-header>
+      <ion-card-title>您的BMI</ion-card-title>
+    </ion-card-header>
+    <ion-card-content>
+      <p>您的BMI为{{ bmi | number:'1.1-1' }},属于‘{{ healthStatus }}’范围。</p>
+    </ion-card-content>
+  </ion-card>
+</ion-content>

+ 47 - 0
项目/tab3.page.ts

@@ -0,0 +1,47 @@
+import { Component } from '@angular/core';
+import {IonItem,IonInput, IonCardTitle, IonAvatar, IonCardContent, IonIcon, IonButtons, IonFooter, IonButton, IonCard, IonHeader, IonToolbar, IonTitle, IonContent, IonCardHeader, IonLabel} from '@ionic/angular/standalone';
+import { ExploreContainerComponent } from '../explore-container/explore-container.component';
+import { CommonModule } from '@angular/common';
+
+@Component({
+  selector: 'app-tab3',
+  templateUrl: 'tab3.page.html',
+  styleUrls: ['tab3.page.scss'],
+  standalone: true,
+  imports: [CommonModule,IonInput,IonItem,IonLabel,IonCardContent,IonHeader,IonAvatar,IonCardContent,IonCardHeader,IonCardTitle,IonFooter,IonButtons, IonToolbar, IonTitle, IonContent, ExploreContainerComponent,IonHeader,IonCard,IonButton,IonIcon]
+})
+export class Tab3Page {
+  height: number | null = null;
+  weight: number | null = null;
+  bmi: number | null = null;
+  healthStatus: string = '';
+
+  // 更新身高
+  onHeightInput(event: any) {
+    this.height = parseFloat(event.target.value);
+  }
+
+  // 更新体重
+  onWeightInput(event: any) {
+    this.weight = parseFloat(event.target.value);
+  }
+
+  // 计算BMI
+  calculateBMI() {
+    if (this.height !== null && this.weight !== null && this.height > 0 && this.weight > 0) {
+      this.bmi = this.weight / ((this.height / 100) ** 2);
+      if (this.bmi < 18.5) {
+        this.healthStatus = '偏瘦';
+      } else if (this.bmi >= 18.5 && this.bmi < 24.9) {
+        this.healthStatus = '正常';
+      } else if (this.bmi >= 25 && this.bmi < 29.9) {
+        this.healthStatus = '偏重';
+      } else {
+        this.healthStatus = '超重';
+      }
+    } else {
+      this.bmi = null;
+      this.healthStatus = '请输入有效的身高和体重。';
+    }
+  }
+}