|
|
@@ -1,28 +1,40 @@
|
|
|
import { Component } from '@angular/core';
|
|
|
-import { IonHeader, IonToolbar, IonTitle, IonContent, IonButton, IonList, IonItem, IonAvatar, IonLabel, IonCardHeader, IonCardContent, IonInput, IonFooter, IonButtons, IonCard, IonCardTitle } from '@ionic/angular/standalone';
|
|
|
-import { ExploreContainerComponent } from '../explore-container/explore-container.component';
|
|
|
-import { EditRatingStarComponent } from '../edit-rating-star/edit-rating-star.component';
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+import { ModalHintComponent } from 'src/lib/user/modal-hint/modal-hint.component'; // 确保路径正确
|
|
|
+import { IonButton, IonContent, IonHeader, IonTitle, IonToolbar,ModalController } from '@ionic/angular/standalone';
|
|
|
+import { Router } from '@angular/router';
|
|
|
@Component({
|
|
|
selector: 'app-tab2',
|
|
|
templateUrl: 'tab2.page.html',
|
|
|
styleUrls: ['tab2.page.scss'],
|
|
|
standalone: true,
|
|
|
- imports: [IonHeader,IonToolbar, IonTitle, IonContent,IonList,IonItem,IonAvatar,IonLabel,IonCard,IonCardHeader,IonCardContent,IonCardTitle,IonInput,IonFooter,IonButtons,IonButton,ExploreContainerComponent,EditRatingStarComponent]
|
|
|
+ imports: [IonHeader, IonToolbar, IonTitle, IonContent, IonButton], // 确保导入 IonicModule
|
|
|
})
|
|
|
export class Tab2Page {
|
|
|
- currentScore: number = 0; // 初始分值
|
|
|
+ constructor(private modalCtrl: ModalController,private router: Router) {}
|
|
|
|
|
|
- handleScoreChange(newScore: number) {
|
|
|
- this.currentScore = newScore;
|
|
|
- console.log('新分值:', newScore); // 处理分值变化
|
|
|
- }
|
|
|
+ async openModal() {
|
|
|
+ const modal = await this.modalCtrl.create({
|
|
|
+ component: ModalHintComponent,
|
|
|
+ breakpoints: [0.7, 1.0],
|
|
|
+ initialBreakpoint: 0.7
|
|
|
+ });
|
|
|
+ await modal.present();
|
|
|
+
|
|
|
+ const { data, role } = await modal.onWillDismiss();
|
|
|
|
|
|
+ if (role === 'confirm') {
|
|
|
+ console.log('接收到的数据:', data); // 处理返回的数据
|
|
|
+ // 这里可以根据需要进一步处理 data.data1 和 data.data2
|
|
|
+ }
|
|
|
|
|
|
+
|
|
|
|
|
|
- constructor() {}
|
|
|
+
|
|
|
+ this.router.navigate(['/tabs/report']);
|
|
|
+
|
|
|
+ const data1 = { data: data }; // 需要发送的数据
|
|
|
+ this.router.navigate(['/tabs/report', { data: JSON.stringify(data1) }]); // 发送数据
|
|
|
+
|
|
|
|
|
|
+ }
|
|
|
}
|