Sfoglia il codice sorgente

feat:添加了提交成功的alert

Delancey 6 mesi fa
parent
commit
cf2d18d1f9

+ 8 - 2
travel-app/src/app/feedback/feedback.component.html

@@ -1,6 +1,6 @@
 <ion-header>
   <ion-toolbar>
-    <ion-title>意见反馈</ion-title>
+    <ion-title>问题建议</ion-title>
   </ion-toolbar>
 </ion-header>
 
@@ -32,9 +32,15 @@
     </ion-list>
   </ion-card>
  
-      <ion-button expand="block" class="custom-button">
+      <ion-button expand="block" class="custom-button" (click)="setOpen(true)">
         提交反馈
       </ion-button>
+      <ion-alert
+        [isOpen]="isAlertOpen"
+        header="提交成功"
+        [buttons]="alertButtons"
+        (didDismiss)="setOpen(false)"
+      ></ion-alert>
   </form>
 
 </ion-content>

+ 11 - 3
travel-app/src/app/feedback/feedback.component.ts

@@ -1,6 +1,6 @@
 import { FormsModule, ReactiveFormsModule } from '@angular/forms';
 import { Component, OnInit } from '@angular/core';
-import { IonHeader, IonToolbar, IonTitle, IonContent, IonList, IonItem, IonButton, IonBackButton, IonMenuToggle, IonSelect, IonSelectOption, IonLabel, IonTextarea, IonIcon, IonInput,IonCard,} from '@ionic/angular/standalone';
+import { IonHeader, IonToolbar, IonTitle, IonContent, IonList, IonItem, IonButton, IonBackButton, IonAlert,IonMenuToggle, IonSelect, IonSelectOption, IonLabel, IonTextarea, IonIcon, IonInput,IonCard,} from '@ionic/angular/standalone';
 import { ExploreContainerComponent } from '../explore-container/explore-container.component';
 import { FormBuilder } from '@angular/forms';
 import { CommonModule } from '@angular/common';
@@ -13,15 +13,23 @@ import { CommonModule } from '@angular/common';
     IonHeader, IonContent, IonToolbar, IonTitle, ExploreContainerComponent,
     IonButton, IonBackButton, IonMenuToggle, IonSelect, IonSelectOption, IonLabel,
     IonTextarea, IonIcon,IonInput,IonCard,
-    IonList, IonItem,
+    IonList, IonItem,IonAlert,
     FormsModule,
     ReactiveFormsModule,CommonModule
   ]
 })
 export class FeedbackComponent implements OnInit {
+  isAlertOpen = false;
+  alertButtons = ['Action'];
+
+  setOpen(isOpen: boolean) {
+    this.isAlertOpen = isOpen;
+  }
+
+
   selectedCategory = '';
   feedbackText = '';
-  categories = ['功能问题', '性能问题', '用户体验', '其他'];
+  categories = ['功能问题', '经济纠纷问题', '用户体验', '其他'];
 
   constructor(private fb: FormBuilder) { }
   onFileChange(event: any) {