|
|
@@ -1,6 +1,6 @@
|
|
|
import { OnInit } from '@angular/core';
|
|
|
import { Component } from '@angular/core';
|
|
|
-import { IonHeader, IonToolbar, IonTitle, IonContent, IonCard, IonCardContent, IonButton, IonCardHeader, IonCardTitle, IonCardSubtitle, ModalController, IonInput, IonItem, IonSegment, IonSegmentButton, IonLabel } from '@ionic/angular/standalone';
|
|
|
+import { IonHeader, IonToolbar, IonTitle, IonContent, IonCard, IonCardContent, IonButton, IonCardHeader, IonCardTitle, IonCardSubtitle, ModalController, IonInput, IonItem, IonSegment, IonSegmentButton, IonLabel, ToastController } from '@ionic/angular/standalone';
|
|
|
import { CloudUser } from 'src/lib/ncloud';
|
|
|
|
|
|
@Component({
|
|
|
@@ -24,7 +24,7 @@ export class ModalUserEditComponent implements OnInit {
|
|
|
this.userData[key] = value
|
|
|
}
|
|
|
}
|
|
|
- constructor(private modalCtrl:ModalController) {
|
|
|
+ constructor(private modalCtrl:ModalController,private toastController: ToastController) {
|
|
|
this.currentUser = new CloudUser();
|
|
|
this.userData = this.currentUser.data;
|
|
|
}
|
|
|
@@ -41,6 +41,15 @@ export class ModalUserEditComponent implements OnInit {
|
|
|
this.currentUser?.set(this.userData)
|
|
|
await this.currentUser?.save()
|
|
|
this.modalCtrl.dismiss(this.currentUser,"confirm")
|
|
|
+
|
|
|
+// 创建并显示提示
|
|
|
+const toast = await this.toastController.create({
|
|
|
+ message: '编辑成功!',
|
|
|
+ duration: 2000, // 持续时间(毫秒)
|
|
|
+ position: 'bottom', // 显示位置
|
|
|
+});
|
|
|
+toast.present(); // 显示提示
|
|
|
+
|
|
|
}
|
|
|
cancel(){
|
|
|
this.modalCtrl.dismiss(null,"cancel")
|