|
@@ -6,6 +6,7 @@ import { CommonModule } from '@angular/common';
|
|
|
import { TopicDetailComponent } from '../topic-detail/topic-detail.component';
|
|
|
import { Router } from '@angular/router';
|
|
|
import { TopicDetail2Component } from '../topic-detail2/topic-detail2.component';
|
|
|
+import { TopicDetail3Component } from '../topic-detail3/topic-detail3.component';
|
|
|
@Component({
|
|
|
selector: 'app-tab1',
|
|
|
templateUrl: 'tab1.page.html',
|
|
@@ -14,8 +15,10 @@ import { TopicDetail2Component } from '../topic-detail2/topic-detail2.component'
|
|
|
imports: [IonHeader,IonToolbar,IonTitle,IonContent,ExploreContainerComponent,
|
|
|
IonButtons,IonButton,IonIcon,
|
|
|
IonCard,IonCardContent,IonCardHeader,
|
|
|
- IonLabel,IonList,IonItem,IonAvatar,IonInput,IonSearchbar,
|
|
|
- CommonModule,TopicDetailComponent,TopicDetail2Component
|
|
|
+ IonLabel,IonList,IonItem,IonAvatar,
|
|
|
+ IonInput,IonSearchbar,
|
|
|
+ CommonModule,
|
|
|
+ TopicDetailComponent,TopicDetail2Component,TopicDetail3Component
|
|
|
],
|
|
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
|
})
|
|
@@ -83,6 +86,7 @@ export class Tab1Page {
|
|
|
constructor(private router: Router) {
|
|
|
// 其他构造函数代码
|
|
|
}
|
|
|
+
|
|
|
viewDetails(topicId: number): void {
|
|
|
let route: string;
|
|
|
switch (topicId) {
|
|
@@ -93,8 +97,7 @@ export class Tab1Page {
|
|
|
route = 'topic-detail2';
|
|
|
break;
|
|
|
case 3:
|
|
|
- // 如果有第三个详情页面
|
|
|
- route = 'another-detail';
|
|
|
+ route = 'topic-detail3';
|
|
|
break;
|
|
|
default:
|
|
|
route = 'topic-detail'; // 默认路由
|
|
@@ -102,8 +105,21 @@ export class Tab1Page {
|
|
|
// 导航到指定的路由,并可以传递参数(如果需要)
|
|
|
this.router.navigate([`tabs/${route}`, { id: topicId }]);
|
|
|
}
|
|
|
+
|
|
|
bookConsultation(consultant: any) {
|
|
|
// 预约咨询逻辑
|
|
|
console.log(`预约咨询: ${consultant.name}`);
|
|
|
}
|
|
|
+
|
|
|
+ evaluate() {
|
|
|
+ // 处理点击评价的逻辑
|
|
|
+ console.log('用户点击了“点击评价”按钮');
|
|
|
+ // 您可以导航到一个新的页面来让用户填写评价,或者显示一个模态框等。
|
|
|
+ }
|
|
|
+ review: any = { rating: 5 }; // 示例数据
|
|
|
+
|
|
|
+ // 创建一个方法,用于生成填充了 null 的数组
|
|
|
+ createFilledArray(length: number): any[] {
|
|
|
+ return Array(length).fill(null);
|
|
|
+ }
|
|
|
}
|