| 
					
				 | 
			
			
				@@ -0,0 +1,50 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import { Component, OnInit } from '@angular/core'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import { IonHeader, IonButton, IonList, IonListHeader, IonItem,IonCardTitle, IonContent, IonIcon, IonLabel, IonCardHeader, IonCardContent, IonTitle, IonCard, IonToolbar, IonInput, IonSearchbar, IonSegment, IonSegmentButton, IonSelect, IonSelectOption } from '@ionic/angular/standalone'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import { CommonModule } from '@angular/common'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import { FormsModule } from '@angular/forms'; // 导入 FormsModule 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import { HttpClient } from '@angular/common/http'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import { CloudObject } from 'src/lib/ncloud'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import { ModalController } from '@ionic/angular'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+@Component({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  selector: 'app-throw-drift-bottle', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  templateUrl: './throw-drift-bottle.component.html', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  styleUrls: ['./throw-drift-bottle.component.scss'], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  standalone: true, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  imports: [ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    IonHeader, IonToolbar, IonTitle, IonContent, IonSegment, IonSegmentButton, IonSelect, IonSelectOption, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    FormsModule, IonList, IonListHeader, IonItem, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    IonLabel, IonIcon, IonButton, IonCardContent,IonCardTitle, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    IonInput, IonSearchbar, IonCard, IonCardHeader, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    CommonModule, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  ] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+}) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+export class ThrowDriftBottleComponent implements OnInit { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  driftbottleData: { content: string } = { content: '' }; // 漂流瓶内容 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  constructor(private http: HttpClient, private modalCtrl: ModalController) {} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  ngOnInit() {} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  throw() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    console.log('投掷漂流瓶:'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    console.log(`内容: ${this.driftbottleData.content}`); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // 这里可以添加逻辑将漂流瓶内容发布到后端或其他处理 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    const driftbottleData = { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      content: this.driftbottleData.content, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    let driftbottle = new CloudObject("Driftbottle"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    driftbottle.set(driftbottleData); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    driftbottle.save().then(data => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      console.log('漂流瓶已成功投掷', data); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.dismiss(); // 关闭模态框 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }).catch(err => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      console.error('投掷漂流瓶时出错'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  dismiss() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    this.modalCtrl.dismiss(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} 
			 |