| 
					
				 | 
			
			
				@@ -0,0 +1,82 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import { OnInit } from '@angular/core'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import { Component } from '@angular/core'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import { ModalController, IonInput, IonItem, IonLabel, IonSegment,  IonButton, IonCard, IonSegmentButton,IonCardHeader, IonCardTitle, IonCardSubtitle, IonCardContent, IonSelect, IonSelectOption } from '@ionic/angular/standalone'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import { CloudUser } from 'src/lib/ncloud'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import { FormsModule } from '@angular/forms'; // 导入 FormsModule 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import { CommonModule } from '@angular/common'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+@Component({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  selector: 'app-modal-identity-verification', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  templateUrl: './modal-identity-verification.component.html', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  styleUrls: ['./modal-identity-verification.component.scss'], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  standalone: true, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  imports: [ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    IonCard, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    IonCardHeader, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    IonCardTitle, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    IonCardSubtitle, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    IonCardContent, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    IonSegment,   
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    IonSegmentButton, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    IonButton, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    IonInput, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    IonItem, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    IonLabel, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    IonSelect, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    IonSelectOption, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    FormsModule, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    CommonModule 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  ], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+}) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+export class ModalIdentityVerificationComponent implements OnInit { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  currentUser: CloudUser | undefined; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  userData: any = { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    school: '', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    identity: '', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    studentID: '', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    department: '', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    teacherID: '' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  constructor(private modalCtrl: ModalController) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    this.currentUser = new CloudUser(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  ngOnInit() {} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  onIdentityChange() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // 根据身份选择进行处理 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    if (this.userData.identity === 'student') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.userData.teacherID = ''; // 清空教师ID字段 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } else if (this.userData.identity === 'teacher') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.userData.studentID = ''; // 清空学号字段 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.userData.department = ''; // 清空学院字段 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  async save() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    this.currentUser?.set(this.userData); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    await this.currentUser?.save(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    this.modalCtrl.dismiss(this.currentUser, "confirm"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  cancel() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    this.modalCtrl.dismiss(null, "cancel"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+export async function openIdentityVerificationModal(modalCtrl: ModalController): Promise<CloudUser | null> { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  const modal = await modalCtrl.create({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    component: ModalIdentityVerificationComponent, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    breakpoints: [0.7, 1.0], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    initialBreakpoint: 0.7 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  modal.present(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  const { data, role } = await modal.onWillDismiss(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  if (role === 'confirm') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    return data; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  return null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} 
			 |