|
@@ -1,16 +1,66 @@
|
|
|
-import { Component } from '@angular/core';
|
|
|
+import { Component,CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
|
|
import { IonHeader, IonToolbar, IonTitle, IonContent } from '@ionic/angular/standalone';
|
|
|
import { ExploreContainerComponent } from '../explore-container/explore-container.component';
|
|
|
+import { IonButton, IonCard, IonCardContent, IonCardHeader, IonCardTitle, IonItem, IonLabel,
|
|
|
+ IonList,IonSelect, IonSelectOption } from '@ionic/angular/standalone';
|
|
|
+import { CommonModule } from '@angular/common';
|
|
|
|
|
|
@Component({
|
|
|
selector: 'app-tab2',
|
|
|
templateUrl: 'tab2.page.html',
|
|
|
styleUrls: ['tab2.page.scss'],
|
|
|
standalone: true,
|
|
|
- imports: [IonHeader, IonToolbar, IonTitle, IonContent, ExploreContainerComponent]
|
|
|
+ imports: [IonHeader, IonToolbar, IonTitle, IonContent, ExploreContainerComponent,
|
|
|
+ IonCard,IonCardHeader,IonCardTitle,IonCardContent,
|
|
|
+ IonItem,IonLabel,
|
|
|
+ IonSelect,IonSelectOption,
|
|
|
+ IonButton,IonList,
|
|
|
+ CommonModule
|
|
|
+ ],
|
|
|
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
|
})
|
|
|
export class Tab2Page {
|
|
|
|
|
|
- constructor() {}
|
|
|
+ constructor() {
|
|
|
+ this.selectedIssue = ''; // 或者其他合适的默认值
|
|
|
+ }
|
|
|
+ selectedIssue:string;
|
|
|
+ matchedCounselor: { name: string; specialty: string } | null = null;
|
|
|
+
|
|
|
+ questions = [
|
|
|
+ {
|
|
|
+ title: '如何应对焦虑?',
|
|
|
+ advice: '尝试深呼吸和正念冥想,保持规律的作息。',
|
|
|
+ expanded: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '如何提高自信心?',
|
|
|
+ advice: '设定小目标并逐步实现,进行积极自我对话。',
|
|
|
+ expanded: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '如何改善人际关系?',
|
|
|
+ advice: '多与他人沟通,倾听对方的感受。',
|
|
|
+ expanded: false,
|
|
|
+ },
|
|
|
+ ];
|
|
|
+
|
|
|
+ matchCounselor() {
|
|
|
+ // 这里可以根据selectedIssue进行匹配逻辑
|
|
|
+ if (this.selectedIssue === 'anxiety') {
|
|
|
+ this.matchedCounselor = { name: '张医生', specialty: '焦虑' };
|
|
|
+ } else if (this.selectedIssue === 'depression') {
|
|
|
+ this.matchedCounselor = { name: '李医生', specialty: '抑郁' };
|
|
|
+ } else if (this.selectedIssue === 'relationship') {
|
|
|
+ this.matchedCounselor = { name: '王医生', specialty: '人际关系' };
|
|
|
+ } else {
|
|
|
+ this.matchedCounselor = null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ startChat() {
|
|
|
+ // 开始陪聊的逻辑
|
|
|
+ console.log('开始陪聊服务');
|
|
|
+ }
|
|
|
|
|
|
}
|