|
@@ -1,7 +1,7 @@
|
|
import { Component } from '@angular/core';
|
|
import { Component } from '@angular/core';
|
|
import { Router } from '@angular/router';
|
|
import { Router } from '@angular/router';
|
|
import * as Parse from "parse";
|
|
import * as Parse from "parse";
|
|
-import { CheckboxCustomEvent } from '@ionic/angular';
|
|
|
|
|
|
+import { CheckboxCustomEvent,ModalController } from '@ionic/angular';
|
|
|
|
|
|
@Component({
|
|
@Component({
|
|
selector: 'app-page-add',
|
|
selector: 'app-page-add',
|
|
@@ -18,10 +18,13 @@ export class PageAddComponent {
|
|
selectedImage: string | ArrayBuffer | null = null;
|
|
selectedImage: string | ArrayBuffer | null = null;
|
|
canDismiss = false;
|
|
canDismiss = false;
|
|
presentingElement: Element | null = null;
|
|
presentingElement: Element | null = null;
|
|
|
|
+ modalController: ModalController;
|
|
|
|
|
|
- constructor(
|
|
|
|
|
|
+ constructor(modalController: ModalController,
|
|
private router: Router
|
|
private router: Router
|
|
- ) {}
|
|
|
|
|
|
+
|
|
|
|
+ ) { this.modalController = modalController;
|
|
|
|
+ }
|
|
|
|
|
|
ngOnInit() {
|
|
ngOnInit() {
|
|
this.presentingElement = document.querySelector('.ion-page');
|
|
this.presentingElement = document.querySelector('.ion-page');
|
|
@@ -45,7 +48,9 @@ export class PageAddComponent {
|
|
console.error('Error while saving new contact', error);
|
|
console.error('Error while saving new contact', error);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ saveBack(){
|
|
|
|
+ this.router.navigate(['/lesson/me/add']); // 导航到联系人列表页面
|
|
|
|
+ }
|
|
onFileSelected(event: Event) {
|
|
onFileSelected(event: Event) {
|
|
const inputElement = event.target as HTMLInputElement;
|
|
const inputElement = event.target as HTMLInputElement;
|
|
if (inputElement.files && inputElement.files[0]) {
|
|
if (inputElement.files && inputElement.files[0]) {
|
|
@@ -58,7 +63,10 @@ export class PageAddComponent {
|
|
reader.readAsDataURL(file);
|
|
reader.readAsDataURL(file);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ dismissModal() {
|
|
|
|
+ this.modalController.dismiss();
|
|
|
|
+ }
|
|
|
|
+
|
|
onTermsChanged(event: Event) {
|
|
onTermsChanged(event: Event) {
|
|
const ev = event as CheckboxCustomEvent;
|
|
const ev = event as CheckboxCustomEvent;
|
|
this.canDismiss = ev.detail.checked;
|
|
this.canDismiss = ev.detail.checked;
|