|
@@ -1,17 +1,11 @@
|
|
|
<ion-header [translucent]="true">
|
|
|
<ion-toolbar>
|
|
|
- <!-- <ion-buttons slot="start">
|
|
|
- <ion-button (click)="backhome()" color="primary" >{{back}}</ion-button>
|
|
|
- </ion-buttons> -->
|
|
|
- <ion-button color="light" slot="start">
|
|
|
- <ion-back-button defaultHref="/" ></ion-back-button>
|
|
|
- </ion-button>
|
|
|
+ <ion-buttons slot="start">
|
|
|
+ <ion-back-button defaultHref="/" color="light"></ion-back-button>
|
|
|
+ </ion-buttons>
|
|
|
<ion-title>创建智能体</ion-title>
|
|
|
-
|
|
|
- @if(progress!=0 && progress!=1){
|
|
|
- <ion-progress-bar [value]="progress"></ion-progress-bar>
|
|
|
- }
|
|
|
-
|
|
|
+ <!-- 使用Angular的 *ngIf 指令来控制进度条的显示 -->
|
|
|
+ <ion-progress-bar *ngIf="progress > 0 && progress < 1" [value]="progress"></ion-progress-bar>
|
|
|
</ion-toolbar>
|
|
|
</ion-header>
|
|
|
|
|
@@ -19,69 +13,120 @@
|
|
|
<ion-refresher slot="fixed" (ionRefresh)="handleRefresh($event)">
|
|
|
<ion-refresher-content></ion-refresher-content>
|
|
|
</ion-refresher>
|
|
|
- <div style="text-align: center; margin-top: 20px">
|
|
|
- <img height="80px" [src]="currentUser.get('avatar')" alt="" style="border-radius: 50%;">
|
|
|
- <p>AI生成头像</p>
|
|
|
+
|
|
|
+ <!-- 用户头像和描述 -->
|
|
|
+ <div class="user-avatar-section">
|
|
|
+ <img
|
|
|
+ class="user-avatar"
|
|
|
+ [src]="currentUser.get('avatar') || '../../assets/image/doctor7.png'"
|
|
|
+ alt="用户头像"
|
|
|
+ />
|
|
|
+ <p class="avatar-description">AI生成头像</p>
|
|
|
</div>
|
|
|
- <div>
|
|
|
- <ion-card>
|
|
|
+
|
|
|
+ <!-- 创建智能体表单 -->
|
|
|
+ <ion-card class="form-card">
|
|
|
+ <ion-card-header>
|
|
|
+ <ion-card-title>创建智能体信息</ion-card-title>
|
|
|
+ </ion-card-header>
|
|
|
+ <ion-card-content>
|
|
|
<ion-list>
|
|
|
+ <!-- 名称输入 -->
|
|
|
<ion-item>
|
|
|
- <p style="width: 60px; font-weight: bolder;">名称:</p>
|
|
|
- <!-- <ion-input label="输入你想了解的科普信息" placeholder="Enter text"></ion-input> -->
|
|
|
- <ion-input [value]="name" placeholder="输入名称" (ionInput)="nameInput($event)"></ion-input>
|
|
|
+ <ion-label position="stacked">名称</ion-label>
|
|
|
+ <ion-input
|
|
|
+ type="text"
|
|
|
+ placeholder="输入名称"
|
|
|
+ [(ngModel)]="name"
|
|
|
+ ></ion-input>
|
|
|
</ion-item>
|
|
|
+
|
|
|
+ <!-- 年龄输入 -->
|
|
|
<ion-item>
|
|
|
- <p style="width: 60px; font-weight: bolder;">年龄:</p>
|
|
|
- <ion-input [value]="age" placeholder="输入年龄" (ionInput)="ageInput($event)"></ion-input>
|
|
|
+ <ion-label position="stacked">年龄</ion-label>
|
|
|
+ <ion-input
|
|
|
+ type="number"
|
|
|
+ placeholder="输入年龄"
|
|
|
+ [(ngModel)]="age"
|
|
|
+ ></ion-input>
|
|
|
</ion-item>
|
|
|
+
|
|
|
+ <!-- 性别选择 -->
|
|
|
<ion-item>
|
|
|
- <p style="width: 60px; font-weight: bolder;">性别:</p>
|
|
|
+ <ion-label position="stacked">性别</ion-label>
|
|
|
<ion-select
|
|
|
- aria-label="性别"
|
|
|
placeholder="选择性别"
|
|
|
- (ionChange)="genderChange($event)"
|
|
|
- (ionCancel)="genderCancel()"
|
|
|
- (ionDismiss)="genderDismiss()"
|
|
|
+ [(ngModel)]="gender"
|
|
|
>
|
|
|
<ion-select-option value="男">男</ion-select-option>
|
|
|
<ion-select-option value="女">女</ion-select-option>
|
|
|
+ <ion-select-option value="其他">其他</ion-select-option>
|
|
|
</ion-select>
|
|
|
</ion-item>
|
|
|
- <ion-item style="height: auto;">
|
|
|
- <p style="width:120px;font-weight: bolder;">设定描述:</p>
|
|
|
- <ion-textarea [value]="desc" placeholder="示例:你是一位经验丰富的妇科医生,拥有丰富的临床经验" (ionInput)="descInput($event)" autoGrow="true"></ion-textarea>
|
|
|
+
|
|
|
+ <!-- 设定描述 -->
|
|
|
+ <ion-item>
|
|
|
+ <ion-label position="stacked">设定描述</ion-label>
|
|
|
+ <ion-textarea
|
|
|
+ placeholder="示例:你是一位经验丰富的妇科医生,拥有丰富的临床经验"
|
|
|
+ autoGrow="true"
|
|
|
+ [(ngModel)]="desc"
|
|
|
+ ></ion-textarea>
|
|
|
</ion-item>
|
|
|
</ion-list>
|
|
|
- </ion-card>
|
|
|
- </div>
|
|
|
- <ion-card>
|
|
|
+ </ion-card-content>
|
|
|
+ </ion-card>
|
|
|
+
|
|
|
+ <!-- 我的智能体列表 -->
|
|
|
+ <ion-card class="agent-list-card" *ngFor="let agent of agentList">
|
|
|
<ion-card-header>
|
|
|
<ion-card-title>我的智能体</ion-card-title>
|
|
|
<ion-card-subtitle>智能体</ion-card-subtitle>
|
|
|
</ion-card-header>
|
|
|
<ion-card-content>
|
|
|
<ion-list>
|
|
|
- <ion-item *ngFor="let agent of agentList" lines="none">
|
|
|
- <ion-thumbnail slot="start" (click)="openInquiry(agent)">
|
|
|
- <img [src]="agent.get('avatar') || '../../assets/image/doctor7.png'" [alt]="agent.get('name')" />
|
|
|
+ <ion-item lines="none">
|
|
|
+ <ion-thumbnail slot="start">
|
|
|
+ <img
|
|
|
+ [src]="agent.get('avatar') || '../../assets/image/doctor7.png'"
|
|
|
+ [alt]="agent.get('name')"
|
|
|
+ (click)="openInquiry(agent)"
|
|
|
+ />
|
|
|
</ion-thumbnail>
|
|
|
- <div class="doctor-info" (click)="openInquiry(agent)">
|
|
|
- <div>
|
|
|
- <ion-text>{{ agent.get('name') }}({{ agent.get('age') }}岁)</ion-text>
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <ion-text>{{ agent.get('gender') }}</ion-text>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <ion-button ios="logo-apple" size="small" color="danger" (click)="deleteAgent(agent)" slot="end">删除</ion-button>
|
|
|
+ <ion-label (click)="openInquiry(agent)" class="agent-info">
|
|
|
+ <h2>{{ agent.get('name') }} ({{ agent.get('age') }}岁)</h2>
|
|
|
+ <p>{{ agent.get('gender') }}</p>
|
|
|
+ </ion-label>
|
|
|
+ <ion-button
|
|
|
+ size="small"
|
|
|
+ color="danger"
|
|
|
+ fill="clear"
|
|
|
+ (click)="deleteAgent(agent)"
|
|
|
+ slot="end"
|
|
|
+ >
|
|
|
+ 删除
|
|
|
+ </ion-button>
|
|
|
</ion-item>
|
|
|
</ion-list>
|
|
|
</ion-card-content>
|
|
|
</ion-card>
|
|
|
+
|
|
|
+ <!-- 空状态 -->
|
|
|
+ <div *ngIf="agentList.length === 0" class="empty-state">
|
|
|
+ <ion-icon name="person-off-outline" size="large"></ion-icon>
|
|
|
+ <p>暂无智能体记录</p>
|
|
|
+ </div>
|
|
|
</ion-content>
|
|
|
+
|
|
|
<ion-footer>
|
|
|
<ion-toolbar>
|
|
|
- <ion-button (click)="createAgent()" expand="block" color="primary" >创建ai医生</ion-button>
|
|
|
+ <ion-button
|
|
|
+ expand="block"
|
|
|
+ color="primary"
|
|
|
+ (click)="createAgent()"
|
|
|
+ class="create-agent-button"
|
|
|
+ >
|
|
|
+ 创建AI医生
|
|
|
+ </ion-button>
|
|
|
</ion-toolbar>
|
|
|
</ion-footer>
|