Browse Source

feat.liao.5.0

19136808282 3 months ago
parent
commit
ea78dc7522
93 changed files with 5210 additions and 105 deletions
  1. 29 0
      .history/soul-app/src/app/app.component_20241227155753.ts
  2. 24 0
      .history/soul-app/src/app/app.routes_20241224091902.ts
  3. 29 0
      .history/soul-app/src/app/app.routes_20241227160011.ts
  4. 86 0
      .history/soul-app/src/app/drift-bottle/drift-bottle.component_20241227170306.ts
  5. 86 0
      .history/soul-app/src/app/drift-bottle/drift-bottle.component_20241227170446.ts
  6. 86 0
      .history/soul-app/src/app/drift-bottle/drift-bottle.component_20241227170657.ts
  7. 30 0
      .history/soul-app/src/app/drift-bottle/drift-bottle.component_20241227171106.html
  8. 86 0
      .history/soul-app/src/app/drift-bottle/drift-bottle.component_20241227171107.ts
  9. 98 0
      .history/soul-app/src/app/drift-bottle/drift-bottle.component_20241227172236.ts
  10. 86 0
      .history/soul-app/src/app/drift-bottle/drift-bottle.component_20241227172420.ts
  11. 98 0
      .history/soul-app/src/app/drift-bottle/drift-bottle.component_20241227172433.ts
  12. 86 0
      .history/soul-app/src/app/drift-bottle/drift-bottle.component_20241227172820.ts
  13. 98 0
      .history/soul-app/src/app/drift-bottle/drift-bottle.component_20241227172923.ts
  14. 30 0
      .history/soul-app/src/app/drift-bottle/drift-bottle.component_20241227181813.html
  15. 111 0
      .history/soul-app/src/app/drift-bottle/drift-bottle.component_20241227183207.ts
  16. 60 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227154730.ts
  17. 27 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227160003.html
  18. 62 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227160006.scss
  19. 60 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227160009.ts
  20. 55 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227160055.scss
  21. 35 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227160257.html
  22. 27 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227160530.ts
  23. 35 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227160651.html
  24. 35 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227160710.html
  25. 35 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227160812.html
  26. 30 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227160833.html
  27. 48 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227161556.html
  28. 61 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227161558.ts
  29. 61 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227161652.ts
  30. 48 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227161744.html
  31. 48 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227161754.html
  32. 46 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227162646.html
  33. 70 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227162658.ts
  34. 46 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227162832.html
  35. 70 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227162837.ts
  36. 42 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227162925.html
  37. 42 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227163048.html
  38. 42 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227163404.html
  39. 51 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227163546.html
  40. 51 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227163701.html
  41. 51 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227164048.html
  42. 64 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227164741.ts
  43. 58 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227164921.html
  44. 58 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227164937.html
  45. 58 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227165005.html
  46. 64 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227165235.ts
  47. 64 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227165509.ts
  48. 58 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227174152.html
  49. 59 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227174154.ts
  50. 58 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227174223.html
  51. 58 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227174238.html
  52. 58 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227174245.html
  53. 58 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227174303.html
  54. 58 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227174425.html
  55. 58 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227180046.html
  56. 58 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227180214.html
  57. 58 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227180257.html
  58. 58 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227181144.html
  59. 59 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227181752.ts
  60. 71 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227184220.ts
  61. 58 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227184245.html
  62. 58 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227184300.html
  63. 58 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227184422.html
  64. 58 0
      .history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227184450.html
  65. 58 0
      .history/soul-app/src/app/page-psysurvey/page-psysurvey.component_20241227164210.ts
  66. 56 0
      .history/soul-app/src/app/page-psysurvey/page-psysurvey.component_20241227173254.ts
  67. 78 0
      .history/soul-app/src/app/throw-drift-bottle/throw-drift-bottle.component_20241227151907.ts
  68. 83 0
      .history/soul-app/src/app/throw-drift-bottle/throw-drift-bottle.component_20241227152138.ts
  69. 85 0
      .history/soul-app/src/app/throw-drift-bottle/throw-drift-bottle.component_20241227152511.ts
  70. 104 0
      .history/soul-app/src/app/throw-drift-bottle/throw-drift-bottle.component_20241227152950.ts
  71. 104 0
      .history/soul-app/src/app/throw-drift-bottle/throw-drift-bottle.component_20241227174805.ts
  72. 104 0
      .history/soul-app/src/app/throw-drift-bottle/throw-drift-bottle.component_20241227174914.ts
  73. 100 0
      .history/soul-app/src/app/throw-drift-bottle/throw-drift-bottle.component_20241227175055.ts
  74. 104 0
      .history/soul-app/src/app/throw-drift-bottle/throw-drift-bottle.component_20241227175708.ts
  75. 114 0
      .history/soul-app/src/app/throw-drift-bottle/throw-drift-bottle.component_20241227180703.ts
  76. 114 0
      .history/soul-app/src/app/throw-drift-bottle/throw-drift-bottle.component_20241227181007.ts
  77. 114 0
      .history/soul-app/src/app/throw-drift-bottle/throw-drift-bottle.component_20241227181100.ts
  78. 29 0
      .history/soul-app/src/app/user.service_20241227151832.ts
  79. 38 0
      .history/soul-app/src/app/user.service_20241227152120.ts
  80. 5 1
      soul-app/src/app/app.component.ts
  81. 14 9
      soul-app/src/app/app.routes.ts
  82. 0 3
      soul-app/src/app/catch-drift-bottle/catch-drift-bottle.component.html
  83. 0 0
      soul-app/src/app/catch-drift-bottle/catch-drift-bottle.component.scss
  84. 0 22
      soul-app/src/app/catch-drift-bottle/catch-drift-bottle.component.spec.ts
  85. 0 15
      soul-app/src/app/catch-drift-bottle/catch-drift-bottle.component.ts
  86. 2 3
      soul-app/src/app/drift-bottle/drift-bottle.component.html
  87. 47 9
      soul-app/src/app/drift-bottle/drift-bottle.component.ts
  88. 45 1
      soul-app/src/app/my-drift-bottle/my-drift-bottle.component.html
  89. 1 0
      soul-app/src/app/my-drift-bottle/my-drift-bottle.component.scss
  90. 60 16
      soul-app/src/app/my-drift-bottle/my-drift-bottle.component.ts
  91. 1 3
      soul-app/src/app/page-psysurvey/page-psysurvey.component.ts
  92. 56 19
      soul-app/src/app/throw-drift-bottle/throw-drift-bottle.component.ts
  93. 26 4
      soul-app/src/app/user.service.ts

+ 29 - 0
.history/soul-app/src/app/app.component_20241227155753.ts

@@ -0,0 +1,29 @@
+import { Component } from '@angular/core';
+import { IonApp, IonRouterOutlet } from '@ionic/angular/standalone';
+import { RouterModule, Routes} from '@angular/router';
+import { PagePsysurveyComponent } from './page-psysurvey/page-psysurvey.component'; // 替换为你的实际路径
+import { PagePublishsurveyComponent } from './page-publishsurvey/page-publishsurvey.component'; // 替换为你的实际路径
+import { MyDriftBottleComponent } from './my-drift-bottle/my-drift-bottle.component';
+import { ThrowDriftBottleComponent } from './throw-drift-bottle/throw-drift-bottle.component';
+
+
+const routes: Routes = [
+  { path: '', redirectTo: 'tabs/tab1', pathMatch: 'full' },
+  { path: 'tabs/tab1', component: PagePsysurveyComponent },
+  { path: 'tabs/publishsurvey', component: PagePublishsurveyComponent },
+  { path:'tabs/throw-drift-bottle',component:ThrowDriftBottleComponent},
+  { path:'tabs/my-drift-bottle',component:MyDriftBottleComponent}
+  // 添加其他路由
+];
+
+@Component({
+  selector: 'app-root',
+  templateUrl: 'app.component.html',
+  standalone: true,
+  imports: [IonApp, IonRouterOutlet, RouterModule],
+ 
+})
+
+export class AppComponent {
+  constructor() {}
+}

+ 24 - 0
.history/soul-app/src/app/app.routes_20241224091902.ts

@@ -0,0 +1,24 @@
+import { Routes } from '@angular/router';
+
+export const routes: Routes = [
+    {
+    path: '',
+    loadChildren: () => import('./tabs/tabs.routes').then((m) => m.routes),
+    },
+    // 聊天模块
+   {
+    path: "chat/session/role/:roleId",
+    loadComponent: () => import('./test-chat-panel/test-chat-panel.component').then(m => m.TestChatPanelComponent),
+    runGuardsAndResolvers: "always",
+},
+{
+    path: "chat/session/chat/:chatId",
+    loadComponent: () => import('./test-chat-panel/test-chat-panel.component').then(m => m.TestChatPanelComponent),
+    runGuardsAndResolvers: "always",
+},
+{
+    path: 'chat/pro/chat/:chatId',
+    redirectTo: '/chat/session/chat/:chatId',
+    pathMatch: 'full'
+  },
+];

+ 29 - 0
.history/soul-app/src/app/app.routes_20241227160011.ts

@@ -0,0 +1,29 @@
+import { Routes } from '@angular/router';
+
+export const routes: Routes = [
+  {
+    path: '',
+    loadChildren: () => import('./tabs/tabs.routes').then((m) => m.routes),
+  },
+  // 聊天模块
+  {
+    path: "chat/session/role/:roleId",
+    loadComponent: () => import('./test-chat-panel/test-chat-panel.component').then(m => m.TestChatPanelComponent),
+    runGuardsAndResolvers: "always",
+  },
+  {
+    path: "chat/session/chat/:chatId",
+    loadComponent: () => import('./test-chat-panel/test-chat-panel.component').then(m => m.TestChatPanelComponent),
+    runGuardsAndResolvers: "always",
+  },
+  {
+    path: 'chat/pro/chat/:chatId',
+    redirectTo: '/chat/session/chat/:chatId',
+    pathMatch: 'full'
+  },
+  // 添加我的漂流瓶路由
+  {
+    path: 'tabs/my-drift-bottle',
+    loadComponent: () => import('./my-drift-bottle/my-drift-bottle.component').then(m => m.MyDriftBottleComponent)
+  },
+];

+ 86 - 0
.history/soul-app/src/app/drift-bottle/drift-bottle.component_20241227170306.ts

@@ -0,0 +1,86 @@
+import { Component, OnInit, OnDestroy } from '@angular/core';
+import { Router } from '@angular/router';
+import { IonicModule } from '@ionic/angular';
+import { openThrowDriftBottleModal } from '../throw-drift-bottle/throw-drift-bottle.component';
+import { ModalController } from '@ionic/angular/standalone';
+import { HttpClient } from '@angular/common/http';
+import { CloudObject, CloudQuery } from 'src/lib/ncloud';
+
+@Component({
+  selector: 'app-drift-bottle',
+  templateUrl: './drift-bottle.component.html',
+  styleUrls: ['./drift-bottle.component.scss'],
+  standalone: true,
+  imports: [
+    IonicModule,
+    // 其他导入项...
+  ]
+})
+export class DriftBottleComponent implements OnInit, OnDestroy {
+  alertHeader: string = '';
+  alertMessage: string = '';
+  private audioElement: HTMLAudioElement | undefined;
+
+  constructor(
+    private router: Router,
+    private modalCtrl: ModalController,
+    private http: HttpClient
+  ) {}
+
+  ngOnInit() {
+    this.audioElement = document.getElementById('backgroundAudio') as HTMLAudioElement;
+    if (this.audioElement) {
+      this.audioElement.play();
+    }
+  }
+
+  ngOnDestroy() {
+    if (this.audioElement) {
+      this.audioElement.pause();
+      this.audioElement.currentTime = 0; // 重置音频时间
+    }
+  }
+
+  throwDriftBottleModal() {
+    openThrowDriftBottleModal(this.modalCtrl);
+  }
+
+  catchDriftBottle() {
+    const query = new CloudQuery("DriftBottle");
+    query.equalTo("status", "drifting");
+
+    query.find().then((driftingBottles: any[]) => {
+      if (driftingBottles.length === 0) {
+        this.alertHeader = '失败';
+        this.alertMessage = '没捞着…';
+        return;
+      }
+
+      const randomIndex = Math.floor(Math.random() * driftingBottles.length);
+      const bottleToCatch = driftingBottles[randomIndex];
+
+      bottleToCatch.set("status", "catched");
+      bottleToCatch.save().then(() => {
+        this.alertHeader = '成功';
+        this.alertMessage = '捞到啦!';
+      }).catch((err: any) => {
+        console.error('更新漂流瓶状态时出错:', err);
+        this.alertHeader = '错误';
+        this.alertMessage = '发生错误,请重试。';
+      });
+    }).catch((err) => {
+      console.error('获取漂流瓶时出错:', err);
+      this.alertHeader = '错误';
+      this.alertMessage = '发生错误,请重试。';
+    });
+  }
+
+  dismissAlert() {
+    this.alertHeader = '';
+    this.alertMessage = '';
+  }
+
+  goMydriftbottle() {
+    this.router.navigate(['tabs/my-drift-bottle']);
+  }
+}

+ 86 - 0
.history/soul-app/src/app/drift-bottle/drift-bottle.component_20241227170446.ts

@@ -0,0 +1,86 @@
+import { Component, OnInit, OnDestroy } from '@angular/core';
+import { Router } from '@angular/router';
+import { IonicModule } from '@ionic/angular';
+import { openThrowDriftBottleModal } from '../throw-drift-bottle/throw-drift-bottle.component';
+import { ModalController } from '@ionic/angular/standalone';
+import { HttpClient } from '@angular/common/http';
+import { CloudObject, CloudQuery } from 'src/lib/ncloud';
+
+@Component({
+  selector: 'app-drift-bottle',
+  templateUrl: './drift-bottle.component.html',
+  styleUrls: ['./drift-bottle.component.scss'],
+  standalone: true,
+  imports: [
+    IonicModule,
+    // 其他导入项...
+  ]
+})
+export class DriftBottleComponent implements OnInit, OnDestroy {
+  alertHeader: string = '';
+  alertMessage: string = '';
+  private audioElement!: HTMLAudioElement;
+
+  constructor(
+    private router: Router,
+    private modalCtrl: ModalController,
+    private http: HttpClient
+  ) {}
+
+  ngOnInit() {
+    this.audioElement = document.getElementById('backgroundAudio') as HTMLAudioElement;
+    if (this.audioElement) {
+      this.audioElement.play();
+    }
+  }
+
+  ngOnDestroy() {
+    if (this.audioElement) {
+      this.audioElement.pause();
+      this.audioElement.currentTime = 0; // 重置音频时间
+    }
+  }
+
+  throwDriftBottleModal() {
+    openThrowDriftBottleModal(this.modalCtrl);
+  }
+
+  catchDriftBottle() {
+    const query = new CloudQuery("DriftBottle");
+    query.equalTo("status", "drifting");
+
+    query.find().then((driftingBottles: any[]) => {
+      if (driftingBottles.length === 0) {
+        this.alertHeader = '失败';
+        this.alertMessage = '没捞着…';
+        return;
+      }
+
+      const randomIndex = Math.floor(Math.random() * driftingBottles.length);
+      const bottleToCatch = driftingBottles[randomIndex];
+
+      bottleToCatch.set("status", "catched");
+      bottleToCatch.save().then(() => {
+        this.alertHeader = '成功';
+        this.alertMessage = '捞到啦!';
+      }).catch((err: any) => {
+        console.error('更新漂流瓶状态时出错:', err);
+        this.alertHeader = '错误';
+        this.alertMessage = '发生错误,请重试。';
+      });
+    }).catch((err) => {
+      console.error('获取漂流瓶时出错:', err);
+      this.alertHeader = '错误';
+      this.alertMessage = '发生错误,请重试。';
+    });
+  }
+
+  dismissAlert() {
+    this.alertHeader = '';
+    this.alertMessage = '';
+  }
+
+  goMydriftbottle() {
+    this.router.navigate(['tabs/my-drift-bottle']);
+  }
+}

+ 86 - 0
.history/soul-app/src/app/drift-bottle/drift-bottle.component_20241227170657.ts

@@ -0,0 +1,86 @@
+import { Component, OnInit, OnDestroy } from '@angular/core';
+import { Router } from '@angular/router';
+import { IonicModule } from '@ionic/angular';
+import { openThrowDriftBottleModal } from '../throw-drift-bottle/throw-drift-bottle.component';
+import { ModalController } from '@ionic/angular/standalone';
+import { HttpClient } from '@angular/common/http';
+import { CloudObject, CloudQuery } from 'src/lib/ncloud';
+
+@Component({
+  selector: 'app-drift-bottle',
+  templateUrl: './drift-bottle.component.html',
+  styleUrls: ['./drift-bottle.component.scss'],
+  standalone: true,
+  imports: [
+    IonicModule,
+    // 其他导入项...
+  ]
+})
+export class DriftBottleComponent implements OnInit, OnDestroy {
+  alertHeader: string = '';
+  alertMessage: string = '';
+  private audioElement?: HTMLAudioElement; // 将其声明为可选类型
+
+  constructor(
+    private router: Router,
+    private modalCtrl: ModalController,
+    private http: HttpClient
+  ) {}
+
+  ngOnInit() {
+    this.audioElement = document.getElementById('backgroundAudio') as HTMLAudioElement;
+    if (this.audioElement) {
+      this.audioElement.play();
+    }
+  }
+
+  ngOnDestroy() {
+    if (this.audioElement) {
+      this.audioElement.pause();
+      this.audioElement.currentTime = 0; // 重置音频时间
+    }
+  }
+
+  throwDriftBottleModal() {
+    openThrowDriftBottleModal(this.modalCtrl);
+  }
+
+  catchDriftBottle() {
+    const query = new CloudQuery("DriftBottle");
+    query.equalTo("status", "drifting");
+
+    query.find().then((driftingBottles: any[]) => {
+      if (driftingBottles.length === 0) {
+        this.alertHeader = '失败';
+        this.alertMessage = '没捞着…';
+        return;
+      }
+
+      const randomIndex = Math.floor(Math.random() * driftingBottles.length);
+      const bottleToCatch = driftingBottles[randomIndex];
+
+      bottleToCatch.set("status", "catched");
+      bottleToCatch.save().then(() => {
+        this.alertHeader = '成功';
+        this.alertMessage = '捞到啦!';
+      }).catch((err: any) => {
+        console.error('更新漂流瓶状态时出错:', err);
+        this.alertHeader = '错误';
+        this.alertMessage = '发生错误,请重试。';
+      });
+    }).catch((err) => {
+      console.error('获取漂流瓶时出错:', err);
+      this.alertHeader = '错误';
+      this.alertMessage = '发生错误,请重试。';
+    });
+  }
+
+  dismissAlert() {
+    this.alertHeader = '';
+    this.alertMessage = '';
+  }
+
+  goMydriftbottle() {
+    this.router.navigate(['tabs/my-drift-bottle']);
+  }
+}

+ 30 - 0
.history/soul-app/src/app/drift-bottle/drift-bottle.component_20241227171106.html

@@ -0,0 +1,30 @@
+<ion-content [fullscreen]="true">
+  <div class="top-image">
+    <img src="/assets/img/漂流瓶.jpg" alt="漂流瓶">
+  </div>
+  
+  <!-- 左边的按钮 -->
+  <div class="button-container left-button" (click)="throwDriftBottleModal()">
+    <img src="/assets/img/扔一个.png" alt="扔漂流瓶" class="circular-button">
+  </div>
+
+  <div class="button-container middle-button" (click)="goMydriftbottle()">
+    <ion-button fill="clear" class="custom-button" (click)="catchDriftBottle()">
+      我的漂流瓶
+    </ion-button>
+  </div>
+
+  <!-- 右边的按钮 -->
+  <div class="button-container right-button" (click)="catchDriftBottle()">
+    <img src="/assets/img/捞一个.png" alt="捞漂流瓶" class="circular-button">
+  </div>
+
+  <!-- 背景音乐 -->
+  <audio id="backgroundAudio" loop>
+    <source src="/assets/audio/海浪.mp3" type="audio/mpeg">
+    Your browser does not support the audio element.
+  </audio>
+
+  <!-- 弹窗提示 -->
+  <ion-alert *ngIf="alertMessage" [header]="alertHeader" [message]="alertMessage" [buttons]="['OK']" (didDismiss)="dismissAlert()"></ion-alert>
+</ion-content>

+ 86 - 0
.history/soul-app/src/app/drift-bottle/drift-bottle.component_20241227171107.ts

@@ -0,0 +1,86 @@
+import { Component, OnInit, OnDestroy } from '@angular/core';
+import { Router } from '@angular/router';
+import { IonicModule } from '@ionic/angular';
+import { openThrowDriftBottleModal } from '../throw-drift-bottle/throw-drift-bottle.component';
+import { ModalController } from '@ionic/angular/standalone';
+import { HttpClient } from '@angular/common/http';
+import { CloudObject, CloudQuery } from 'src/lib/ncloud';
+
+@Component({
+  selector: 'app-drift-bottle',
+  templateUrl: './drift-bottle.component.html',
+  styleUrls: ['./drift-bottle.component.scss'],
+  standalone: true,
+  imports: [
+    IonicModule,
+    // 其他导入项...
+  ]
+})
+export class DriftBottleComponent implements OnInit, OnDestroy {
+  alertHeader: string = '';
+  alertMessage: string = '';
+  private audioElement?: HTMLAudioElement; // 将其声明为可选类型
+
+  constructor(
+    private router: Router,
+    private modalCtrl: ModalController,
+    private http: HttpClient
+  ) {}
+
+  ngOnInit() {
+    this.audioElement = document.getElementById('backgroundAudio') as HTMLAudioElement;
+    if (this.audioElement) {
+      this.audioElement.play();
+    }
+  }
+
+  ngOnDestroy() {
+    if (this.audioElement) {
+      this.audioElement.pause();
+      this.audioElement.currentTime = 0; // 重置音频时间
+    }
+  }
+
+  throwDriftBottleModal() {
+    openThrowDriftBottleModal(this.modalCtrl);
+  }
+
+  catchDriftBottle() {
+    const query = new CloudQuery("DriftBottle");
+    query.equalTo("status", "drifting");
+
+    query.find().then((driftingBottles: any[]) => {
+      if (driftingBottles.length === 0) {
+        this.alertHeader = '失败';
+        this.alertMessage = '没捞着…';
+        return;
+      }
+
+      const randomIndex = Math.floor(Math.random() * driftingBottles.length);
+      const bottleToCatch = driftingBottles[randomIndex];
+
+      bottleToCatch.set("status", "catched");
+      bottleToCatch.save().then(() => {
+        this.alertHeader = '成功';
+        this.alertMessage = '捞到啦!';
+      }).catch((err: any) => {
+        console.error('更新漂流瓶状态时出错:', err);
+        this.alertHeader = '错误';
+        this.alertMessage = '发生错误,请重试。';
+      });
+    }).catch((err) => {
+      console.error('获取漂流瓶时出错:', err);
+      this.alertHeader = '错误';
+      this.alertMessage = '发生错误,请重试。';
+    });
+  }
+
+  dismissAlert() {
+    this.alertHeader = '';
+    this.alertMessage = '';
+  }
+
+  goMydriftbottle() {
+    this.router.navigate(['tabs/my-drift-bottle']);
+  }
+}

+ 98 - 0
.history/soul-app/src/app/drift-bottle/drift-bottle.component_20241227172236.ts

@@ -0,0 +1,98 @@
+import { Component, OnInit, OnDestroy, Renderer2, ElementRef, ViewChild } from '@angular/core';
+import { Router } from '@angular/router';
+import { IonicModule } from '@ionic/angular';
+import { openThrowDriftBottleModal } from '../throw-drift-bottle/throw-drift-bottle.component';
+import { ModalController } from '@ionic/angular/standalone';
+import { HttpClient } from '@angular/common/http';
+import { CloudObject, CloudQuery } from 'src/lib/ncloud';
+
+@Component({
+  selector: 'app-drift-bottle',
+  templateUrl: './drift-bottle.component.html',
+  styleUrls: ['./drift-bottle.component.scss'],
+  standalone: true,
+  imports: [
+    IonicModule,
+    // 其他导入项...
+  ]
+})
+export class DriftBottleComponent implements OnInit, OnDestroy {
+  alertHeader: string = '';
+  alertMessage: string = '';
+
+  @ViewChild('backgroundAudio', { static: false }) audioElement!: ElementRef<HTMLAudioElement>;
+
+  constructor(
+    private router: Router,
+    private modalCtrl: ModalController,
+    private http: HttpClient,
+    private renderer: Renderer2
+  ) {}
+
+  ngOnInit() {
+    if (this.audioElement && this.audioElement.nativeElement) {
+      const audio = this.audioElement.nativeElement;
+      audio.loop = true;
+      audio.play().catch(error => {
+        console.error('Failed to play audio:', error);
+      });
+    } else {
+      console.warn('Audio element not found');
+    }
+  }
+
+  ngOnDestroy() {
+    if (this.audioElement && this.audioElement.nativeElement) {
+      const audio = this.audioElement.nativeElement;
+      audio.pause();
+      audio.currentTime = 0; // 重置音频时间
+      console.log('Audio element paused and reset');
+    } else {
+      console.warn('Audio element not found during destroy');
+    }
+    console.log('ngOnDestroy called');
+  }
+
+  throwDriftBottleModal() {
+    openThrowDriftBottleModal(this.modalCtrl);
+  }
+
+  catchDriftBottle() {
+    const query = new CloudQuery("DriftBottle");
+    query.equalTo("status", "drifting");
+
+    query.find().then((driftingBottles: any[]) => {
+      if (driftingBottles.length === 0) {
+        this.alertHeader = '失败';
+        this.alertMessage = '没捞着…';
+        return;
+      }
+
+      const randomIndex = Math.floor(Math.random() * driftingBottles.length);
+      const bottleToCatch = driftingBottles[randomIndex];
+
+      bottleToCatch.set("status", "catched");
+      bottleToCatch.save().then(() => {
+        this.alertHeader = '成功';
+        this.alertMessage = '捞到啦!';
+      }).catch((err: any) => {
+        console.error('更新漂流瓶状态时出错:', err);
+        this.alertHeader = '错误';
+        this.alertMessage = '发生错误,请重试。';
+      });
+    }).catch((err) => {
+      console.error('获取漂流瓶时出错:', err);
+      this.alertHeader = '错误';
+      this.alertMessage = '发生错误,请重试。';
+    });
+  }
+
+  dismissAlert() {
+    this.alertHeader = '';
+    this.alertMessage = '';
+  }
+
+  goMydriftbottle() {
+    this.router.navigate(['tabs/my-drift-bottle']);
+  }
+}

+ 86 - 0
.history/soul-app/src/app/drift-bottle/drift-bottle.component_20241227172420.ts

@@ -0,0 +1,86 @@
+import { Component, OnInit, OnDestroy } from '@angular/core';
+import { Router } from '@angular/router';
+import { IonicModule } from '@ionic/angular';
+import { openThrowDriftBottleModal } from '../throw-drift-bottle/throw-drift-bottle.component';
+import { ModalController } from '@ionic/angular/standalone';
+import { HttpClient } from '@angular/common/http';
+import { CloudObject, CloudQuery } from 'src/lib/ncloud';
+
+@Component({
+  selector: 'app-drift-bottle',
+  templateUrl: './drift-bottle.component.html',
+  styleUrls: ['./drift-bottle.component.scss'],
+  standalone: true,
+  imports: [
+    IonicModule,
+    // 其他导入项...
+  ]
+})
+export class DriftBottleComponent implements OnInit, OnDestroy {
+  alertHeader: string = '';
+  alertMessage: string = '';
+  private audioElement?: HTMLAudioElement; // 将其声明为可选类型
+
+  constructor(
+    private router: Router,
+    private modalCtrl: ModalController,
+    private http: HttpClient
+  ) {}
+
+  ngOnInit() {
+    this.audioElement = document.getElementById('backgroundAudio') as HTMLAudioElement;
+    if (this.audioElement) {
+      this.audioElement.play();
+    }
+  }
+
+  ngOnDestroy() {
+    if (this.audioElement) {
+      this.audioElement.pause();
+      this.audioElement.currentTime = 0; // 重置音频时间
+    }
+  }
+
+  throwDriftBottleModal() {
+    openThrowDriftBottleModal(this.modalCtrl);
+  }
+
+  catchDriftBottle() {
+    const query = new CloudQuery("DriftBottle");
+    query.equalTo("status", "drifting");
+
+    query.find().then((driftingBottles: any[]) => {
+      if (driftingBottles.length === 0) {
+        this.alertHeader = '失败';
+        this.alertMessage = '没捞着…';
+        return;
+      }
+
+      const randomIndex = Math.floor(Math.random() * driftingBottles.length);
+      const bottleToCatch = driftingBottles[randomIndex];
+
+      bottleToCatch.set("status", "catched");
+      bottleToCatch.save().then(() => {
+        this.alertHeader = '成功';
+        this.alertMessage = '捞到啦!';
+      }).catch((err: any) => {
+        console.error('更新漂流瓶状态时出错:', err);
+        this.alertHeader = '错误';
+        this.alertMessage = '发生错误,请重试。';
+      });
+    }).catch((err) => {
+      console.error('获取漂流瓶时出错:', err);
+      this.alertHeader = '错误';
+      this.alertMessage = '发生错误,请重试。';
+    });
+  }
+
+  dismissAlert() {
+    this.alertHeader = '';
+    this.alertMessage = '';
+  }
+
+  goMydriftbottle() {
+    this.router.navigate(['tabs/my-drift-bottle']);
+  }
+}

+ 98 - 0
.history/soul-app/src/app/drift-bottle/drift-bottle.component_20241227172433.ts

@@ -0,0 +1,98 @@
+import { Component, OnInit, OnDestroy, Renderer2, ElementRef, ViewChild } from '@angular/core';
+import { Router } from '@angular/router';
+import { IonicModule } from '@ionic/angular';
+import { openThrowDriftBottleModal } from '../throw-drift-bottle/throw-drift-bottle.component';
+import { ModalController } from '@ionic/angular/standalone';
+import { HttpClient } from '@angular/common/http';
+import { CloudObject, CloudQuery } from 'src/lib/ncloud';
+
+@Component({
+  selector: 'app-drift-bottle',
+  templateUrl: './drift-bottle.component.html',
+  styleUrls: ['./drift-bottle.component.scss'],
+  standalone: true,
+  imports: [
+    IonicModule,
+    // 其他导入项...
+  ]
+})
+export class DriftBottleComponent implements OnInit, OnDestroy {
+  alertHeader: string = '';
+  alertMessage: string = '';
+
+  @ViewChild('backgroundAudio', { static: false }) audioElement!: ElementRef<HTMLAudioElement>;
+
+  constructor(
+    private router: Router,
+    private modalCtrl: ModalController,
+    private http: HttpClient,
+    private renderer: Renderer2
+  ) {}
+
+  ngOnInit() {
+    if (this.audioElement && this.audioElement.nativeElement) {
+      const audio = this.audioElement.nativeElement;
+      audio.loop = true;
+      audio.play().catch(error => {
+        console.error('Failed to play audio:', error);
+      });
+    } else {
+      console.warn('Audio element not found');
+    }
+  }
+
+  ngOnDestroy() {
+    if (this.audioElement && this.audioElement.nativeElement) {
+      const audio = this.audioElement.nativeElement;
+      audio.pause();
+      audio.currentTime = 0; // 重置音频时间
+      console.log('Audio element paused and reset');
+    } else {
+      console.warn('Audio element not found during destroy');
+    }
+    console.log('ngOnDestroy called');
+  }
+
+  throwDriftBottleModal() {
+    openThrowDriftBottleModal(this.modalCtrl);
+  }
+
+  catchDriftBottle() {
+    const query = new CloudQuery("DriftBottle");
+    query.equalTo("status", "drifting");
+
+    query.find().then((driftingBottles: any[]) => {
+      if (driftingBottles.length === 0) {
+        this.alertHeader = '失败';
+        this.alertMessage = '没捞着…';
+        return;
+      }
+
+      const randomIndex = Math.floor(Math.random() * driftingBottles.length);
+      const bottleToCatch = driftingBottles[randomIndex];
+
+      bottleToCatch.set("status", "catched");
+      bottleToCatch.save().then(() => {
+        this.alertHeader = '成功';
+        this.alertMessage = '捞到啦!';
+      }).catch((err: any) => {
+        console.error('更新漂流瓶状态时出错:', err);
+        this.alertHeader = '错误';
+        this.alertMessage = '发生错误,请重试。';
+      });
+    }).catch((err) => {
+      console.error('获取漂流瓶时出错:', err);
+      this.alertHeader = '错误';
+      this.alertMessage = '发生错误,请重试。';
+    });
+  }
+
+  dismissAlert() {
+    this.alertHeader = '';
+    this.alertMessage = '';
+  }
+
+  goMydriftbottle() {
+    this.router.navigate(['tabs/my-drift-bottle']);
+  }
+}

+ 86 - 0
.history/soul-app/src/app/drift-bottle/drift-bottle.component_20241227172820.ts

@@ -0,0 +1,86 @@
+import { Component, OnInit, OnDestroy } from '@angular/core';
+import { Router } from '@angular/router';
+import { IonicModule } from '@ionic/angular';
+import { openThrowDriftBottleModal } from '../throw-drift-bottle/throw-drift-bottle.component';
+import { ModalController } from '@ionic/angular/standalone';
+import { HttpClient } from '@angular/common/http';
+import { CloudObject, CloudQuery } from 'src/lib/ncloud';
+
+@Component({
+  selector: 'app-drift-bottle',
+  templateUrl: './drift-bottle.component.html',
+  styleUrls: ['./drift-bottle.component.scss'],
+  standalone: true,
+  imports: [
+    IonicModule,
+    // 其他导入项...
+  ]
+})
+export class DriftBottleComponent implements OnInit, OnDestroy {
+  alertHeader: string = '';
+  alertMessage: string = '';
+  private audioElement?: HTMLAudioElement; // 将其声明为可选类型
+
+  constructor(
+    private router: Router,
+    private modalCtrl: ModalController,
+    private http: HttpClient
+  ) {}
+
+  ngOnInit() {
+    this.audioElement = document.getElementById('backgroundAudio') as HTMLAudioElement;
+    if (this.audioElement) {
+      this.audioElement.play();
+    }
+  }
+
+  ngOnDestroy() {
+    if (this.audioElement) {
+      this.audioElement.pause();
+      this.audioElement.currentTime = 0; // 重置音频时间
+    }
+  }
+
+  throwDriftBottleModal() {
+    openThrowDriftBottleModal(this.modalCtrl);
+  }
+
+  catchDriftBottle() {
+    const query = new CloudQuery("DriftBottle");
+    query.equalTo("status", "drifting");
+
+    query.find().then((driftingBottles: any[]) => {
+      if (driftingBottles.length === 0) {
+        this.alertHeader = '失败';
+        this.alertMessage = '没捞着…';
+        return;
+      }
+
+      const randomIndex = Math.floor(Math.random() * driftingBottles.length);
+      const bottleToCatch = driftingBottles[randomIndex];
+
+      bottleToCatch.set("status", "catched");
+      bottleToCatch.save().then(() => {
+        this.alertHeader = '成功';
+        this.alertMessage = '捞到啦!';
+      }).catch((err: any) => {
+        console.error('更新漂流瓶状态时出错:', err);
+        this.alertHeader = '错误';
+        this.alertMessage = '发生错误,请重试。';
+      });
+    }).catch((err) => {
+      console.error('获取漂流瓶时出错:', err);
+      this.alertHeader = '错误';
+      this.alertMessage = '发生错误,请重试。';
+    });
+  }
+
+  dismissAlert() {
+    this.alertHeader = '';
+    this.alertMessage = '';
+  }
+
+  goMydriftbottle() {
+    this.router.navigate(['tabs/my-drift-bottle']);
+  }
+}

+ 98 - 0
.history/soul-app/src/app/drift-bottle/drift-bottle.component_20241227172923.ts

@@ -0,0 +1,98 @@
+import { Component, OnInit, OnDestroy, Renderer2, ElementRef, ViewChild } from '@angular/core';
+import { Router } from '@angular/router';
+import { IonicModule } from '@ionic/angular';
+import { openThrowDriftBottleModal } from '../throw-drift-bottle/throw-drift-bottle.component';
+import { ModalController } from '@ionic/angular/standalone';
+import { HttpClient } from '@angular/common/http';
+import { CloudObject, CloudQuery } from 'src/lib/ncloud';
+
+@Component({
+  selector: 'app-drift-bottle',
+  templateUrl: './drift-bottle.component.html',
+  styleUrls: ['./drift-bottle.component.scss'],
+  standalone: true,
+  imports: [
+    IonicModule,
+    // 其他导入项...
+  ]
+})
+export class DriftBottleComponent implements OnInit, OnDestroy {
+  alertHeader: string = '';
+  alertMessage: string = '';
+
+  @ViewChild('backgroundAudio', { static: false }) audioElement!: ElementRef<HTMLAudioElement>;
+
+  constructor(
+    private router: Router,
+    private modalCtrl: ModalController,
+    private http: HttpClient,
+    private renderer: Renderer2
+  ) {}
+
+  ngOnInit() {
+    if (this.audioElement && this.audioElement.nativeElement) {
+      const audio = this.audioElement.nativeElement;
+      audio.loop = true;
+      audio.play().catch(error => {
+        console.error('Failed to play audio:', error);
+      });
+    } else {
+      console.warn('Audio element not found');
+    }
+  }
+
+  ngOnDestroy() {
+    if (this.audioElement && this.audioElement.nativeElement) {
+      const audio = this.audioElement.nativeElement;
+      audio.pause();
+      audio.currentTime = 0; // 重置音频时间
+      console.log('Audio element paused and reset');
+    } else {
+      console.warn('Audio element not found during destroy');
+    }
+    console.log('ngOnDestroy called');
+  }
+
+  throwDriftBottleModal() {
+    openThrowDriftBottleModal(this.modalCtrl);
+  }
+
+  catchDriftBottle() {
+    const query = new CloudQuery("DriftBottle");
+    query.equalTo("status", "drifting");
+
+    query.find().then((driftingBottles: any[]) => {
+      if (driftingBottles.length === 0) {
+        this.alertHeader = '失败';
+        this.alertMessage = '没捞着…';
+        return;
+      }
+
+      const randomIndex = Math.floor(Math.random() * driftingBottles.length);
+      const bottleToCatch = driftingBottles[randomIndex];
+
+      bottleToCatch.set("status", "catched");
+      bottleToCatch.save().then(() => {
+        this.alertHeader = '成功';
+        this.alertMessage = '捞到啦!';
+      }).catch((err: any) => {
+        console.error('更新漂流瓶状态时出错:', err);
+        this.alertHeader = '错误';
+        this.alertMessage = '发生错误,请重试。';
+      });
+    }).catch((err) => {
+      console.error('获取漂流瓶时出错:', err);
+      this.alertHeader = '错误';
+      this.alertMessage = '发生错误,请重试。';
+    });
+  }
+
+  dismissAlert() {
+    this.alertHeader = '';
+    this.alertMessage = '';
+  }
+
+  goMydriftbottle() {
+    this.router.navigate(['tabs/my-drift-bottle']);
+  }
+}

+ 30 - 0
.history/soul-app/src/app/drift-bottle/drift-bottle.component_20241227181813.html

@@ -0,0 +1,30 @@
+<ion-content [fullscreen]="true">
+  <div class="top-image">
+    <img src="/assets/img/漂流瓶.jpg" alt="漂流瓶">
+  </div>
+  
+  <!-- 左边的按钮 -->
+  <div class="button-container left-button" (click)="throwDriftBottleModal()">
+    <img src="/assets/img/扔一个.png" alt="扔漂流瓶" class="circular-button">
+  </div>
+
+  <div class="button-container middle-button" (click)="goMydriftbottle()">
+    <ion-button fill="clear" class="custom-button" (click)="catchDriftBottle()">
+      我的漂流瓶
+    </ion-button>
+  </div>
+
+  <!-- 右边的按钮 -->
+  <div class="button-container right-button" (click)="catchDriftBottle()">
+    <img src="/assets/img/捞一个.png" alt="捞漂流瓶" class="circular-button">
+  </div>
+
+  <!-- 背景音乐 -->
+  <audio id="backgroundAudio" loop>
+    <source src="/assets/audio/海浪.mp3" type="audio/mpeg">
+    Your browser does not support the audio element.
+  </audio>
+
+  <!-- 弹窗提示 -->
+  <ion-alert *ngIf="alertMessage" [header]="alertHeader" [message]="alertMessage" [buttons]="['OK']" (didDismiss)="dismissAlert()"></ion-alert>
+</ion-content>

+ 111 - 0
.history/soul-app/src/app/drift-bottle/drift-bottle.component_20241227183207.ts

@@ -0,0 +1,111 @@
+import { Component, OnInit, OnDestroy, Renderer2, ElementRef, ViewChild } from '@angular/core';
+import { Router } from '@angular/router';
+import { IonicModule } from '@ionic/angular';
+import { openThrowDriftBottleModal } from '../throw-drift-bottle/throw-drift-bottle.component';
+import { ModalController } from '@ionic/angular/standalone';
+import { HttpClient } from '@angular/common/http';
+import { CloudObject, CloudQuery } from 'src/lib/ncloud';
+import { UserService } from 'src/app/user.service'; // 假设这是你的用户服务
+
+@Component({
+  selector: 'app-drift-bottle',
+  templateUrl: './drift-bottle.component.html',
+  styleUrls: ['./drift-bottle.component.scss'],
+  standalone: true,
+  imports: [
+    IonicModule,
+    // 其他导入项...
+  ]
+})
+export class DriftBottleComponent implements OnInit, OnDestroy {
+  alertHeader: string = '';
+  alertMessage: string = '';
+
+  @ViewChild('backgroundAudio', { static: false }) audioElement!: ElementRef<HTMLAudioElement>;
+
+  constructor(
+    private router: Router,
+    private modalCtrl: ModalController,
+    private http: HttpClient,
+    private renderer: Renderer2,
+    private userService: UserService // 注入用户服务
+  ) {}
+
+  ngOnInit() {
+    if (this.audioElement && this.audioElement.nativeElement) {
+      const audio = this.audioElement.nativeElement;
+      audio.loop = true;
+      audio.play().catch(error => {
+        console.error('Failed to play audio:', error);
+      });
+    } else {
+      console.warn('Audio element not found');
+    }
+  }
+
+  ngOnDestroy() {
+    if (this.audioElement && this.audioElement.nativeElement) {
+      const audio = this.audioElement.nativeElement;
+      audio.pause();
+      audio.currentTime = 0; // 重置音频时间
+      console.log('Audio element paused and reset');
+    } else {
+      console.warn('Audio element not found during destroy');
+    }
+    console.log('ngOnDestroy called');
+  }
+
+  throwDriftBottleModal() {
+    openThrowDriftBottleModal(this.modalCtrl);
+  }
+
+  catchDriftBottle() {
+    const query = new CloudQuery("DriftBottle");
+    query.equalTo("status", "drifting");
+
+    query.find().then((driftingBottles: any[]) => {
+      if (driftingBottles.length === 0) {
+        this.alertHeader = '失败';
+        this.alertMessage = '没捞到…';
+        return;
+      }
+
+      const randomIndex = Math.floor(Math.random() * driftingBottles.length);
+      const bottleToCatch = driftingBottles[randomIndex];
+
+      const username = this.userService.getUsername(); // 获取当前用户的用户名
+      if (!username) {
+        console.error('用户未登录或未找到用户名');
+        this.alertHeader = '错误';
+        this.alertMessage = '用户未登录,请先登录。';
+        return;
+      }
+
+      bottleToCatch.set("status", "caught");
+      bottleToCatch.set("catcher", username); // 设置打捞者
+      bottleToCatch.set("catchTime", new Date()); // 设置打捞时间
+
+      bottleToCatch.save().then(() => {
+        this.alertHeader = '成功';
+        this.alertMessage = '捞到啦!快去看看吧!';
+      }).catch((err: any) => {
+        console.error('更新漂流瓶状态时出错:', err);
+        this.alertHeader = '错误';
+        this.alertMessage = '发生错误,请重试。';
+      });
+    }).catch((err) => {
+      console.error('获取漂流瓶时出错:', err);
+      this.alertHeader = '错误';
+      this.alertMessage = '发生错误,请重试。';
+    });
+  }
+
+  dismissAlert() {
+    this.alertHeader = '';
+    this.alertMessage = '';
+  }
+
+  goMydriftbottle() {
+    this.router.navigate(['tabs/my-drift-bottle']);
+  }
+}

+ 60 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227154730.ts

@@ -0,0 +1,60 @@
+import { Component, OnInit } from '@angular/core';
+import { ModalController, IonList, IonItem, IonLabel, IonButton, IonIcon, IonContent, IonHeader, IonToolbar, IonTitle, IonBackButton } from '@ionic/angular/standalone';
+import { CloudQuery } from 'src/lib/ncloud';
+import { UserService } from 'src/app/user.service'; // 假设这是你的用户服务
+import { openThrowDriftBottleModal } from 'throw-drift-bottle.component';
+
+@Component({
+  selector: 'app-my-driftbottles',
+  templateUrl: './my-driftbottles.component.html',
+  styleUrls: ['./my-driftbottles.component.scss'],
+  standalone: true,
+  imports: [
+    IonHeader,
+    IonToolbar,
+    IonTitle,
+    IonBackButton,
+    IonContent,
+    IonList,
+    IonItem,
+    IonLabel,
+    IonButton,
+    IonIcon
+  ]
+})
+export class MyDriftBottleComponent implements OnInit {
+  thrownDriftbottles: any[] = [];
+
+  constructor(
+    private modalCtrl: ModalController,
+    private userService: UserService // 注入用户服务
+  ) {}
+
+  ngOnInit() {
+    this.loadThrownDriftbottles();
+  }
+
+  async loadThrownDriftbottles() {
+    const query = new CloudQuery('Driftbottle');
+    query.equalTo('username.objectId', this.userService.getUserId());
+    try {
+      const results = await query.find();
+      this.thrownDriftbottles = results.map(result => ({
+        content: result.get('content'),
+        createdAt: result.createdAt.toISOString().split('T')[0]
+      }));
+    } catch (error) {
+      console.error('加载漂流瓶时出错', error);
+    }
+  }
+
+  async goDriftbottle() {
+    const driftbottle = await openThrowDriftBottleModal(this.modalCtrl);
+    if (driftbottle) {
+      this.thrownDriftbottles.push({
+        content: driftbottle.get('content'),
+        createdAt: driftbottle.createdAt.toISOString().split('T')[0]
+      });
+    }
+  }
+}

+ 27 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227160003.html

@@ -0,0 +1,27 @@
+<ion-header>
+  <ion-toolbar>
+    <ion-back-button defaultHref="/tabs/tab1"></ion-back-button>
+    <ion-title>我的漂流瓶</ion-title>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content>
+  <ion-list>
+    <ion-item>
+      <ion-label>
+        <h2>我扔出的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    <ion-item *ngFor="let bottle of thrownDriftbottles">
+      <ion-label>
+        <h3>{{ bottle.content }}</h3>
+        <p>{{ bottle.createdAt }}</p>
+      </ion-label>
+    </ion-item>
+    <ion-item lines="none">
+      <ion-button expand="block" (click)="goDriftbottle()">
+        投掷漂流瓶
+      </ion-button>
+    </ion-item>
+  </ion-list>
+</ion-content>

+ 62 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227160006.scss

@@ -0,0 +1,62 @@
+/* 设置页面背景色 */
+ion-content {
+    --background: #ffffff; /* 白色背景 */
+  }
+
+  ion-card {
+    margin: 10px; /* 卡片之间的间距 */
+    border-radius: 10px; /* 圆角效果 */
+    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); /* 阴影效果 */
+  }
+  ion-card-title {
+    font-weight:bold;
+  }
+  
+  /* 设置列表项的样式 */
+  ion-item {
+    margin: 5px 0; /* 列表项之间的间距 */
+  }
+  ion-title {
+    font-size: 24px; /* 增大字体大小 */
+    font-weight: bold; /* 加粗 */
+  }
+  /* 设置卡片的样式 */
+  ion-list {
+    margin: 10px; /* 卡片之间的间距 */
+    border-radius: 10px; /* 圆角效果 */
+    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); /* 阴影效果 */
+  }
+  ion-button {
+    font-size: 15px; /* 增大字体大小 */
+    margin-top: 8px; /* 上间距,仅在需要时添加 */
+    text-transform: none; /* 按钮文字不变形 */
+    height: 35px;
+  }
+  
+  /* 设置列表项的样式 */
+  ion-item {
+    margin: 5px 0; /* 列表项之间的间距 */
+  }
+  
+  /* 设置按钮的样式(如果按钮不在顶部方框内) */
+  
+  ion-toolbar {
+  margin: auto;
+  }
+  .title-text{
+  position: absolute;
+  display: flex;
+  left: 105px;
+  margin: auto;
+  top: 10px;
+  color:rgb(69, 166, 180);
+  }
+  ion-item h2 {
+    font-size: 1.2em;
+    margin-bottom: 8px;
+  }
+  
+  ion-item p {
+    color: #666;
+  }
+  

+ 60 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227160009.ts

@@ -0,0 +1,60 @@
+import { Component, OnInit } from '@angular/core';
+import { ModalController, IonList, IonItem, IonLabel, IonButton, IonIcon, IonContent, IonHeader, IonToolbar, IonTitle, IonBackButton } from '@ionic/angular/standalone';
+import { CloudQuery } from 'src/lib/ncloud';
+import { UserService } from 'src/app/user.service'; // 假设这是你的用户服务
+import { openThrowDriftBottleModal } from '../throw-drift-bottle/throw-drift-bottle.component';
+
+@Component({
+  selector: 'app-my-drift-bottle',
+  templateUrl: './my-drift-bottle.component.html',
+  styleUrls: ['./my-drift-bottle.component.scss'],
+  standalone: true,
+  imports: [
+    IonHeader,
+    IonToolbar,
+    IonTitle,
+    IonBackButton,
+    IonContent,
+    IonList,
+    IonItem,
+    IonLabel,
+    IonButton,
+    IonIcon
+  ]
+})
+export class MyDriftBottleComponent implements OnInit {
+  thrownDriftbottles: any[] = [];
+
+  constructor(
+    private modalCtrl: ModalController,
+    private userService: UserService // 注入用户服务
+  ) {}
+
+  ngOnInit() {
+    this.loadThrownDriftbottles();
+  }
+
+  async loadThrownDriftbottles() {
+    const query = new CloudQuery('Driftbottle');
+    query.equalTo('username.objectId', this.userService.getUserId());
+    try {
+      const results = await query.find();
+      this.thrownDriftbottles = results.map(result => ({
+        content: result.get('content'),
+        createdAt: result.createdAt.toISOString().split('T')[0]
+      }));
+    } catch (error) {
+      console.error('加载漂流瓶时出错', error);
+    }
+  }
+
+  async goDriftbottle() {
+    const driftbottle = await openThrowDriftBottleModal(this.modalCtrl);
+    if (driftbottle) {
+      this.thrownDriftbottles.push({
+        content: driftbottle.get('content'),
+        createdAt: driftbottle.createdAt.toISOString().split('T')[0]
+      });
+    }
+  }
+}

+ 55 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227160055.scss

@@ -0,0 +1,55 @@
+/* 设置页面背景色 */
+ion-content {
+    --background: #ffffff; /* 白色背景 */
+  }
+
+  ion-card {
+    margin: 10px; /* 卡片之间的间距 */
+    border-radius: 10px; /* 圆角效果 */
+    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); /* 阴影效果 */
+  }
+  ion-card-title {
+    font-weight:bold;
+  }
+  
+  /* 设置列表项的样式 */
+  ion-item {
+    margin: 5px 0; /* 列表项之间的间距 */
+  }
+  ion-title {
+    font-size: 24px; /* 增大字体大小 */
+    font-weight: bold; /* 加粗 */
+  }
+  /* 设置卡片的样式 */
+  ion-list {
+    margin: 10px; /* 卡片之间的间距 */
+    border-radius: 10px; /* 圆角效果 */
+    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); /* 阴影效果 */
+  }
+  ion-button {
+    font-size: 15px; /* 增大字体大小 */
+    margin-top: 8px; /* 上间距,仅在需要时添加 */
+    text-transform: none; /* 按钮文字不变形 */
+    height: 35px;
+  }
+  
+  /* 设置列表项的样式 */
+  ion-item {
+    margin: 5px 0; /* 列表项之间的间距 */
+  }
+  
+  /* 设置按钮的样式(如果按钮不在顶部方框内) */
+  
+  ion-toolbar {
+  margin: auto;
+  }
+  .title-text{
+  position: absolute;
+  display: flex;
+  left: 105px;
+  margin: auto;
+  top: 10px;
+  color:rgb(69, 166, 180);
+  }
+
+  

+ 35 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227160257.html

@@ -0,0 +1,35 @@
+<ion-header>
+  <ion-toolbar>
+    <div class="toolbar-content">
+      <div class="button-container">
+        <ion-button (click)="goDriftbottle()" fill="clear">
+          <ion-icon name="chevron-back" slot="start"></ion-icon>返回
+        </ion-button>
+      </div>
+      <ion-title class="title-text">
+        我的漂流瓶
+      </ion-title>
+    </div>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content>
+  <ion-list>
+    <ion-item>
+      <ion-label>
+        <h2>我扔出的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    <ion-item *ngFor="let bottle of thrownDriftbottles">
+      <ion-label>
+        <h3>{{ bottle.content }}</h3>
+        <p>{{ bottle.createdAt }}</p>
+      </ion-label>
+    </ion-item>
+    <ion-item lines="none">
+      <ion-button expand="block" (click)="goDriftbottle()">
+        投掷漂流瓶
+      </ion-button>
+    </ion-item>
+  </ion-list>
+</ion-content>

+ 27 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227160530.ts

@@ -0,0 +1,27 @@
+import { Component, OnInit } from '@angular/core';
+import { IonHeader,IonButton, IonContent, IonIcon, IonItem, IonLabel, IonList, 
+  IonListHeader,IonCardHeader,IonCardTitle,IonCardContent, IonTitle,IonCard, IonToolbar,IonInput,IonSearchbar } from '@ionic/angular/standalone';
+  import { Router } from '@angular/router';
+ 
+
+@Component({
+  selector: 'app-my-drift-bottle',
+  templateUrl: './my-drift-bottle.component.html',
+  styleUrls: ['./my-drift-bottle.component.scss'],
+  standalone: true,
+  imports: [IonHeader,IonToolbar,IonTitle,IonContent,
+        IonList,IonListHeader,IonItem,IonCardTitle,
+        IonLabel,IonIcon,IonButton,IonCardContent,
+        IonInput,IonSearchbar,IonCard,IonCardHeader,
+        
+      ]
+})
+export class MyDriftBottleComponent  implements OnInit {
+
+  constructor(private router: Router) { }
+  goDriftbottle(){
+    this.router.navigate(['tabs/drift-bottle'])
+  }
+  ngOnInit() {}
+
+}

+ 35 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227160651.html

@@ -0,0 +1,35 @@
+<ion-header>
+  <ion-toolbar>
+    <div class="toolbar-content">
+      <div class="button-container">
+        <ion-button (click)="goDriftbottle()" fill="clear">
+          <ion-icon name="chevron-back" slot="start"></ion-icon>返回
+        </ion-button>
+      </div>
+      <ion-title class="title-text">
+        我的漂流瓶
+      </ion-title>
+    </div>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content>
+  <ion-list>
+    <ion-item>
+      <ion-label>
+        <h2>我扔出的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    <ion-item *ngFor="let bottle of thrownDriftbottles">
+      <ion-label>
+        <h3>{{ driftbottle.content }}</h3>
+        <p>{{ driftbottle.createdAt }}</p>
+      </ion-label>
+    </ion-item>
+    <ion-item lines="none">
+      <ion-button expand="block" (click)="goDriftbottle()">
+        投掷漂流瓶
+      </ion-button>
+    </ion-item>
+  </ion-list>
+</ion-content>

+ 35 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227160710.html

@@ -0,0 +1,35 @@
+<ion-header>
+  <ion-toolbar>
+    <div class="toolbar-content">
+      <div class="button-container">
+        <ion-button (click)="goDriftbottle()" fill="clear">
+          <ion-icon name="chevron-back" slot="start"></ion-icon>返回
+        </ion-button>
+      </div>
+      <ion-title class="title-text">
+        我的漂流瓶
+      </ion-title>
+    </div>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content>
+  <ion-list>
+    <ion-item>
+      <ion-label>
+        <h2>我扔出的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    <ion-item *ngFor="let bottle of thrownDriftbottles">
+      <ion-label>
+        <h3>{{ bottle.content }}</h3>
+        <p>{{ bottle.createdAt }}</p>
+      </ion-label>
+    </ion-item>
+    <ion-item lines="none">
+      <ion-button expand="block" (click)="goDriftbottle()">
+        投掷漂流瓶
+      </ion-button>
+    </ion-item>
+  </ion-list>
+</ion-content>

+ 35 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227160812.html

@@ -0,0 +1,35 @@
+<ion-header>
+  <ion-toolbar>
+    <div class="toolbar-content">
+      <div class="button-container">
+        <ion-button (click)="goDriftbottle()" fill="clear">
+          <ion-icon name="chevron-back" slot="start"></ion-icon>返回
+        </ion-button>
+      </div>
+      <ion-title class="title-text">
+        我的漂流瓶
+      </ion-title>
+    </div>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content>
+  <ion-list>
+    <ion-item>
+      <ion-label>
+        <h2>我扔出的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    <ion-item *ngFor="let bottle of thrownDriftbottles">
+      <ion-label>
+        <h3>{{ bottle.content }}</h3>
+        <p>{{ bottle.createdAt }}</p>
+      </ion-label>
+    </ion-item>
+    <ion-item>
+      <ion-label>
+        <h2>我捞上的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+  </ion-list>
+</ion-content>

+ 30 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227160833.html

@@ -0,0 +1,30 @@
+<ion-header>
+  <ion-toolbar>
+    <div class="toolbar-content">
+      <div class="button-container">
+        <ion-button (click)="goDriftbottle()" fill="clear">
+          <ion-icon name="chevron-back" slot="start"></ion-icon>返回
+        </ion-button>
+      </div>
+      <ion-title class="title-text">
+        我的漂流瓶
+      </ion-title>
+    </div>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content>
+  <ion-list>
+    <ion-item>
+      <ion-label>
+        <h2>我扔出的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <ion-item>
+      <ion-label>
+        <h2>我捞上的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+  </ion-list>
+</ion-content>

+ 48 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227161556.html

@@ -0,0 +1,48 @@
+<ion-header>
+  <ion-toolbar>
+    <div class="toolbar-content">
+      <div class="button-container">
+        <ion-button (click)="goDriftbottle()" fill="clear">
+          <ion-icon name="chevron-back" slot="start"></ion-icon>返回
+        </ion-button>
+      </div>
+      <ion-title class="title-text">
+        我的漂流瓶
+      </ion-title>
+    </div>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content>
+  <ion-list>
+    <ion-item>
+      <ion-label>
+        <h2>我扔出的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <ion-card *ngFor="let bottle of thrownDriftbottles">
+      <ion-card-header>
+        <ion-card-title>{{ bottle.content }}</ion-card-title>
+      </ion-card-header>
+      <ion-card-content>
+        <p>{{ bottle.createdAt }}</p>
+      </ion-card-content>
+    </ion-card>
+
+    <ion-item>
+      <ion-label>
+        <h2>我捞上的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <ion-card *ngFor="let bottle of caughtDriftbottles">
+      <ion-card-header>
+        <ion-card-title>{{ bottle.content }}</ion-card-title>
+      </ion-card-header>
+      <ion-card-content>
+        <p>{{ bottle.createdAt }}</p>
+      </ion-card-content>
+    </ion-card>
+  </ion-list>
+</ion-content>

+ 61 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227161558.ts

@@ -0,0 +1,61 @@
+import { Component, OnInit } from '@angular/core';
+import { Router } from '@angular/router';
+import { IonHeader, IonButton, IonContent, IonIcon, IonItem, IonLabel, IonList, 
+  IonListHeader, IonCardHeader, IonCardTitle, IonCardContent, IonTitle, IonCard, IonToolbar, IonInput, IonSearchbar } from '@ionic/angular/standalone';
+import { CloudQuery } from 'src/lib/ncloud';
+import { UserService } from 'src/app/user.service'; // 假设这是你的用户服务
+
+@Component({
+  selector: 'app-my-drift-bottle',
+  templateUrl: './my-drift-bottle.component.html',
+  styleUrls: ['./my-drift-bottle.component.scss'],
+  standalone: true,
+  imports: [IonHeader, IonToolbar, IonTitle, IonContent,
+            IonList, IonListHeader, IonItem, IonCardTitle,
+            IonLabel, IonIcon, IonButton, IonCardContent,
+            IonInput, IonSearchbar, IonCard, IonCardHeader,
+          ]
+})
+export class MyDriftBottleComponent implements OnInit {
+  thrownDriftbottles: any[] = [];
+  caughtDriftbottles: any[] = [];
+
+  constructor(private router: Router, private userService: UserService) {}
+
+  async ngOnInit() {
+    await this.loadThrownDriftbottles();
+    await this.loadCaughtDriftbottles();
+  }
+
+  async loadThrownDriftbottles() {
+    const query = new CloudQuery('Driftbottle');
+    query.equalTo('username', this.userService.getUsername());
+    try {
+      const results = await query.find();
+      this.thrownDriftbottles = results.map(result => ({
+        content: result.get('content'),
+        createdAt: result.createdAt.toISOString().split('T')[0]
+      }));
+    } catch (error) {
+      console.error('加载扔出的漂流瓶时出错', error);
+    }
+  }
+
+  async loadCaughtDriftbottles() {
+    const query = new CloudQuery('Driftbottle');
+    
+    try {
+      const results = await query.find();
+      this.caughtDriftbottles = results.map(result => ({
+        content: result.get('content'),
+        createdAt: result.createdAt.toISOString().split('T')[0]
+      }));
+    } catch (error) {
+      console.error('加载捞上的漂流瓶时出错', error);
+    }
+  }
+
+  goDriftbottle() {
+    this.router.navigate(['tabs/drift-bottle']);
+  }
+}

+ 61 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227161652.ts

@@ -0,0 +1,61 @@
+import { Component, OnInit } from '@angular/core';
+import { Router } from '@angular/router';
+import { IonHeader, IonButton, IonContent, IonIcon, IonItem, IonLabel, IonList, 
+  IonListHeader, IonCardHeader, IonCardTitle, IonCardContent, IonTitle, IonCard, IonToolbar, IonInput, IonSearchbar } from '@ionic/angular/standalone';
+import { CloudQuery } from 'src/lib/ncloud';
+import { UserService } from 'src/app/user.service'; // 假设这是你的用户服务
+
+@Component({
+  selector: 'app-my-drift-bottle',
+  templateUrl: './my-drift-bottle.component.html',
+  styleUrls: ['./my-drift-bottle.component.scss'],
+  standalone: true,
+  imports: [IonHeader, IonToolbar, IonTitle, IonContent,
+            IonList, IonListHeader, IonItem, IonCardTitle,
+            IonLabel, IonIcon, IonButton, IonCardContent,
+            IonInput, IonSearchbar, IonCard, IonCardHeader,
+          ]
+})
+export class MyDriftBottleComponent implements OnInit {
+  thrownDriftbottles: any[] = [];
+  caughtDriftbottles: any[] = [];
+
+  constructor(private router: Router, private userService: UserService) {}
+
+  async ngOnInit() {
+    await this.loadThrownDriftbottles();
+    // await this.loadCaughtDriftbottles();
+  }
+
+  async loadThrownDriftbottles() {
+    const query = new CloudQuery('Driftbottle');
+    query.equalTo('username', this.userService.getUsername());
+    try {
+      const results = await query.find();
+      this.thrownDriftbottles = results.map(result => ({
+        content: result.get('content'),
+        createdAt: result.createdAt.toISOString().split('T')[0]
+      }));
+    } catch (error) {
+      console.error('加载扔出的漂流瓶时出错', error);
+    }
+  }
+
+  // async loadCaughtDriftbottles() {
+  //   const query = new CloudQuery('Driftbottle');
+    
+  //   try {
+  //     const results = await query.find();
+  //     this.caughtDriftbottles = results.map(result => ({
+  //       content: result.get('content'),
+  //       createdAt: result.createdAt.toISOString().split('T')[0]
+  //     }));
+  //   } catch (error) {
+  //     console.error('加载捞上的漂流瓶时出错', error);
+  //   }
+  // }
+
+  goDriftbottle() {
+    this.router.navigate(['tabs/drift-bottle']);
+  }
+}

+ 48 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227161744.html

@@ -0,0 +1,48 @@
+<ion-header>
+  <ion-toolbar>
+    <div class="toolbar-content">
+      <div class="button-container">
+        <ion-button (click)="goDriftbottle()" fill="clear">
+          <ion-icon name="chevron-back" slot="start"></ion-icon>返回
+        </ion-button>
+      </div>
+      <ion-title class="title-text">
+        我的漂流瓶
+      </ion-title>
+    </div>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content>
+  <ion-list>
+    <ion-item>
+      <ion-label>
+        <h2>我扔出的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <ion-card *ngFor="let bottle of thrownDriftbottles">
+      <ion-card-header>
+        <ion-card-title>{{ driftbottle.content }}</ion-card-title>
+      </ion-card-header>
+      <ion-card-content>
+        <p>{{ driftbottle.createdAt }}</p>
+      </ion-card-content>
+    </ion-card>
+
+    <ion-item>
+      <ion-label>
+        <h2>我捞上的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <ion-card *ngFor="let bottle of caughtDriftbottles">
+      <ion-card-header>
+        <ion-card-title>{{ bottle.content }}</ion-card-title>
+      </ion-card-header>
+      <ion-card-content>
+        <p>{{ bottle.createdAt }}</p>
+      </ion-card-content>
+    </ion-card>
+  </ion-list>
+</ion-content>

+ 48 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227161754.html

@@ -0,0 +1,48 @@
+<ion-header>
+  <ion-toolbar>
+    <div class="toolbar-content">
+      <div class="button-container">
+        <ion-button (click)="goDriftbottle()" fill="clear">
+          <ion-icon name="chevron-back" slot="start"></ion-icon>返回
+        </ion-button>
+      </div>
+      <ion-title class="title-text">
+        我的漂流瓶
+      </ion-title>
+    </div>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content>
+  <ion-list>
+    <ion-item>
+      <ion-label>
+        <h2>我扔出的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <ion-card *ngFor="let bottle of thrownDriftbottles">
+      <ion-card-header>
+        <ion-card-title>{{ bottle.content }}</ion-card-title>
+      </ion-card-header>
+      <ion-card-content>
+        <p>{{ bottle.createdAt }}</p>
+      </ion-card-content>
+    </ion-card>
+
+    <ion-item>
+      <ion-label>
+        <h2>我捞上的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <ion-card *ngFor="let bottle of caughtDriftbottles">
+      <ion-card-header>
+        <ion-card-title>{{ bottle.content }}</ion-card-title>
+      </ion-card-header>
+      <ion-card-content>
+        <p>{{ bottle.createdAt }}</p>
+      </ion-card-content>
+    </ion-card>
+  </ion-list>
+</ion-content>

+ 46 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227162646.html

@@ -0,0 +1,46 @@
+<ion-header>
+  <ion-toolbar>
+    <div class="toolbar-content">
+      <div class="button-container">
+        <ion-button (click)="goDriftbottle()" fill="clear">
+          <ion-icon name="chevron-back" slot="start"></ion-icon>返回
+        </ion-button>
+      </div>
+      <ion-title class="title-text">
+        我的漂流瓶
+      </ion-title>
+    </div>
+  </ion-toolbar>
+</ion-header>
+
+<!-- <ion-content [fullscreen]="true">
+  <section *ngIf="thrownDriftbottles.length > 0">
+    <h2 style="margin-left: 16px;">我扔出的漂流瓶</h2>
+    <ion-card *ngFor="let bottle of thrownDriftbottles">
+      <ion-card-header>
+        <ion-card-title>{{ bottle.content }}</ion-card-title>
+      </ion-card-header>
+      <ion-card-content>
+        <p>创建时间: {{ bottle.createdAt }}</p>
+      </ion-card-content>
+    </ion-card>
+  </section> -->
+
+  <section *ngIf="caughtDriftbottles.length > 0">
+    <h2 style="margin-left: 16px;">我捞上的漂流瓶</h2>
+    <ion-card *ngFor="let bottle of caughtDriftbottles">
+      <ion-card-header>
+        <ion-card-title>{{ bottle.content }}</ion-card-title>
+      </ion-card-header>
+      <ion-card-content>
+        <p>扔出时间: {{ bottle.createdAt }}</p>
+      </ion-card-content>
+    </ion-card>
+  </section>
+
+  <div style="display: flex; justify-content: center; margin-top: auto;">
+    <ion-button (click)="throwNewDriftbottle()" expand="full">
+      投掷新的漂流瓶
+    </ion-button>
+  </div>
+</ion-content>

+ 70 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227162658.ts

@@ -0,0 +1,70 @@
+import { Component, OnInit } from '@angular/core';
+import { Router } from '@angular/router';
+import { CommonModule } from '@angular/common'; // 导入 CommonModule
+
+import { IonHeader, IonButton, IonContent, IonIcon, IonItem, IonLabel, IonList, 
+  IonListHeader, IonCardHeader, IonCardTitle, IonCardContent, IonTitle, IonCard, IonToolbar, IonInput, IonSearchbar } from '@ionic/angular/standalone';
+import { CloudQuery, CloudUser } from 'src/lib/ncloud';
+import { UserService } from 'src/app/user.service'; // 假设这是你的用户服务
+
+@Component({
+  selector: 'app-my-drift-bottle',
+  templateUrl: './my-drift-bottle.component.html',
+  styleUrls: ['./my-drift-bottle.component.scss'],
+  standalone: true,
+  imports: [
+    CommonModule, // 添加 CommonModule
+    
+    IonHeader, IonToolbar, IonTitle, IonContent,
+    IonList, IonListHeader, IonItem, IonCardTitle,
+    IonLabel, IonIcon, IonButton, IonCardContent,
+    IonInput, IonSearchbar, IonCard, IonCardHeader,
+  ]
+})
+export class MyDriftBottleComponent implements OnInit {
+  thrownDriftbottles: any[] = [];
+  caughtDriftbottles: any[] = [];
+
+  constructor(private router: Router, private userService: UserService) {}
+
+  async ngOnInit() {
+    await this.loadThrownDriftbottles();
+    await this.loadCaughtDriftbottles();
+  }
+
+  async loadThrownDriftbottles() {
+    const query = new CloudQuery('Driftbottle');
+    query.equalTo('username', this.userService.getUsername());
+    try {
+      const results = await query.find();
+      this.thrownDriftbottles = results.map(result => ({
+        content: result.get('content'),
+        createdAt: result.createdAt.toISOString().split('T')[0]
+      }));
+    } catch (error) {
+      console.error('加载扔出的漂流瓶时出错', error);
+    }
+  }
+
+  async loadCaughtDriftbottles() {
+    const query = new CloudQuery('Driftbottle');
+    query.equalTo('username', this.userService.getUsername()); // 假设捞上的漂流瓶不是自己的
+    try {
+      const results = await query.find();
+      this.caughtDriftbottles = results.map(result => ({
+        content: result.get('content'),
+        createdAt: result.createdAt.toISOString().split('T')[0]
+      }));
+    } catch (error) {
+      console.error('加载捞上的漂流瓶时出错', error);
+    }
+  }
+
+  goDriftbottle() {
+    this.router.navigate(['tabs/drift-bottle']);
+  }
+
+  throwNewDriftbottle() {
+    this.router.navigate(['tabs/throw-drift-bottle']); // 假设这是投掷新漂流瓶的路由
+  }
+}

+ 46 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227162832.html

@@ -0,0 +1,46 @@
+<ion-header>
+  <ion-toolbar>
+    <div class="toolbar-content">
+      <div class="button-container">
+        <ion-button (click)="goDriftbottle()" fill="clear">
+          <ion-icon name="chevron-back" slot="start"></ion-icon>返回
+        </ion-button>
+      </div>
+      <ion-title class="title-text">
+        我的漂流瓶
+      </ion-title>
+    </div>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content [fullscreen]="true">
+  <!-- <section *ngIf="thrownDriftbottles.length > 0">
+    <h2 style="margin-left: 16px;">我扔出的漂流瓶</h2>
+    <ion-card *ngFor="let bottle of thrownDriftbottles">
+      <ion-card-header>
+        <ion-card-title>{{ bottle.content }}</ion-card-title>
+      </ion-card-header>
+      <ion-card-content>
+        <p>创建时间: {{ bottle.createdAt }}</p>
+      </ion-card-content>
+    </ion-card>
+  </section> -->
+
+  <section *ngIf="caughtDriftbottles.length > 0">
+    <h2 style="margin-left: 16px;">我捞上的漂流瓶</h2>
+    <ion-card *ngFor="let bottle of caughtDriftbottles">
+      <ion-card-header>
+        <ion-card-title>{{ bottle.content }}</ion-card-title>
+      </ion-card-header>
+      <ion-card-content>
+        <p>扔出时间: {{ bottle.createdAt }}</p>
+      </ion-card-content>
+    </ion-card>
+  </section>
+
+  <div style="display: flex; justify-content: center; margin-top: auto;">
+    <ion-button (click)="throwNewDriftbottle()" expand="full">
+      投掷新的漂流瓶
+    </ion-button>
+  </div>
+</ion-content>

+ 70 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227162837.ts

@@ -0,0 +1,70 @@
+import { Component, OnInit } from '@angular/core';
+import { Router } from '@angular/router';
+import { CommonModule } from '@angular/common'; // 导入 CommonModule
+
+import { IonHeader, IonButton, IonContent, IonIcon, IonItem, IonLabel, IonList, 
+  IonListHeader, IonCardHeader, IonCardTitle, IonCardContent, IonTitle, IonCard, IonToolbar, IonInput, IonSearchbar } from '@ionic/angular/standalone';
+import { CloudQuery, CloudUser } from 'src/lib/ncloud';
+import { UserService } from 'src/app/user.service'; // 假设这是你的用户服务
+
+@Component({
+  selector: 'app-my-drift-bottle',
+  templateUrl: './my-drift-bottle.component.html',
+  styleUrls: ['./my-drift-bottle.component.scss'],
+  standalone: true,
+  imports: [
+    CommonModule, // 添加 CommonModule
+    
+    IonHeader, IonToolbar, IonTitle, IonContent,
+    IonList, IonListHeader, IonItem, IonCardTitle,
+    IonLabel, IonIcon, IonButton, IonCardContent,
+    IonInput, IonSearchbar, IonCard, IonCardHeader,
+  ]
+})
+export class MyDriftBottleComponent implements OnInit {
+  thrownDriftbottles: any[] = [];
+  caughtDriftbottles: any[] = [];
+
+  constructor(private router: Router, private userService: UserService) {}
+
+  async ngOnInit() {
+    await this.loadThrownDriftbottles();
+    await this.loadCaughtDriftbottles();
+  }
+
+  async loadThrownDriftbottles() {
+    const query = new CloudQuery('Driftbottle');
+    query.equalTo('username', this.userService.getUsername());
+    try {
+      const results = await query.find();
+      this.thrownDriftbottles = results.map(result => ({
+        content: result.get('content'),
+        createdAt: result.createdAt.toISOString().split('T')[0]
+      }));
+    } catch (error) {
+      console.error('加载扔出的漂流瓶时出错', error);
+    }
+  }
+
+  async loadCaughtDriftbottles() {
+    const query = new CloudQuery('Driftbottle');
+    query.equalTo('username', this.userService.getUsername()); // 假设捞上的漂流瓶不是自己的
+    try {
+      const results = await query.find();
+      this.caughtDriftbottles = results.map(result => ({
+        content: result.get('content'),
+        createdAt: result.createdAt.toISOString().split('T')[0]
+      }));
+    } catch (error) {
+      console.error('加载捞上的漂流瓶时出错', error);
+    }
+  }
+
+  goDriftbottle() {
+    this.router.navigate(['tabs/drift-bottle']);
+  }
+
+  throwNewDriftbottle() {
+    this.router.navigate(['tabs/throw-drift-bottle']); // 假设这是投掷新漂流瓶的路由
+  }
+}

+ 42 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227162925.html

@@ -0,0 +1,42 @@
+<ion-header>
+  <ion-toolbar>
+    <div class="toolbar-content">
+      <div class="button-container">
+        <ion-button (click)="goDriftbottle()" fill="clear">
+          <ion-icon name="chevron-back" slot="start"></ion-icon>返回
+        </ion-button>
+      </div>
+      <ion-title class="title-text">
+        我的漂流瓶
+      </ion-title>
+    </div>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content [fullscreen]="true">
+  <!-- <section *ngIf="thrownDriftbottles.length > 0">
+    <h2 style="margin-left: 16px;">我扔出的漂流瓶</h2>
+    <ion-card *ngFor="let bottle of thrownDriftbottles">
+      <ion-card-header>
+        <ion-card-title>{{ bottle.content }}</ion-card-title>
+      </ion-card-header>
+      <ion-card-content>
+        <p>创建时间: {{ bottle.createdAt }}</p>
+      </ion-card-content>
+    </ion-card>
+  </section> -->
+
+  <section *ngIf="caughtDriftbottles.length > 0">
+    <h2 style="margin-left: 16px;">我捞上的漂流瓶</h2>
+    <ion-card *ngFor="let bottle of caughtDriftbottles">
+      <ion-card-header>
+        <ion-card-title>{{ bottle.content }}</ion-card-title>
+      </ion-card-header>
+      <ion-card-content>
+        <p>扔出时间: {{ bottle.createdAt }}</p>
+      </ion-card-content>
+    </ion-card>
+  </section>
+
+ 
+</ion-content>

+ 42 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227163048.html

@@ -0,0 +1,42 @@
+<ion-header>
+  <ion-toolbar>
+    <div class="toolbar-content">
+      <div class="button-container">
+        <ion-button (click)="goDriftbottle()" fill="clear">
+          <ion-icon name="chevron-back" slot="start"></ion-icon>返回
+        </ion-button>
+      </div>
+      <ion-title class="title-text">
+        我的漂流瓶
+      </ion-title>
+    </div>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content [fullscreen]="true">
+  <section *ngIf="thrownDriftbottles.length > 0">
+    <h2 style="margin-left: 16px;">我扔出的漂流瓶</h2>
+    <ion-card *ngFor="let bottle of thrownDriftbottles">
+      <ion-card-header>
+        <ion-card-title>{{ bottle.content }}</ion-card-title>
+      </ion-card-header>
+      <ion-card-content>
+        <p>创建时间: {{ bottle.createdAt }}</p>
+      </ion-card-content>
+    </ion-card>
+  </section>
+
+  <section *ngIf="caughtDriftbottles.length > 0">
+    <h2 style="margin-left: 16px;">我捞上的漂流瓶</h2>
+    <ion-card *ngFor="let bottle of caughtDriftbottles">
+      <ion-card-header>
+        <ion-card-title>{{ bottle.content }}</ion-card-title>
+      </ion-card-header>
+      <ion-card-content>
+        <p>扔出时间: {{ bottle.createdAt }}</p>
+      </ion-card-content>
+    </ion-card>
+  </section>
+
+ 
+</ion-content>

+ 42 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227163404.html

@@ -0,0 +1,42 @@
+<ion-header>
+  <ion-toolbar>
+    <div class="toolbar-content">
+      <div class="button-container">
+        <ion-button (click)="goDriftbottle()" fill="clear">
+          <ion-icon name="chevron-back" slot="start"></ion-icon>返回
+        </ion-button>
+      </div>
+      <ion-title class="title-text">
+        我的漂流瓶
+      </ion-title>
+    </div>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content [fullscreen]="true">
+  <!-- <section *ngIf="thrownDriftbottles.length > 0">
+    <h2 style="margin-left: 16px;">我扔出的漂流瓶</h2>
+    <ion-card *ngFor="let bottle of thrownDriftbottles">
+      <ion-card-header>
+        <ion-card-title>{{ bottle.content }}</ion-card-title>
+      </ion-card-header>
+      <ion-card-content>
+        <p>创建时间: {{ bottle.createdAt }}</p>
+      </ion-card-content>
+    </ion-card>
+  </section> -->
+
+  <section *ngIf="caughtDriftbottles.length > 0">
+    <h2 style="margin-left: 16px;">我捞上的漂流瓶</h2>
+    <ion-card *ngFor="let bottle of caughtDriftbottles">
+      <ion-card-header>
+        <ion-card-title>{{ bottle.content }}</ion-card-title>
+      </ion-card-header>
+      <ion-card-content>
+        <p>扔出时间: {{ bottle.createdAt }}</p>
+      </ion-card-content>
+    </ion-card>
+  </section>
+
+ 
+</ion-content>

+ 51 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227163546.html

@@ -0,0 +1,51 @@
+<ion-header>
+  <ion-toolbar>
+    <div class="toolbar-content">
+      <div class="button-container">
+        <ion-button (click)="goDriftbottle()" fill="clear">
+          <ion-icon name="chevron-back" slot="start"></ion-icon>返回
+        </ion-button>
+      </div>
+      <ion-title class="title-text">
+        我的漂流瓶
+      </ion-title>
+    </div>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content>
+  <ion-list>
+    <ion-item>
+      <ion-label>
+        <h2>我扔出的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <section *ngIf="thrownDriftbottles.length > 0">
+      
+      <ion-card *ngFor="let bottle of thrownDriftbottles">
+        <ion-card-header>
+          <ion-card-title>{{ bottle.content }}</ion-card-title>
+        </ion-card-header>
+        <ion-card-content>
+          <p>创建时间: {{ bottle.createdAt }}</p>
+        </ion-card-content>
+      </ion-card>
+    </section>
+
+    <!-- <ion-item>
+      <ion-label>
+        <h2>我捞上的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <ion-card *ngFor="let bottle of caughtDriftbottles">
+      <ion-card-header>
+        <ion-card-title>{{ bottle.content }}</ion-card-title>
+      </ion-card-header>
+      <ion-card-content>
+        <p>{{ bottle.createdAt }}</p>
+      </ion-card-content>
+    </ion-card>
+  </ion-list>
+</ion-content> -->

+ 51 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227163701.html

@@ -0,0 +1,51 @@
+<ion-header>
+  <ion-toolbar>
+    <div class="toolbar-content">
+      <div class="button-container">
+        <ion-button (click)="goDriftbottle()" fill="clear">
+          <ion-icon name="chevron-back" slot="start"></ion-icon>返回
+        </ion-button>
+      </div>
+      <ion-title class="title-text">
+        我的漂流瓶
+      </ion-title>
+    </div>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content>
+  <ion-list>
+    <ion-item>
+      <ion-label>
+        <h2>我扔出的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <section *ngIf="thrownDriftbottles.length > 0">
+      
+      <ion-card *ngFor="let bottle of thrownDriftbottles">
+        <ion-card-header>
+          <ion-card-title>{{ driftbottle.get('content) }}</ion-card-title>
+        </ion-card-header>
+        <ion-card-content>
+          <p>扔出时间: {{ driftbottle.get('createdAt') }}</p>
+        </ion-card-content>
+      </ion-card>
+    </section>
+
+    <!-- <ion-item>
+      <ion-label>
+        <h2>我捞上的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <ion-card *ngFor="let bottle of caughtDriftbottles">
+      <ion-card-header>
+        <ion-card-title>{{ bottle.content }}</ion-card-title>
+      </ion-card-header>
+      <ion-card-content>
+        <p>{{ bottle.createdAt }}</p>
+      </ion-card-content>
+    </ion-card>
+  </ion-list>
+</ion-content> -->

+ 51 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227164048.html

@@ -0,0 +1,51 @@
+<ion-header>
+  <ion-toolbar>
+    <div class="toolbar-content">
+      <div class="button-container">
+        <ion-button (click)="goDriftbottle()" fill="clear">
+          <ion-icon name="chevron-back" slot="start"></ion-icon>返回
+        </ion-button>
+      </div>
+      <ion-title class="title-text">
+        我的漂流瓶
+      </ion-title>
+    </div>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content>
+  <ion-list>
+    <ion-item>
+      <ion-label>
+        <h2>我扔出的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <section *ngIf="thrownDriftbottles.length > 0">
+      
+      <ion-card *ngFor="let bottle of thrownDriftbottles">
+        <ion-card-header>
+          <ion-card-title>{{ bottle.get('content) }}</ion-card-title>
+        </ion-card-header>
+        <ion-card-content>
+          <p>扔出时间: {{ bottle.get('createdAt') }}</p>
+        </ion-card-content>
+      </ion-card>
+    </section>
+
+    <!-- <ion-item>
+      <ion-label>
+        <h2>我捞上的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <ion-card *ngFor="let bottle of caughtDriftbottles">
+      <ion-card-header>
+        <ion-card-title>{{ bottle.content }}</ion-card-title>
+      </ion-card-header>
+      <ion-card-content>
+        <p>{{ bottle.createdAt }}</p>
+      </ion-card-content>
+    </ion-card>
+  </ion-list>
+</ion-content> -->

+ 64 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227164741.ts

@@ -0,0 +1,64 @@
+import { Component, OnInit } from '@angular/core';
+import { Router } from '@angular/router';
+import { CommonModule } from '@angular/common'; // 导入 CommonModule
+
+import { IonHeader, IonButton, IonContent, IonIcon, IonItem, IonLabel, IonList, 
+  IonListHeader, IonCardHeader, IonCardTitle, IonCardContent, IonTitle, IonCard, IonToolbar, IonInput, IonSearchbar } from '@ionic/angular/standalone';
+import { CloudQuery, CloudUser } from 'src/lib/ncloud';
+import { UserService } from 'src/app/user.service'; // 假设这是你的用户服务
+
+@Component({
+  selector: 'app-my-drift-bottle',
+  templateUrl: './my-drift-bottle.component.html',
+  styleUrls: ['./my-drift-bottle.component.scss'],
+  standalone: true,
+  imports: [
+    CommonModule, // 添加 CommonModule
+    
+    IonHeader, IonToolbar, IonTitle, IonContent,
+    IonList, IonListHeader, IonItem, IonCardTitle,
+    IonLabel, IonIcon, IonButton, IonCardContent,
+    IonInput, IonSearchbar, IonCard, IonCardHeader,
+  ]
+})
+export class MyDriftBottleComponent implements OnInit {
+  thrownDriftbottles: any[] = [];
+  caughtDriftbottles: any[] = [];
+
+  constructor(private router: Router, private userService: UserService) {}
+
+  async ngOnInit() {
+    await this.getDriftbottles(); // 获取所有漂流瓶并进行过滤
+  }
+
+  async getDriftbottles() {
+    const query = new CloudQuery('Driftbottle');
+    try {
+      const results = await query.find();
+      this.filterDriftbottles(results);
+    } catch (error) {
+      console.error('加载漂流瓶时出错', error);
+    }
+  }
+
+  filterDriftbottles(driftbottles: any[]) {
+    const username = this.userService.getUsername();
+    this.thrownDriftbottles = driftbottles.filter(bottle => bottle.get('username') === username).map(bottle => ({
+      content: bottle.get('content'),
+      createdAt: bottle.createdAt.toISOString().split('T')[0]
+    }));
+
+    this.caughtDriftbottles = driftbottles.filter(bottle => bottle.get('username') !== username).map(bottle => ({
+      content: bottle.get('content'),
+      createdAt: bottle.createdAt.toISOString().split('T')[0]
+    }));
+  }
+
+  goDriftbottle() {
+    this.router.navigate(['tabs/drift-bottle']);
+  }
+
+  throwNewDriftbottle() {
+    this.router.navigate(['tabs/throw-drift-bottle']); // 假设这是投掷新漂流瓶的路由
+  }
+}

+ 58 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227164921.html

@@ -0,0 +1,58 @@
+<ion-header>
+  <ion-toolbar>
+    <div class="toolbar-content">
+      <div class="button-container">
+        <ion-button (click)="goDriftbottle()" fill="clear">
+          <ion-icon name="chevron-back" slot="start"></ion-icon>返回
+        </ion-button>
+      </div>
+      <ion-title class="title-text">
+        我的漂流瓶
+      </ion-title>
+    </div>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content>
+  <ion-list>
+    <ion-item>
+      <ion-label>
+        <h2>我扔出的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <section *ngIf="thrownDriftbottles.length > 0">
+      <ion-card *ngFor="let bottle of thrownDriftbottles">
+        <ion-card-header>
+          <ion-card-title>{{ bottle.content }}</ion-card-title>
+        </ion-card-header>
+        <ion-card-content>
+          <p>扔出时间: {{ bottle.createdAt }}</p>
+        </ion-card-content>
+      </ion-card>
+    </section>
+
+    <ion-item>
+      <ion-label>
+        <h2>我捞上的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <!-- <section *ngIf="caughtDriftbottles.length > 0">
+      <ion-card *ngFor="let bottle of caughtDriftbottles">
+        <ion-card-header>
+          <ion-card-title>{{ bottle.content }}</ion-card-title>
+        </ion-card-header>
+        <ion-card-content>
+          <p>捞上时间: {{ bottle.createdAt }}</p>
+        </ion-card-content>
+      </ion-card>
+    </section> -->
+  </ion-list>
+
+  <div style="display: flex; justify-content: center; margin-top: auto;">
+    <ion-button (click)="throwNewDriftbottle()" expand="full">
+      投掷新的漂流瓶
+    </ion-button>
+  </div>
+</ion-content>

+ 58 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227164937.html

@@ -0,0 +1,58 @@
+<ion-header>
+  <ion-toolbar>
+    <div class="toolbar-content">
+      <div class="button-container">
+        <ion-button (click)="goDriftbottle()" fill="clear">
+          <ion-icon name="chevron-back" slot="start"></ion-icon>返回
+        </ion-button>
+      </div>
+      <ion-title class="title-text">
+        我的漂流瓶
+      </ion-title>
+    </div>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content>
+  <ion-list>
+    <ion-item>
+      <ion-label>
+        <h2>我扔出的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <section *ngIf="thrownDriftbottle.length > 0">
+      <ion-card *ngFor="let bottle of thrownDriftbottle">
+        <ion-card-header>
+          <ion-card-title>{{ bottle.content }}</ion-card-title>
+        </ion-card-header>
+        <ion-card-content>
+          <p>扔出时间: {{ bottle.createdAt }}</p>
+        </ion-card-content>
+      </ion-card>
+    </section>
+
+    <ion-item>
+      <ion-label>
+        <h2>我捞上的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <!-- <section *ngIf="caughtDriftbottles.length > 0">
+      <ion-card *ngFor="let bottle of caughtDriftbottles">
+        <ion-card-header>
+          <ion-card-title>{{ bottle.content }}</ion-card-title>
+        </ion-card-header>
+        <ion-card-content>
+          <p>捞上时间: {{ bottle.createdAt }}</p>
+        </ion-card-content>
+      </ion-card>
+    </section> -->
+  </ion-list>
+
+  <div style="display: flex; justify-content: center; margin-top: auto;">
+    <ion-button (click)="throwNewDriftbottle()" expand="full">
+      投掷新的漂流瓶
+    </ion-button>
+  </div>
+</ion-content>

+ 58 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227165005.html

@@ -0,0 +1,58 @@
+<ion-header>
+  <ion-toolbar>
+    <div class="toolbar-content">
+      <div class="button-container">
+        <ion-button (click)="goDriftbottle()" fill="clear">
+          <ion-icon name="chevron-back" slot="start"></ion-icon>返回
+        </ion-button>
+      </div>
+      <ion-title class="title-text">
+        我的漂流瓶
+      </ion-title>
+    </div>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content>
+  <ion-list>
+    <ion-item>
+      <ion-label>
+        <h2>我扔出的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <section *ngIf="thrownDriftbottles.length > 0">
+      <ion-card *ngFor="let bottle of thrownDriftbottles">
+        <ion-card-header>
+          <ion-card-title>{{ bottle.content }}</ion-card-title>
+        </ion-card-header>
+        <ion-card-content>
+          <p>扔出时间: {{ bottle.createdAt }}</p>
+        </ion-card-content>
+      </ion-card>
+    </section>
+
+    <ion-item>
+      <ion-label>
+        <h2>我捞上的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <!-- <section *ngIf="caughtDriftbottles.length > 0">
+      <ion-card *ngFor="let bottle of caughtDriftbottles">
+        <ion-card-header>
+          <ion-card-title>{{ bottle.content }}</ion-card-title>
+        </ion-card-header>
+        <ion-card-content>
+          <p>捞上时间: {{ bottle.createdAt }}</p>
+        </ion-card-content>
+      </ion-card>
+    </section> -->
+  </ion-list>
+
+  <div style="display: flex; justify-content: center; margin-top: auto;">
+    <ion-button (click)="throwNewDriftbottle()" expand="full">
+      投掷新的漂流瓶
+    </ion-button>
+  </div>
+</ion-content>

+ 64 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227165235.ts

@@ -0,0 +1,64 @@
+import { Component, OnInit } from '@angular/core';
+import { Router } from '@angular/router';
+import { CommonModule } from '@angular/common'; // 导入 CommonModule
+
+import { IonHeader, IonButton, IonContent, IonIcon, IonItem, IonLabel, IonList, 
+  IonListHeader, IonCardHeader, IonCardTitle, IonCardContent, IonTitle, IonCard, IonToolbar, IonInput, IonSearchbar } from '@ionic/angular/standalone';
+import { CloudQuery, CloudUser } from 'src/lib/ncloud';
+import { UserService } from 'src/app/user.service'; // 假设这是你的用户服务
+
+@Component({
+  selector: 'app-my-drift-bottle',
+  templateUrl: './my-drift-bottle.component.html',
+  styleUrls: ['./my-drift-bottle.component.scss'],
+  standalone: true,
+  imports: [
+    CommonModule, // 添加 CommonModule
+    
+    IonHeader, IonToolbar, IonTitle, IonContent,
+    IonList, IonListHeader, IonItem, IonCardTitle,
+    IonLabel, IonIcon, IonButton, IonCardContent,
+    IonInput, IonSearchbar, IonCard, IonCardHeader,
+  ]
+})
+export class MyDriftBottleComponent implements OnInit {
+  thrownDriftbottles: any[] = [];
+  caughtDriftbottles: any[] = [];
+
+  constructor(private router: Router, private userService: UserService) {}
+
+  async ngOnInit() {
+    await this.getDriftbottles(); // 获取所有漂流瓶并进行过滤
+  }
+
+  async getDriftbottles() {
+    const query = new CloudQuery('Driftbottle'); // 确保表名为 driftbottle
+    try {
+      const results = await query.find();
+      this.filterDriftbottles(results);
+    } catch (error) {
+      console.error('加载漂流瓶时出错', error);
+    }
+  }
+
+  filterDriftbottles(driftbottles: any[]) {
+    const username = this.userService.getUsername();
+    this.thrownDriftbottles = driftbottles.filter(bottle => bottle.get('username') === username).map(bottle => ({
+      content: bottle.get('content'),
+      createdAt: bottle.createdAt.toISOString().split('T')[0]
+    }));
+
+    this.caughtDriftbottles = driftbottles.filter(bottle => bottle.get('username') !== username).map(bottle => ({
+      content: bottle.get('content'),
+      createdAt: bottle.createdAt.toISOString().split('T')[0]
+    }));
+  }
+
+  goDriftbottle() {
+    this.router.navigate(['tabs/drift-bottle']);
+  }
+
+  throwNewDriftbottle() {
+    this.router.navigate(['tabs/throw-drift-bottle']); // 假设这是投掷新漂流瓶的路由
+  }
+}

+ 64 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227165509.ts

@@ -0,0 +1,64 @@
+import { Component, OnInit } from '@angular/core';
+import { Router } from '@angular/router';
+import { CommonModule } from '@angular/common'; // 导入 CommonModule
+
+import { IonHeader, IonButton, IonContent, IonIcon, IonItem, IonLabel, IonList, 
+  IonListHeader, IonCardHeader, IonCardTitle, IonCardContent, IonTitle, IonCard, IonToolbar, IonInput, IonSearchbar } from '@ionic/angular/standalone';
+import { CloudQuery, CloudUser } from 'src/lib/ncloud';
+import { UserService } from 'src/app/user.service'; // 假设这是你的用户服务
+
+@Component({
+  selector: 'app-my-drift-bottle',
+  templateUrl: './my-drift-bottle.component.html',
+  styleUrls: ['./my-drift-bottle.component.scss'],
+  standalone: true,
+  imports: [
+    CommonModule, // 添加 CommonModule
+    
+    IonHeader, IonToolbar, IonTitle, IonContent,
+    IonList, IonListHeader, IonItem, IonCardTitle,
+    IonLabel, IonIcon, IonButton, IonCardContent,
+    IonInput, IonSearchbar, IonCard, IonCardHeader,
+  ]
+})
+export class MyDriftBottleComponent implements OnInit {
+  thrownDriftbottles: any[] = [];
+  caughtDriftbottles: any[] = [];
+
+  constructor(private router: Router, private userService: UserService) {}
+
+  async ngOnInit() {
+    await this.getDriftbottles(); // 获取所有漂流瓶并进行过滤
+  }
+
+  async getDriftbottles() {
+    const query = new CloudQuery('Driftbottle'); // 确保表名为 Driftbottle
+    try {
+      const results = await query.find();
+      this.filterDriftbottles(results);
+    } catch (error) {
+      console.error('加载漂流瓶时出错', error);
+    }
+  }
+
+  filterDriftbottles(driftbottles: any[]) {
+    const username = this.userService.getUsername();
+    this.thrownDriftbottles = driftbottles.filter(bottle => bottle.get('username') === username).map(bottle => ({
+      content: bottle.get('content'),
+      createdAt: bottle.createdAt.toISOString().split('T')[0]
+    }));
+
+    this.caughtDriftbottles = driftbottles.filter(bottle => bottle.get('username') !== username).map(bottle => ({
+      content: bottle.get('content'),
+      createdAt: bottle.createdAt.toISOString().split('T')[0]
+    }));
+  }
+
+  goDriftbottle() {
+    this.router.navigate(['tabs/drift-bottle']);
+  }
+
+  throwNewDriftbottle() {
+    this.router.navigate(['tabs/throw-drift-bottle']); // 假设这是投掷新漂流瓶的路由
+  }
+}

+ 58 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227174152.html

@@ -0,0 +1,58 @@
+<ion-header>
+  <ion-toolbar>
+    <div class="toolbar-content">
+      <div class="button-container">
+        <ion-button (click)="goDriftbottle()" fill="clear">
+          <ion-icon name="chevron-back" slot="start"></ion-icon>返回
+        </ion-button>
+      </div>
+      <ion-title class="title-text">
+        我的漂流瓶
+      </ion-title>
+    </div>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content>
+  <ion-list>
+    <ion-item>
+      <ion-label>
+        <h2>我扔出的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <section *ngIf="thrownDriftbottles.length > 0">
+      <ion-card *ngFor="let bottle of thrownDriftbottles">
+        <ion-card-header>
+          <ion-card-title>{{ driftbottle.get('content') }}</ion-card-title>
+        </ion-card-header>
+        <ion-card-content>
+          <p>扔出时间: {{ driftbottle.get('createdAt') }}</p>
+        </ion-card-content>
+      </ion-card>
+    </section>
+
+    <ion-item>
+      <ion-label>
+        <h2>我捞上的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <!-- <section *ngIf="caughtDriftbottles.length > 0">
+      <ion-card *ngFor="let bottle of caughtDriftbottles">
+        <ion-card-header>
+          <ion-card-title>{{ bottle.content }}</ion-card-title>
+        </ion-card-header>
+        <ion-card-content>
+          <p>捞上时间: {{ bottle.createdAt }}</p>
+        </ion-card-content>
+      </ion-card>
+    </section> -->
+  </ion-list>
+
+  <div style="display: flex; justify-content: center; margin-top: auto;">
+    <ion-button (click)="throwNewDriftbottle()" expand="full">
+      投掷新的漂流瓶
+    </ion-button>
+  </div>
+</ion-content>

+ 59 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227174154.ts

@@ -0,0 +1,59 @@
+import { Component, OnInit } from '@angular/core';
+import { Router } from '@angular/router';
+import { CommonModule } from '@angular/common'; // 导入 CommonModule
+
+import { IonHeader, IonButton, IonContent, IonIcon, IonItem, IonLabel, IonList, 
+  IonListHeader, IonCardHeader, IonCardTitle, IonCardContent, IonTitle, IonCard, IonToolbar, IonInput, IonSearchbar } from '@ionic/angular/standalone';
+import { CloudQuery, CloudUser } from 'src/lib/ncloud';
+import { UserService } from 'src/app/user.service'; // 假设这是你的用户服务
+
+@Component({
+  selector: 'app-my-drift-bottle',
+  templateUrl: './my-drift-bottle.component.html',
+  styleUrls: ['./my-drift-bottle.component.scss'],
+  standalone: true,
+  imports: [
+    CommonModule, // 添加 CommonModule
+    
+    IonHeader, IonToolbar, IonTitle, IonContent,
+    IonList, IonListHeader, IonItem, IonCardTitle,
+    IonLabel, IonIcon, IonButton, IonCardContent,
+    IonInput, IonSearchbar, IonCard, IonCardHeader,
+  ]
+})
+export class MyDriftBottleComponent implements OnInit {
+  thrownDriftbottles: any[] = [];
+  Driftbottles: any[]=[];
+  filteredDriftbottles: any[]=[];
+  username: String='';
+  caughtDriftbottles: any[] = [];
+
+  constructor(private router: Router, private userService: UserService) {}
+
+  ngOnInit() {
+    this.getDriftbottles(); // 获取所有漂流瓶并进行过滤
+  }
+
+  async getDriftbottles() {
+    let query=new CloudQuery("Driftbottle");
+    this.Driftbottles = await query.find(); 
+      this.filterDriftbottles(); 
+  }
+
+  filterDriftbottles() {
+    let user = new CloudUser();
+    console.log(user)
+    this.filteredDriftbottles = this.Driftbottles.filter(driftbottle => {
+      console.log(driftbottle.get("username"), user.get("username"))
+      return (driftbottle.get("username") === user.get("username") || driftbottle.get("username") === 'all');
+    });
+  }
+
+  goDriftbottle() {
+    this.router.navigate(['tabs/drift-bottle']);
+  }
+
+  throwNewDriftbottle() {
+    this.router.navigate(['tabs/throw-drift-bottle']); // 假设这是投掷新漂流瓶的路由
+  }
+}

+ 58 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227174223.html

@@ -0,0 +1,58 @@
+<ion-header>
+  <ion-toolbar>
+    <div class="toolbar-content">
+      <div class="button-container">
+        <ion-button (click)="goDriftbottle()" fill="clear">
+          <ion-icon name="chevron-back" slot="start"></ion-icon>返回
+        </ion-button>
+      </div>
+      <ion-title class="title-text">
+        我的漂流瓶
+      </ion-title>
+    </div>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content>
+  <ion-list>
+    <ion-item>
+      <ion-label>
+        <h2>我扔出的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <section *ngIf="thrownDriftbottles.length > 0">
+      <ion-card *ngFor="let bottle of thrownDriftbottles">
+        <ion-card-header>
+          <ion-card-title>{{ Driftbottle.get('content') }}</ion-card-title>
+        </ion-card-header>
+        <ion-card-content>
+          <p>扔出时间: {{ Driftbottle.get('createdAt') }}</p>
+        </ion-card-content>
+      </ion-card>
+    </section>
+
+    <ion-item>
+      <ion-label>
+        <h2>我捞上的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <!-- <section *ngIf="caughtDriftbottles.length > 0">
+      <ion-card *ngFor="let bottle of caughtDriftbottles">
+        <ion-card-header>
+          <ion-card-title>{{ bottle.content }}</ion-card-title>
+        </ion-card-header>
+        <ion-card-content>
+          <p>捞上时间: {{ bottle.createdAt }}</p>
+        </ion-card-content>
+      </ion-card>
+    </section> -->
+  </ion-list>
+
+  <div style="display: flex; justify-content: center; margin-top: auto;">
+    <ion-button (click)="throwNewDriftbottle()" expand="full">
+      投掷新的漂流瓶
+    </ion-button>
+  </div>
+</ion-content>

+ 58 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227174238.html

@@ -0,0 +1,58 @@
+<ion-header>
+  <ion-toolbar>
+    <div class="toolbar-content">
+      <div class="button-container">
+        <ion-button (click)="goDriftbottle()" fill="clear">
+          <ion-icon name="chevron-back" slot="start"></ion-icon>返回
+        </ion-button>
+      </div>
+      <ion-title class="title-text">
+        我的漂流瓶
+      </ion-title>
+    </div>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content>
+  <ion-list>
+    <ion-item>
+      <ion-label>
+        <h2>我扔出的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <section *ngIf="thrownDriftbottles.length > 0">
+      <ion-card *ngFor="let bottle of thrownDriftbottles">
+        <ion-card-header>
+          <ion-card-title>{{ Driftbottles.get('content') }}</ion-card-title>
+        </ion-card-header>
+        <ion-card-content>
+          <p>扔出时间: {{ Driftbottle.get('createdAt') }}</p>
+        </ion-card-content>
+      </ion-card>
+    </section>
+
+    <ion-item>
+      <ion-label>
+        <h2>我捞上的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <!-- <section *ngIf="caughtDriftbottles.length > 0">
+      <ion-card *ngFor="let bottle of caughtDriftbottles">
+        <ion-card-header>
+          <ion-card-title>{{ bottle.content }}</ion-card-title>
+        </ion-card-header>
+        <ion-card-content>
+          <p>捞上时间: {{ bottle.createdAt }}</p>
+        </ion-card-content>
+      </ion-card>
+    </section> -->
+  </ion-list>
+
+  <div style="display: flex; justify-content: center; margin-top: auto;">
+    <ion-button (click)="throwNewDriftbottle()" expand="full">
+      投掷新的漂流瓶
+    </ion-button>
+  </div>
+</ion-content>

+ 58 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227174245.html

@@ -0,0 +1,58 @@
+<ion-header>
+  <ion-toolbar>
+    <div class="toolbar-content">
+      <div class="button-container">
+        <ion-button (click)="goDriftbottle()" fill="clear">
+          <ion-icon name="chevron-back" slot="start"></ion-icon>返回
+        </ion-button>
+      </div>
+      <ion-title class="title-text">
+        我的漂流瓶
+      </ion-title>
+    </div>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content>
+  <ion-list>
+    <ion-item>
+      <ion-label>
+        <h2>我扔出的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <section *ngIf="thrownDriftbottles.length > 0">
+      <ion-card *ngFor="let bottle of thrownDriftbottles">
+        <ion-card-header>
+          <ion-card-title>{{ Driftbottles.get('content') }}</ion-card-title>
+        </ion-card-header>
+        <ion-card-content>
+          <p>扔出时间: {{ Driftbottles.get('createdAt') }}</p>
+        </ion-card-content>
+      </ion-card>
+    </section>
+
+    <ion-item>
+      <ion-label>
+        <h2>我捞上的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <!-- <section *ngIf="caughtDriftbottles.length > 0">
+      <ion-card *ngFor="let bottle of caughtDriftbottles">
+        <ion-card-header>
+          <ion-card-title>{{ bottle.content }}</ion-card-title>
+        </ion-card-header>
+        <ion-card-content>
+          <p>捞上时间: {{ bottle.createdAt }}</p>
+        </ion-card-content>
+      </ion-card>
+    </section> -->
+  </ion-list>
+
+  <div style="display: flex; justify-content: center; margin-top: auto;">
+    <ion-button (click)="throwNewDriftbottle()" expand="full">
+      投掷新的漂流瓶
+    </ion-button>
+  </div>
+</ion-content>

+ 58 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227174303.html

@@ -0,0 +1,58 @@
+<ion-header>
+  <ion-toolbar>
+    <div class="toolbar-content">
+      <div class="button-container">
+        <ion-button (click)="goDriftbottle()" fill="clear">
+          <ion-icon name="chevron-back" slot="start"></ion-icon>返回
+        </ion-button>
+      </div>
+      <ion-title class="title-text">
+        我的漂流瓶
+      </ion-title>
+    </div>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content>
+  <ion-list>
+    <ion-item>
+      <ion-label>
+        <h2>我扔出的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <section *ngIf="thrownDriftbottles.length > 0">
+      <ion-card *ngFor="let bottle of thrownDriftbottles">
+        <ion-card-header>
+          <ion-card-title>{{ bottle.get('content') }}</ion-card-title>
+        </ion-card-header>
+        <ion-card-content>
+          <p>扔出时间: {{ bottle.get('createdAt') }}</p>
+        </ion-card-content>
+      </ion-card>
+    </section>
+
+    <ion-item>
+      <ion-label>
+        <h2>我捞上的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <!-- <section *ngIf="caughtDriftbottles.length > 0">
+      <ion-card *ngFor="let bottle of caughtDriftbottles">
+        <ion-card-header>
+          <ion-card-title>{{ bottle.content }}</ion-card-title>
+        </ion-card-header>
+        <ion-card-content>
+          <p>捞上时间: {{ bottle.createdAt }}</p>
+        </ion-card-content>
+      </ion-card>
+    </section> -->
+  </ion-list>
+
+  <div style="display: flex; justify-content: center; margin-top: auto;">
+    <ion-button (click)="throwNewDriftbottle()" expand="full">
+      投掷新的漂流瓶
+    </ion-button>
+  </div>
+</ion-content>

+ 58 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227174425.html

@@ -0,0 +1,58 @@
+<ion-header>
+  <ion-toolbar>
+    <div class="toolbar-content">
+      <div class="button-container">
+        <ion-button (click)="goDriftbottle()" fill="clear">
+          <ion-icon name="chevron-back" slot="start"></ion-icon>返回
+        </ion-button>
+      </div>
+      <ion-title class="title-text">
+        我的漂流瓶
+      </ion-title>
+    </div>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content>
+  <ion-list>
+    <ion-item>
+      <ion-label>
+        <h2>我扔出的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <section *ngIf="filteredDriftbottles.length > 0">
+      <ion-card *ngFor="let bottle of filteredDriftbottles">
+        <ion-card-header>
+          <ion-card-title>{{ bottle.get('content') }}</ion-card-title>
+        </ion-card-header>
+        <ion-card-content>
+          <p>扔出时间: {{ bottle.get('createdAt') }}</p>
+        </ion-card-content>
+      </ion-card>
+    </section>
+
+    <ion-item>
+      <ion-label>
+        <h2>我捞上的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <!-- <section *ngIf="caughtDriftbottles.length > 0">
+      <ion-card *ngFor="let bottle of caughtDriftbottles">
+        <ion-card-header>
+          <ion-card-title>{{ bottle.content }}</ion-card-title>
+        </ion-card-header>
+        <ion-card-content>
+          <p>捞上时间: {{ bottle.createdAt }}</p>
+        </ion-card-content>
+      </ion-card>
+    </section> -->
+  </ion-list>
+
+  <div style="display: flex; justify-content: center; margin-top: auto;">
+    <ion-button (click)="throwNewDriftbottle()" expand="full">
+      投掷新的漂流瓶
+    </ion-button>
+  </div>
+</ion-content>

+ 58 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227180046.html

@@ -0,0 +1,58 @@
+<ion-header>
+  <ion-toolbar>
+    <div class="toolbar-content">
+      <div class="button-container">
+        <ion-button (click)="goDriftbottle()" fill="clear">
+          <ion-icon name="chevron-back" slot="start"></ion-icon>返回
+        </ion-button>
+      </div>
+      <ion-title class="title-text">
+        我的漂流瓶
+      </ion-title>
+    </div>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content>
+  <ion-list>
+    <ion-item>
+      <ion-label>
+        <h2>我扔出的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <section *ngIf="filteredDriftbottles.length > 0">
+      <ion-card *ngFor="let bottle of filteredDriftbottles">
+        <ion-card-header>
+          <ion-card-title>{{ bottle.get('content') }}</ion-card-title>
+        </ion-card-header>
+        <ion-card-content>
+          <p>扔出时间: {{ bottle.get('objectId') }}</p>
+        </ion-card-content>
+      </ion-card>
+    </section>
+
+    <ion-item>
+      <ion-label>
+        <h2>我捞上的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <!-- <section *ngIf="caughtDriftbottles.length > 0">
+      <ion-card *ngFor="let bottle of caughtDriftbottles">
+        <ion-card-header>
+          <ion-card-title>{{ bottle.content }}</ion-card-title>
+        </ion-card-header>
+        <ion-card-content>
+          <p>捞上时间: {{ bottle.createdAt }}</p>
+        </ion-card-content>
+      </ion-card>
+    </section> -->
+  </ion-list>
+
+  <div style="display: flex; justify-content: center; margin-top: auto;">
+    <ion-button (click)="throwNewDriftbottle()" expand="full">
+      投掷新的漂流瓶
+    </ion-button>
+  </div>
+</ion-content>

+ 58 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227180214.html

@@ -0,0 +1,58 @@
+<ion-header>
+  <ion-toolbar>
+    <div class="toolbar-content">
+      <div class="button-container">
+        <ion-button (click)="goDriftbottle()" fill="clear">
+          <ion-icon name="chevron-back" slot="start"></ion-icon>返回
+        </ion-button>
+      </div>
+      <ion-title class="title-text">
+        我的漂流瓶
+      </ion-title>
+    </div>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content>
+  <ion-list>
+    <ion-item>
+      <ion-label>
+        <h2>我扔出的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <section *ngIf="filteredDriftbottles.length > 0">
+      <ion-card *ngFor="let bottle of filteredDriftbottles">
+        <ion-card-header>
+          <ion-card-title>{{ bottle.get('content') }}</ion-card-title>
+        </ion-card-header>
+        <ion-card-content>
+          <p>扔出时间: {{ bottle.get('username') }}</p>
+        </ion-card-content>
+      </ion-card>
+    </section>
+
+    <ion-item>
+      <ion-label>
+        <h2>我捞上的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <!-- <section *ngIf="caughtDriftbottles.length > 0">
+      <ion-card *ngFor="let bottle of caughtDriftbottles">
+        <ion-card-header>
+          <ion-card-title>{{ bottle.content }}</ion-card-title>
+        </ion-card-header>
+        <ion-card-content>
+          <p>捞上时间: {{ bottle.createdAt }}</p>
+        </ion-card-content>
+      </ion-card>
+    </section> -->
+  </ion-list>
+
+  <div style="display: flex; justify-content: center; margin-top: auto;">
+    <ion-button (click)="throwNewDriftbottle()" expand="full">
+      投掷新的漂流瓶
+    </ion-button>
+  </div>
+</ion-content>

+ 58 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227180257.html

@@ -0,0 +1,58 @@
+<ion-header>
+  <ion-toolbar>
+    <div class="toolbar-content">
+      <div class="button-container">
+        <ion-button (click)="goDriftbottle()" fill="clear">
+          <ion-icon name="chevron-back" slot="start"></ion-icon>返回
+        </ion-button>
+      </div>
+      <ion-title class="title-text">
+        我的漂流瓶
+      </ion-title>
+    </div>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content>
+  <ion-list>
+    <ion-item>
+      <ion-label>
+        <h2>我扔出的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <section *ngIf="filteredDriftbottles.length > 0">
+      <ion-card *ngFor="let bottle of filteredDriftbottles">
+        <ion-card-header>
+          <ion-card-title>{{ bottle.get('content') }}</ion-card-title>
+        </ion-card-header>
+        <ion-card-content>
+          <p>扔出时间: {{ bottle.get('createdAt') }}</p>
+        </ion-card-content>
+      </ion-card>
+    </section>
+
+    <ion-item>
+      <ion-label>
+        <h2>我捞上的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <!-- <section *ngIf="caughtDriftbottles.length > 0">
+      <ion-card *ngFor="let bottle of caughtDriftbottles">
+        <ion-card-header>
+          <ion-card-title>{{ bottle.content }}</ion-card-title>
+        </ion-card-header>
+        <ion-card-content>
+          <p>捞上时间: {{ bottle.createdAt }}</p>
+        </ion-card-content>
+      </ion-card>
+    </section> -->
+  </ion-list>
+
+  <div style="display: flex; justify-content: center; margin-top: auto;">
+    <ion-button (click)="throwNewDriftbottle()" expand="full">
+      投掷新的漂流瓶
+    </ion-button>
+  </div>
+</ion-content>

+ 58 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227181144.html

@@ -0,0 +1,58 @@
+<ion-header>
+  <ion-toolbar>
+    <div class="toolbar-content">
+      <div class="button-container">
+        <ion-button (click)="goDriftbottle()" fill="clear">
+          <ion-icon name="chevron-back" slot="start"></ion-icon>返回
+        </ion-button>
+      </div>
+      <ion-title class="title-text">
+        我的漂流瓶
+      </ion-title>
+    </div>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content>
+  <ion-list>
+    <ion-item>
+      <ion-label>
+        <h2>我扔出的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <section *ngIf="filteredDriftbottles.length > 0">
+      <ion-card *ngFor="let bottle of filteredDriftbottles">
+        <ion-card-header>
+          <ion-card-title>{{ bottle.get('content') }}</ion-card-title>
+        </ion-card-header>
+        <ion-card-content>
+          <p>扔出时间: {{ bottle.get('throwtime') }}</p>
+        </ion-card-content>
+      </ion-card>
+    </section>
+
+    <ion-item>
+      <ion-label>
+        <h2>我捞上的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <!-- <section *ngIf="caughtDriftbottles.length > 0">
+      <ion-card *ngFor="let bottle of caughtDriftbottles">
+        <ion-card-header>
+          <ion-card-title>{{ bottle.content }}</ion-card-title>
+        </ion-card-header>
+        <ion-card-content>
+          <p>捞上时间: {{ bottle.createdAt }}</p>
+        </ion-card-content>
+      </ion-card>
+    </section> -->
+  </ion-list>
+
+  <div style="display: flex; justify-content: center; margin-top: auto;">
+    <ion-button (click)="throwNewDriftbottle()" expand="full">
+      投掷新的漂流瓶
+    </ion-button>
+  </div>
+</ion-content>

+ 59 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227181752.ts

@@ -0,0 +1,59 @@
+import { Component, OnInit } from '@angular/core';
+import { Router } from '@angular/router';
+import { CommonModule } from '@angular/common'; // 导入 CommonModule
+
+import { IonHeader, IonButton, IonContent, IonIcon, IonItem, IonLabel, IonList, 
+  IonListHeader, IonCardHeader, IonCardTitle, IonCardContent, IonTitle, IonCard, IonToolbar, IonInput, IonSearchbar } from '@ionic/angular/standalone';
+import { CloudQuery, CloudUser } from 'src/lib/ncloud';
+import { UserService } from 'src/app/user.service'; // 假设这是你的用户服务
+
+@Component({
+  selector: 'app-my-drift-bottle',
+  templateUrl: './my-drift-bottle.component.html',
+  styleUrls: ['./my-drift-bottle.component.scss'],
+  standalone: true,
+  imports: [
+    CommonModule, // 添加 CommonModule
+    
+    IonHeader, IonToolbar, IonTitle, IonContent,
+    IonList, IonListHeader, IonItem, IonCardTitle,
+    IonLabel, IonIcon, IonButton, IonCardContent,
+    IonInput, IonSearchbar, IonCard, IonCardHeader,
+  ]
+})
+export class MyDriftBottleComponent implements OnInit {
+  
+  Driftbottles: any[]=[];
+  filteredDriftbottles: any[]=[];
+  username: String='';
+  
+
+  constructor(private router: Router, private userService: UserService) {}
+
+  ngOnInit() {
+    this.getDriftbottles(); // 获取所有漂流瓶并进行过滤
+  }
+
+  async getDriftbottles() {
+    let query=new CloudQuery("Driftbottle");
+    this.Driftbottles = await query.find(); 
+      this.filterDriftbottles(); 
+  }
+
+  filterDriftbottles() {
+    let user = new CloudUser();
+    console.log(user)
+    this.filteredDriftbottles = this.Driftbottles.filter(driftbottle => {
+      console.log(driftbottle.get("username"), user.get("username"))
+      return (driftbottle.get("username") === user.get("username") || driftbottle.get("username") === 'all');
+    });
+  }
+
+  goDriftbottle() {
+    this.router.navigate(['tabs/drift-bottle']);
+  }
+
+  throwNewDriftbottle() {
+    this.router.navigate(['tabs/throw-drift-bottle']); // 假设这是投掷新漂流瓶的路由
+  }
+}

+ 71 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227184220.ts

@@ -0,0 +1,71 @@
+import { Component, OnInit } from '@angular/core';
+import { Router } from '@angular/router';
+import { CommonModule } from '@angular/common'; // 导入 CommonModule
+
+import { IonHeader, IonButton, IonContent, IonIcon, IonItem, IonLabel, IonList, 
+  IonListHeader, IonCardHeader, IonCardTitle, IonCardContent, IonTitle, IonCard, IonToolbar, IonInput, IonSearchbar } from '@ionic/angular/standalone';
+import { CloudQuery, CloudUser } from 'src/lib/ncloud';
+import { UserService } from 'src/app/user.service'; // 假设这是你的用户服务
+
+@Component({
+  selector: 'app-my-drift-bottle',
+  templateUrl: './my-drift-bottle.component.html',
+  styleUrls: ['./my-drift-bottle.component.scss'],
+  standalone: true,
+  imports: [
+    CommonModule, // 添加 CommonModule
+    
+    IonHeader, IonToolbar, IonTitle, IonContent,
+    IonList, IonListHeader, IonItem, IonCardTitle,
+    IonLabel, IonIcon, IonButton, IonCardContent,
+    IonInput, IonSearchbar, IonCard, IonCardHeader,
+  ]
+})
+export class MyDriftBottleComponent implements OnInit {
+  filteredDriftbottles2:any[]=[];
+  Driftbottles: any[]=[];
+  filteredDriftbottles: any[]=[];
+  username: String='';
+  
+
+  constructor(private router: Router, private userService: UserService) {}
+
+  ngOnInit() {
+    this.getDriftbottles(); // 获取所有漂流瓶并进行过滤
+  }
+
+  async getDriftbottles() {
+    let query=new CloudQuery("Driftbottle");
+    this.Driftbottles = await query.find(); 
+      this.filterDriftbottles(); 
+      this.filterDriftbottles2(); 
+
+  }
+
+  filterDriftbottles() {
+    let user = new CloudUser();
+    console.log(user)
+    this.filteredDriftbottles = this.Driftbottles.filter(driftbottle => {
+      console.log(driftbottle.get("username"), user.get("username"))
+      return (driftbottle.get("username") === user.get("username") || driftbottle.get("username") === 'all');
+    });
+  }
+  filterDriftbottles2(){
+    let user = new CloudUser();
+    console.log(user)
+    this.filteredDriftbottles2 = this.Driftbottles.filter(driftbottle => {
+      console.log(driftbottle.get("catcher"), user.get("username"))
+      return (driftbottle.get("catcher") === user.get("username") || driftbottle.get("catcher") === 'all');
+    });
+  }
+
+  
+
+  goDriftbottle() {
+    this.router.navigate(['tabs/drift-bottle']);
+  }
+
+  throwNewDriftbottle() {
+    this.router.navigate(['tabs/throw-drift-bottle']); // 假设这是投掷新漂流瓶的路由
+  }
+}

+ 58 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227184245.html

@@ -0,0 +1,58 @@
+<ion-header>
+  <ion-toolbar>
+    <div class="toolbar-content">
+      <div class="button-container">
+        <ion-button (click)="goDriftbottle()" fill="clear">
+          <ion-icon name="chevron-back" slot="start"></ion-icon>返回
+        </ion-button>
+      </div>
+      <ion-title class="title-text">
+        我的漂流瓶
+      </ion-title>
+    </div>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content>
+  <ion-list>
+    <ion-item>
+      <ion-label>
+        <h2>我扔出的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <section *ngIf="filteredDriftbottles.length > 0">
+      <ion-card *ngFor="let bottle of filteredDriftbottles">
+        <ion-card-header>
+          <ion-card-title>{{ bottle.get('content') }}</ion-card-title>
+        </ion-card-header>
+        <ion-card-content>
+          <p>打捞时间: {{ bottle.get('catchtime') }}</p>
+        </ion-card-content>
+      </ion-card>
+    </section>
+
+    <ion-item>
+      <ion-label>
+        <h2>我捞上的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <section *ngIf="caughtDriftbottles.length > 0">
+      <ion-card *ngFor="let bottle of caughtDriftbottles">
+        <ion-card-header>
+          <ion-card-title>{{ bottle.content }}</ion-card-title>
+        </ion-card-header>
+        <ion-card-content>
+          <p>捞上时间: {{ bottle.createdAt }}</p>
+        </ion-card-content>
+      </ion-card>
+    </section>
+  </ion-list>
+
+  <div style="display: flex; justify-content: center; margin-top: auto;">
+    <ion-button (click)="throwNewDriftbottle()" expand="full">
+      投掷新的漂流瓶
+    </ion-button>
+  </div>
+</ion-content>

+ 58 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227184300.html

@@ -0,0 +1,58 @@
+<ion-header>
+  <ion-toolbar>
+    <div class="toolbar-content">
+      <div class="button-container">
+        <ion-button (click)="goDriftbottle()" fill="clear">
+          <ion-icon name="chevron-back" slot="start"></ion-icon>返回
+        </ion-button>
+      </div>
+      <ion-title class="title-text">
+        我的漂流瓶
+      </ion-title>
+    </div>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content>
+  <ion-list>
+    <ion-item>
+      <ion-label>
+        <h2>我扔出的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <section *ngIf="filteredDriftbottles2.length > 0">
+      <ion-card *ngFor="let bottle of filteredDriftbottles2">
+        <ion-card-header>
+          <ion-card-title>{{ bottle.get('content') }}</ion-card-title>
+        </ion-card-header>
+        <ion-card-content>
+          <p>打捞时间: {{ bottle.get('catchtime') }}</p>
+        </ion-card-content>
+      </ion-card>
+    </section>
+
+    <ion-item>
+      <ion-label>
+        <h2>我捞上的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <section *ngIf="caughtDriftbottles.length > 0">
+      <ion-card *ngFor="let bottle of caughtDriftbottles">
+        <ion-card-header>
+          <ion-card-title>{{ bottle.content }}</ion-card-title>
+        </ion-card-header>
+        <ion-card-content>
+          <p>捞上时间: {{ bottle.createdAt }}</p>
+        </ion-card-content>
+      </ion-card>
+    </section>
+  </ion-list>
+
+  <div style="display: flex; justify-content: center; margin-top: auto;">
+    <ion-button (click)="throwNewDriftbottle()" expand="full">
+      投掷新的漂流瓶
+    </ion-button>
+  </div>
+</ion-content>

+ 58 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227184422.html

@@ -0,0 +1,58 @@
+<ion-header>
+  <ion-toolbar>
+    <div class="toolbar-content">
+      <div class="button-container">
+        <ion-button (click)="goDriftbottle()" fill="clear">
+          <ion-icon name="chevron-back" slot="start"></ion-icon>返回
+        </ion-button>
+      </div>
+      <ion-title class="title-text">
+        我的漂流瓶
+      </ion-title>
+    </div>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content>
+  <ion-list>
+    <ion-item>
+      <ion-label>
+        <h2>我扔出的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <section *ngIf="filteredDriftbottles.length > 0">
+      <ion-card *ngFor="let bottle of filteredDriftbottles">
+        <ion-card-header>
+          <ion-card-title>{{ bottle.get('content') }}</ion-card-title>
+        </ion-card-header>
+        <ion-card-content>
+          <p>扔出时间: {{ bottle.get('throwtime') }}</p>
+        </ion-card-content>
+      </ion-card>
+    </section>
+
+    <ion-item>
+      <ion-label>
+        <h2>我捞上的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <section *ngIf="caughtDriftbottles2.length > 0">
+      <ion-card *ngFor="let bottle of caughtDriftbottles2">
+        <ion-card-header>
+          <ion-card-title>{{ bottle.get('content') }}</ion-card-title>
+        </ion-card-header>
+        <ion-card-content>
+          <p>打捞时间: {{ bottle.get('catchtime') }}</p>
+        </ion-card-content>
+      </ion-card>
+    </section>
+  </ion-list>
+
+  <div style="display: flex; justify-content: center; margin-top: auto;">
+    <ion-button (click)="throwNewDriftbottle()" expand="full">
+      投掷新的漂流瓶
+    </ion-button>
+  </div>
+</ion-content>

+ 58 - 0
.history/soul-app/src/app/my-drift-bottle/my-drift-bottle.component_20241227184450.html

@@ -0,0 +1,58 @@
+<ion-header>
+  <ion-toolbar>
+    <div class="toolbar-content">
+      <div class="button-container">
+        <ion-button (click)="goDriftbottle()" fill="clear">
+          <ion-icon name="chevron-back" slot="start"></ion-icon>返回
+        </ion-button>
+      </div>
+      <ion-title class="title-text">
+        我的漂流瓶
+      </ion-title>
+    </div>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content>
+  <ion-list>
+    <ion-item>
+      <ion-label>
+        <h2>我扔出的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <section *ngIf="filteredDriftbottles.length > 0">
+      <ion-card *ngFor="let bottle of filteredDriftbottles">
+        <ion-card-header>
+          <ion-card-title>{{ bottle.get('content') }}</ion-card-title>
+        </ion-card-header>
+        <ion-card-content>
+          <p>扔出时间: {{ bottle.get('throwtime') }}</p>
+        </ion-card-content>
+      </ion-card>
+    </section>
+
+    <ion-item>
+      <ion-label>
+        <h2>我捞上的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <section *ngIf="filteredDriftbottles2.length > 0">
+      <ion-card *ngFor="let bottle of filteredDriftbottles2">
+        <ion-card-header>
+          <ion-card-title>{{ bottle.get('content') }}</ion-card-title>
+        </ion-card-header>
+        <ion-card-content>
+          <p>打捞时间: {{ bottle.get('catchtime') }}</p>
+        </ion-card-content>
+      </ion-card>
+    </section>
+  </ion-list>
+
+  <div style="display: flex; justify-content: center; margin-top: auto;">
+    <ion-button (click)="throwNewDriftbottle()" expand="full">
+      投掷新的漂流瓶
+    </ion-button>
+  </div>
+</ion-content>

+ 58 - 0
.history/soul-app/src/app/page-psysurvey/page-psysurvey.component_20241227164210.ts

@@ -0,0 +1,58 @@
+import { CommonModule } from '@angular/common';
+import { Component, OnInit } from '@angular/core';
+import { Router } from '@angular/router';
+import { IonHeader,IonButton, IonContent, IonIcon,
+  IonCardHeader,IonCardTitle,IonCardContent, IonTitle,IonCard, IonToolbar } from '@ionic/angular/standalone';
+  import { HttpClient } from '@angular/common/http';
+  import { UserService } from '../user.service'; // 确保路径正确
+  import { FormsModule } from '@angular/forms'; // 导入 FormsModule
+import { CloudQuery, CloudUser } from 'src/lib/ncloud';
+
+
+  
+
+@Component({
+  selector: 'app-page-psysurvey',
+  templateUrl: './page-psysurvey.component.html',
+  styleUrls: ['./page-psysurvey.component.scss'],
+  standalone: true,
+  imports: [IonHeader,IonToolbar,IonTitle,IonContent,
+      IonCardTitle,FormsModule,
+      IonIcon,IonButton,IonCardContent,
+      IonCard,IonCardHeader,
+      CommonModule
+    ]
+})
+export class PagePsysurveyComponent  implements OnInit {
+  surveys: any[] = []; // 存储问卷通知
+  filteredSurveys: any[] = []; // 存储过滤后的问卷
+  userDepartment: string = '' ; // 当前用户的学院
+
+  constructor(private router: Router) { }
+  goTab1(){
+    this.router.navigate(['tabs/tab1']);
+   }
+   goPublishSurvey(){
+    this.router.navigate(['tabs/page-publishsurvey'])
+   }
+
+   ngOnInit() {
+      this.getSurveys(); // 在获取到用户信息后获取问卷
+  }
+
+  async getSurveys() {
+      let query = new CloudQuery("Survey");
+      this.surveys = await query.find(); // 假设响应是问卷数组
+      this.filterSurveys(); // 过滤问卷
+  }
+  filterSurveys() {
+    let user = new CloudUser();
+    console.log(user)
+    this.filteredSurveys = this.surveys.filter(survey => {
+      console.log(survey.get("audience"), user.get("department"))
+      return (survey.get("audience") === user.get("department") || survey.get("audience") === 'all');
+    });
+  }
+  
+  
+}

+ 56 - 0
.history/soul-app/src/app/page-psysurvey/page-psysurvey.component_20241227173254.ts

@@ -0,0 +1,56 @@
+import { CommonModule } from '@angular/common';
+import { Component, OnInit } from '@angular/core';
+import { Router } from '@angular/router';
+import { IonHeader,IonButton, IonContent, IonIcon,
+  IonCardHeader,IonCardTitle,IonCardContent, IonTitle,IonCard, IonToolbar } from '@ionic/angular/standalone';
+  import { FormsModule } from '@angular/forms'; // 导入 FormsModule
+import { CloudQuery, CloudUser } from 'src/lib/ncloud';
+
+
+  
+
+@Component({
+  selector: 'app-page-psysurvey',
+  templateUrl: './page-psysurvey.component.html',
+  styleUrls: ['./page-psysurvey.component.scss'],
+  standalone: true,
+  imports: [IonHeader,IonToolbar,IonTitle,IonContent,
+      IonCardTitle,FormsModule,
+      IonIcon,IonButton,IonCardContent,
+      IonCard,IonCardHeader,
+      CommonModule
+    ]
+})
+export class PagePsysurveyComponent  implements OnInit {
+  surveys: any[] = []; // 存储问卷通知
+  filteredSurveys: any[] = []; // 存储过滤后的问卷
+  userDepartment: string = '' ; // 当前用户的学院
+
+  constructor(private router: Router) { }
+  goTab1(){
+    this.router.navigate(['tabs/tab1']);
+   }
+   goPublishSurvey(){
+    this.router.navigate(['tabs/page-publishsurvey'])
+   }
+
+   ngOnInit() {
+      this.getSurveys(); // 在获取到用户信息后获取问卷
+  }
+
+  async getSurveys() {
+      let query = new CloudQuery("Survey");
+      this.surveys = await query.find(); // 假设响应是问卷数组
+      this.filterSurveys(); // 过滤问卷
+  }
+  filterSurveys() {
+    let user = new CloudUser();
+    console.log(user)
+    this.filteredSurveys = this.surveys.filter(survey => {
+      console.log(survey.get("audience"), user.get("department"))
+      return (survey.get("audience") === user.get("department") || survey.get("audience") === 'all');
+    });
+  }
+  
+  
+}

+ 78 - 0
.history/soul-app/src/app/throw-drift-bottle/throw-drift-bottle.component_20241227151907.ts

@@ -0,0 +1,78 @@
+import { Component, OnInit } from '@angular/core';
+import { ModalController, IonInput, IonItem, IonLabel, IonButton, IonCard, IonCardHeader, IonCardTitle, IonCardSubtitle, IonCardContent } from '@ionic/angular/standalone';
+import { CloudObject } from 'src/lib/ncloud';
+import { FormsModule } from '@angular/forms'; // 导入 FormsModule
+import { CommonModule } from '@angular/common';
+import { UserService } from 'src/app/user.service'; // 假设这是你的用户服务
+
+@Component({
+  selector: 'app-throw-drift-bottle',
+  templateUrl: './throw-drift-bottle.component.html',
+  styleUrls: ['./throw-drift-bottle.component.scss'],
+  standalone: true,
+  imports: [
+    IonCard,
+    IonCardHeader,
+    IonCardTitle,
+    IonCardSubtitle,
+    IonCardContent,
+    IonButton,
+    IonInput,
+    IonItem,
+    IonLabel,
+    FormsModule,
+    CommonModule
+  ],
+})
+export class ThrowDriftBottleComponent implements OnInit {
+  driftbottleData: { content: string, username: string } = { content: '', username: '' }; // 漂流瓶内容和用户名
+
+  constructor(
+    private modalCtrl: ModalController,
+    private userService: UserService // 注入用户服务
+  ) {}
+
+  ngOnInit() {
+    this.driftbottleData.username = this.userService.getUsername(); // 获取当前用户的用户名
+  }
+
+  throw() {
+    console.log('投掷漂流瓶:');
+    console.log(`内容: ${this.driftbottleData.content}`);
+    console.log(`用户名: ${this.driftbottleData.username}`);
+
+    const driftbottleData = {
+      content: this.driftbottleData.content,
+      username: this.driftbottleData.username,
+    };
+
+    let driftbottle = new CloudObject("Driftbottle");
+    driftbottle.set(driftbottleData);
+    driftbottle.save().then(data => {
+      console.log('漂流瓶已成功投掷', data);
+      this.modalCtrl.dismiss(driftbottle, "confirm");
+    }).catch(err => {
+      console.error('投掷漂流瓶时出错', err);
+    });
+  }
+
+  cancel() {
+    this.modalCtrl.dismiss(null, "cancel");
+  }
+}
+
+export async function openThrowDriftBottleModal(modalCtrl: ModalController): Promise<any> {
+  const modal = await modalCtrl.create({
+    component: ThrowDriftBottleComponent,
+    breakpoints: [0.7, 1.0],
+    initialBreakpoint: 0.7
+  });
+  modal.present();
+
+  const { data, role } = await modal.onWillDismiss();
+
+  if (role === 'confirm') {
+    return data;
+  }
+  return null;
+}

+ 83 - 0
.history/soul-app/src/app/throw-drift-bottle/throw-drift-bottle.component_20241227152138.ts

@@ -0,0 +1,83 @@
+import { Component, OnInit } from '@angular/core';
+import { ModalController, IonInput, IonItem, IonLabel, IonButton, IonCard, IonCardHeader, IonCardTitle, IonCardSubtitle, IonCardContent } from '@ionic/angular/standalone';
+import { CloudObject } from 'src/lib/ncloud';
+import { FormsModule } from '@angular/forms'; // 导入 FormsModule
+import { CommonModule } from '@angular/common';
+import { UserService } from 'src/app/user.service'; // 假设这是你的用户服务
+
+@Component({
+  selector: 'app-throw-drift-bottle',
+  templateUrl: './throw-drift-bottle.component.html',
+  styleUrls: ['./throw-drift-bottle.component.scss'],
+  standalone: true,
+  imports: [
+    IonCard,
+    IonCardHeader,
+    IonCardTitle,
+    IonCardSubtitle,
+    IonCardContent,
+    IonButton,
+    IonInput,
+    IonItem,
+    IonLabel,
+    FormsModule,
+    CommonModule
+  ],
+})
+export class ThrowDriftBottleComponent implements OnInit {
+  driftbottleData: { content: string, username: any } = { content: '', username: null }; // 漂流瓶内容和用户名
+
+  constructor(
+    private modalCtrl: ModalController,
+    private userService: UserService // 注入用户服务
+  ) {}
+
+  ngOnInit() {
+    const userId = this.userService.getUserId(); // 获取当前用户的 ID
+    if (userId) {
+      this.driftbottleData.username = { __type: 'Pointer', className: '_User', objectId: userId };
+    } else {
+      console.error('用户未登录');
+    }
+  }
+
+  throw() {
+    console.log('投掷漂流瓶:');
+    console.log(`内容: ${this.driftbottleData.content}`);
+    console.log(`用户名:`, this.driftbottleData.username);
+
+    const driftbottleData = {
+      content: this.driftbottleData.content,
+      username: this.driftbottleData.username,
+    };
+
+    let driftbottle = new CloudObject("Driftbottle");
+    driftbottle.set(driftbottleData);
+    driftbottle.save().then(data => {
+      console.log('漂流瓶已成功投掷', data);
+      this.modalCtrl.dismiss(driftbottle, "confirm");
+    }).catch(err => {
+      console.error('投掷漂流瓶时出错', err);
+    });
+  }
+
+  cancel() {
+    this.modalCtrl.dismiss(null, "cancel");
+  }
+}
+
+export async function openThrowDriftBottleModal(modalCtrl: ModalController): Promise<any> {
+  const modal = await modalCtrl.create({
+    component: ThrowDriftBottleComponent,
+    breakpoints: [0.7, 1.0],
+    initialBreakpoint: 0.7
+  });
+  modal.present();
+
+  const { data, role } = await modal.onWillDismiss();
+
+  if (role === 'confirm') {
+    return data;
+  }
+  return null;
+}

+ 85 - 0
.history/soul-app/src/app/throw-drift-bottle/throw-drift-bottle.component_20241227152511.ts

@@ -0,0 +1,85 @@
+import { Component, OnInit } from '@angular/core';
+import { ModalController, IonInput, IonItem, IonLabel, IonButton, IonCard, IonCardHeader, IonCardTitle, IonCardSubtitle, IonCardContent } from '@ionic/angular/standalone';
+import { CloudObject } from 'src/lib/ncloud';
+import { FormsModule } from '@angular/forms'; // 导入 FormsModule
+import { CommonModule } from '@angular/common';
+import { UserService } from 'src/app/user.service'; // 假设这是你的用户服务
+
+@Component({
+  selector: 'app-throw-drift-bottle',
+  templateUrl: './throw-drift-bottle.component.html',
+  styleUrls: ['./throw-drift-bottle.component.scss'],
+  standalone: true,
+  imports: [
+    IonCard,
+    IonCardHeader,
+    IonCardTitle,
+    IonCardSubtitle,
+    IonCardContent,
+    IonButton,
+    IonInput,
+    IonItem,
+    IonLabel,
+    FormsModule,
+    CommonModule
+  ],
+})
+export class ThrowDriftBottleComponent implements OnInit {
+  driftbottleData: { content: string, username: any, status: string } = { content: '', username: null, status: 'drifting' }; // 漂流瓶内容、用户名和状态
+
+  constructor(
+    private modalCtrl: ModalController,
+    private userService: UserService // 注入用户服务
+  ) {}
+
+  ngOnInit() {
+    const userId = this.userService.getUserId(); // 获取当前用户的 ID
+    if (userId) {
+      this.driftbottleData.username = { __type: 'Pointer', className: '_User', objectId: userId };
+    } else {
+      console.error('用户未登录');
+    }
+  }
+
+  throw() {
+    console.log('投掷漂流瓶:');
+    console.log(`内容: ${this.driftbottleData.content}`);
+    console.log(`用户名:`, this.driftbottleData.username);
+    console.log(`状态: ${this.driftbottleData.status}`);
+
+    const driftbottleData = {
+      content: this.driftbottleData.content,
+      username: this.driftbottleData.username,
+      status: this.driftbottleData.status,
+    };
+
+    let driftbottle = new CloudObject("Driftbottle");
+    driftbottle.set(driftbottleData);
+    driftbottle.save().then(data => {
+      console.log('漂流瓶已成功投掷', data);
+      this.modalCtrl.dismiss(driftbottle, "confirm");
+    }).catch(err => {
+      console.error('投掷漂流瓶时出错', err);
+    });
+  }
+
+  cancel() {
+    this.modalCtrl.dismiss(null, "cancel");
+  }
+}
+
+export async function openThrowDriftBottleModal(modalCtrl: ModalController): Promise<any> {
+  const modal = await modalCtrl.create({
+    component: ThrowDriftBottleComponent,
+    breakpoints: [0.7, 1.0],
+    initialBreakpoint: 0.7
+  });
+  modal.present();
+
+  const { data, role } = await modal.onWillDismiss();
+
+  if (role === 'confirm') {
+    return data;
+  }
+  return null;
+}

+ 104 - 0
.history/soul-app/src/app/throw-drift-bottle/throw-drift-bottle.component_20241227152950.ts

@@ -0,0 +1,104 @@
+import { Component, OnInit } from '@angular/core';
+import { ModalController, ToastController, IonInput, IonItem, IonLabel, IonButton, IonCard, IonCardHeader, IonCardTitle, IonCardSubtitle, IonCardContent } from '@ionic/angular/standalone';
+import { CloudObject } from 'src/lib/ncloud';
+import { FormsModule } from '@angular/forms'; // 导入 FormsModule
+import { CommonModule } from '@angular/common';
+import { UserService } from 'src/app/user.service'; // 假设这是你的用户服务
+
+@Component({
+  selector: 'app-throw-drift-bottle',
+  templateUrl: './throw-drift-bottle.component.html',
+  styleUrls: ['./throw-drift-bottle.component.scss'],
+  standalone: true,
+  imports: [
+    IonCard,
+    IonCardHeader,
+    IonCardTitle,
+    IonCardSubtitle,
+    IonCardContent,
+    IonButton,
+    IonInput,
+    IonItem,
+    IonLabel,
+    FormsModule,
+    CommonModule
+  ],
+})
+export class ThrowDriftBottleComponent implements OnInit {
+  driftbottleData: { content: string, username: any, status: string } = { content: '', username: null, status: 'drifting' }; // 漂流瓶内容、用户名和状态
+
+  constructor(
+    private modalCtrl: ModalController,
+    private userService: UserService, // 注入用户服务
+    private toastCtrl: ToastController // 注入 ToastController
+  ) {}
+
+  ngOnInit() {
+    const userId = this.userService.getUserId(); // 获取当前用户的 ID
+    if (userId) {
+      this.driftbottleData.username = { __type: 'Pointer', className: '_User', objectId: userId };
+    } else {
+      console.error('用户未登录');
+    }
+  }
+
+  async throw() {
+    console.log('投掷漂流瓶:');
+    console.log(`内容: ${this.driftbottleData.content}`);
+    console.log(`用户名:`, this.driftbottleData.username);
+    console.log(`状态: ${this.driftbottleData.status}`);
+
+    const driftbottleData = {
+      content: this.driftbottleData.content,
+      username: this.driftbottleData.username,
+      status: this.driftbottleData.status,
+    };
+
+    let driftbottle = new CloudObject("Driftbottle");
+    driftbottle.set(driftbottleData);
+    try {
+      await driftbottle.save();
+      console.log('漂流瓶已成功投掷');
+
+      // 显示成功的 toast 提示
+      const toast = await this.toastCtrl.create({
+        message: '扔出成功!',
+        duration: 2000,
+        position: 'middle'
+      });
+      toast.present();
+
+      this.modalCtrl.dismiss(driftbottle, "confirm");
+    } catch (err) {
+      console.error('投掷漂流瓶时出错', err);
+
+      // 显示错误的 toast 提示
+      const toast = await this.toastCtrl.create({
+        message: '扔出失败,请重试。',
+        duration: 2000,
+        position: 'middle'
+      });
+      toast.present();
+    }
+  }
+
+  cancel() {
+    this.modalCtrl.dismiss(null, "cancel");
+  }
+}
+
+export async function openThrowDriftBottleModal(modalCtrl: ModalController): Promise<any> {
+  const modal = await modalCtrl.create({
+    component: ThrowDriftBottleComponent,
+    breakpoints: [0.7, 1.0],
+    initialBreakpoint: 0.7
+  });
+  modal.present();
+
+  const { data, role } = await modal.onWillDismiss();
+
+  if (role === 'confirm') {
+    return data;
+  }
+  return null;
+}

+ 104 - 0
.history/soul-app/src/app/throw-drift-bottle/throw-drift-bottle.component_20241227174805.ts

@@ -0,0 +1,104 @@
+import { Component, OnInit } from '@angular/core';
+import { ModalController, ToastController, IonInput, IonItem, IonLabel, IonButton, IonCard, IonCardHeader, IonCardTitle, IonCardSubtitle, IonCardContent } from '@ionic/angular/standalone';
+import { CloudObject } from 'src/lib/ncloud';
+import { FormsModule } from '@angular/forms'; // 导入 FormsModule
+import { CommonModule } from '@angular/common';
+import { UserService } from 'src/app/user.service'; // 假设这是你的用户服务
+
+@Component({
+  selector: 'app-throw-drift-bottle',
+  templateUrl: './throw-drift-bottle.component.html',
+  styleUrls: ['./throw-drift-bottle.component.scss'],
+  standalone: true,
+  imports: [
+    IonCard,
+    IonCardHeader,
+    IonCardTitle,
+    IonCardSubtitle,
+    IonCardContent,
+    IonButton,
+    IonInput,
+    IonItem,
+    IonLabel,
+    FormsModule,
+    CommonModule
+  ],
+})
+export class ThrowDriftBottleComponent implements OnInit {
+  driftbottleData: { content: string, username: any, status: string } = { content: '', username: null, status: 'drifting' }; // 漂流瓶内容、用户名和状态
+
+  constructor(
+    private modalCtrl: ModalController,
+    private userService: UserService, // 注入用户服务
+    private toastCtrl: ToastController // 注入 ToastController
+  ) {}
+
+  ngOnInit() {
+    const userId = this.userService.getUserId(); // 获取当前用户的 ID
+    if (userId) {
+      this.driftbottleData.username = { __type: 'Pointer', className: '_User', objectId: userId };
+    } else {
+      console.error('用户未登录');
+    }
+  }
+
+  async throw() {
+    console.log('投掷漂流瓶:');
+    console.log(`内容: ${this.driftbottleData.content}`);
+    console.log(`用户名: ${this.driftbottleData.username}`);
+    console.log(`状态: ${this.driftbottleData.status}`);
+
+    const driftbottleData = {
+      content: this.driftbottleData.content,
+      username: this.driftbottleData.username,
+      status: this.driftbottleData.status,
+    };
+
+    let driftbottle = new CloudObject("Driftbottle");
+    driftbottle.set(driftbottleData);
+    try {
+      await driftbottle.save();
+      console.log('漂流瓶已成功投掷');
+
+      // 显示成功的 toast 提示
+      const toast = await this.toastCtrl.create({
+        message: '扔出成功!',
+        duration: 2000,
+        position: 'middle'
+      });
+      toast.present();
+
+      this.modalCtrl.dismiss(driftbottle, "confirm");
+    } catch (err) {
+      console.error('投掷漂流瓶时出错', err);
+
+      // 显示错误的 toast 提示
+      const toast = await this.toastCtrl.create({
+        message: '扔出失败,请重试。',
+        duration: 2000,
+        position: 'middle'
+      });
+      toast.present();
+    }
+  }
+
+  cancel() {
+    this.modalCtrl.dismiss(null, "cancel");
+  }
+}
+
+export async function openThrowDriftBottleModal(modalCtrl: ModalController): Promise<any> {
+  const modal = await modalCtrl.create({
+    component: ThrowDriftBottleComponent,
+    breakpoints: [0.7, 1.0],
+    initialBreakpoint: 0.7
+  });
+  modal.present();
+
+  const { data, role } = await modal.onWillDismiss();
+
+  if (role === 'confirm') {
+    return data;
+  }
+  return null;
+}

+ 104 - 0
.history/soul-app/src/app/throw-drift-bottle/throw-drift-bottle.component_20241227174914.ts

@@ -0,0 +1,104 @@
+import { Component, OnInit } from '@angular/core';
+import { ModalController, ToastController, IonInput, IonItem, IonLabel, IonButton, IonCard, IonCardHeader, IonCardTitle, IonCardSubtitle, IonCardContent } from '@ionic/angular/standalone';
+import { CloudObject } from 'src/lib/ncloud';
+import { FormsModule } from '@angular/forms'; // 导入 FormsModule
+import { CommonModule } from '@angular/common';
+import { UserService } from 'src/app/user.service'; // 假设这是你的用户服务
+
+@Component({
+  selector: 'app-throw-drift-bottle',
+  templateUrl: './throw-drift-bottle.component.html',
+  styleUrls: ['./throw-drift-bottle.component.scss'],
+  standalone: true,
+  imports: [
+    IonCard,
+    IonCardHeader,
+    IonCardTitle,
+    IonCardSubtitle,
+    IonCardContent,
+    IonButton,
+    IonInput,
+    IonItem,
+    IonLabel,
+    FormsModule,
+    CommonModule
+  ],
+})
+export class ThrowDriftBottleComponent implements OnInit {
+  driftbottleData: { content: string, username: any, status: string } = { content: '', username: '', status: 'drifting' }; // 漂流瓶内容、用户名和状态
+
+  constructor(
+    private modalCtrl: ModalController,
+    private userService: UserService, // 注入用户服务
+    private toastCtrl: ToastController // 注入 ToastController
+  ) {}
+
+  ngOnInit() {
+    const userId = this.userService.getUserId(); // 获取当前用户的 ID
+    if (userId) {
+      this.driftbottleData.username = { __type: 'Pointer', className: '_User', objectId: userId };
+    } else {
+      console.error('用户未登录');
+    }
+  }
+
+  async throw() {
+    console.log('投掷漂流瓶:');
+    console.log(`内容: ${this.driftbottleData.content}`);
+    console.log(`用户名: ${this.driftbottleData.username}`);
+    console.log(`状态: ${this.driftbottleData.status}`);
+
+    const driftbottleData = {
+      content: this.driftbottleData.content,
+      username: this.driftbottleData.username,
+      status: this.driftbottleData.status,
+    };
+
+    let driftbottle = new CloudObject("Driftbottle");
+    driftbottle.set(driftbottleData);
+    try {
+      await driftbottle.save();
+      console.log('漂流瓶已成功投掷');
+
+      // 显示成功的 toast 提示
+      const toast = await this.toastCtrl.create({
+        message: '扔出成功!',
+        duration: 2000,
+        position: 'middle'
+      });
+      toast.present();
+
+      this.modalCtrl.dismiss(driftbottle, "confirm");
+    } catch (err) {
+      console.error('投掷漂流瓶时出错', err);
+
+      // 显示错误的 toast 提示
+      const toast = await this.toastCtrl.create({
+        message: '扔出失败,请重试。',
+        duration: 2000,
+        position: 'middle'
+      });
+      toast.present();
+    }
+  }
+
+  cancel() {
+    this.modalCtrl.dismiss(null, "cancel");
+  }
+}
+
+export async function openThrowDriftBottleModal(modalCtrl: ModalController): Promise<any> {
+  const modal = await modalCtrl.create({
+    component: ThrowDriftBottleComponent,
+    breakpoints: [0.7, 1.0],
+    initialBreakpoint: 0.7
+  });
+  modal.present();
+
+  const { data, role } = await modal.onWillDismiss();
+
+  if (role === 'confirm') {
+    return data;
+  }
+  return null;
+}

+ 100 - 0
.history/soul-app/src/app/throw-drift-bottle/throw-drift-bottle.component_20241227175055.ts

@@ -0,0 +1,100 @@
+import { Component, OnInit } from '@angular/core';
+import { ModalController, ToastController, IonInput, IonItem, IonLabel, IonButton, IonCard, IonCardHeader, IonCardTitle, IonCardSubtitle, IonCardContent } from '@ionic/angular/standalone';
+import { CloudObject } from 'src/lib/ncloud';
+import { FormsModule } from '@angular/forms'; // 导入 FormsModule
+import { CommonModule } from '@angular/common';
+import { UserService } from 'src/app/user.service'; // 假设这是你的用户服务
+
+@Component({
+  selector: 'app-throw-drift-bottle',
+  templateUrl: './throw-drift-bottle.component.html',
+  styleUrls: ['./throw-drift-bottle.component.scss'],
+  standalone: true,
+  imports: [
+    IonCard,
+    IonCardHeader,
+    IonCardTitle,
+    IonCardSubtitle,
+    IonCardContent,
+    IonButton,
+    IonInput,
+    IonItem,
+    IonLabel,
+    FormsModule,
+    CommonModule
+  ],
+})
+export class ThrowDriftBottleComponent implements OnInit {
+  driftbottleData: { content: string, username: String, status: string } = { content: '', username: '', status: 'drifting' }; // 漂流瓶内容、用户名和状态
+
+  constructor(
+    private modalCtrl: ModalController,
+    private userService: UserService, // 注入用户服务
+    private toastCtrl: ToastController // 注入 ToastController
+  ) {}
+
+  ngOnInit() {
+    const userId = this.userService.getUserId(); // 获取当前用户的 ID
+    
+  }
+
+  async throw() {
+    console.log('投掷漂流瓶:');
+    console.log(`内容: ${this.driftbottleData.content}`);
+    console.log(`用户名: ${this.driftbottleData.username}`);
+    console.log(`状态: ${this.driftbottleData.status}`);
+
+    const driftbottleData = {
+      content: this.driftbottleData.content,
+      username: this.driftbottleData.username,
+      status: this.driftbottleData.status,
+    };
+
+    let driftbottle = new CloudObject("Driftbottle");
+    driftbottle.set(driftbottleData);
+    try {
+      await driftbottle.save();
+      console.log('漂流瓶已成功投掷');
+
+      // 显示成功的 toast 提示
+      const toast = await this.toastCtrl.create({
+        message: '扔出成功!',
+        duration: 2000,
+        position: 'middle'
+      });
+      toast.present();
+
+      this.modalCtrl.dismiss(driftbottle, "confirm");
+    } catch (err) {
+      console.error('投掷漂流瓶时出错', err);
+
+      // 显示错误的 toast 提示
+      const toast = await this.toastCtrl.create({
+        message: '扔出失败,请重试。',
+        duration: 2000,
+        position: 'middle'
+      });
+      toast.present();
+    }
+  }
+
+  cancel() {
+    this.modalCtrl.dismiss(null, "cancel");
+  }
+}
+
+export async function openThrowDriftBottleModal(modalCtrl: ModalController): Promise<any> {
+  const modal = await modalCtrl.create({
+    component: ThrowDriftBottleComponent,
+    breakpoints: [0.7, 1.0],
+    initialBreakpoint: 0.7
+  });
+  modal.present();
+
+  const { data, role } = await modal.onWillDismiss();
+
+  if (role === 'confirm') {
+    return data;
+  }
+  return null;
+}

+ 104 - 0
.history/soul-app/src/app/throw-drift-bottle/throw-drift-bottle.component_20241227175708.ts

@@ -0,0 +1,104 @@
+import { Component, OnInit } from '@angular/core';
+import { ModalController, ToastController, IonInput, IonItem, IonLabel, IonButton, IonCard, IonCardHeader, IonCardTitle, IonCardSubtitle, IonCardContent } from '@ionic/angular/standalone';
+import { CloudObject } from 'src/lib/ncloud';
+import { FormsModule } from '@angular/forms'; // 导入 FormsModule
+import { CommonModule } from '@angular/common';
+import { UserService } from 'src/app/user.service'; // 假设这是你的用户服务
+
+@Component({
+  selector: 'app-throw-drift-bottle',
+  templateUrl: './throw-drift-bottle.component.html',
+  styleUrls: ['./throw-drift-bottle.component.scss'],
+  standalone: true,
+  imports: [
+    IonCard,
+    IonCardHeader,
+    IonCardTitle,
+    IonCardSubtitle,
+    IonCardContent,
+    IonButton,
+    IonInput,
+    IonItem,
+    IonLabel,
+    FormsModule,
+    CommonModule
+  ],
+})
+export class ThrowDriftBottleComponent implements OnInit {
+  driftbottleData: { content: string, username: string, status: string } = { content: '', username: '', status: 'drifting' }; // 漂流瓶内容、用户名和状态
+
+  constructor(
+    private modalCtrl: ModalController,
+    private userService: UserService, // 注入用户服务
+    private toastCtrl: ToastController // 注入 ToastController
+  ) {}
+
+  ngOnInit() {
+    const username = this.userService.getUsername(); // 获取当前用户的用户名
+    if (username) {
+      this.driftbottleData.username = username;
+    } else {
+      console.error('用户未登录或未找到用户名');
+    }
+  }
+
+  async throw() {
+    console.log('投掷漂流瓶:');
+    console.log(`内容: ${this.driftbottleData.content}`);
+    console.log(`用户名: ${this.driftbottleData.username}`);
+    console.log(`状态: ${this.driftbottleData.status}`);
+
+    const driftbottleData = {
+      content: this.driftbottleData.content,
+      username: this.driftbottleData.username,
+      status: this.driftbottleData.status,
+    };
+
+    let driftbottle = new CloudObject("Driftbottle");
+    driftbottle.set(driftbottleData);
+    try {
+      await driftbottle.save();
+      console.log('漂流瓶已成功投掷');
+
+      // 显示成功的 toast 提示
+      const toast = await this.toastCtrl.create({
+        message: '扔出成功!',
+        duration: 2000,
+        position: 'middle'
+      });
+      toast.present();
+
+      this.modalCtrl.dismiss(driftbottle, "confirm");
+    } catch (err) {
+      console.error('投掷漂流瓶时出错', err);
+
+      // 显示错误的 toast 提示
+      const toast = await this.toastCtrl.create({
+        message: '扔出失败,请重试。',
+        duration: 2000,
+        position: 'middle'
+      });
+      toast.present();
+    }
+  }
+
+  cancel() {
+    this.modalCtrl.dismiss(null, "cancel");
+  }
+}
+
+export async function openThrowDriftBottleModal(modalCtrl: ModalController): Promise<any> {
+  const modal = await modalCtrl.create({
+    component: ThrowDriftBottleComponent,
+    breakpoints: [0.7, 1.0],
+    initialBreakpoint: 0.7
+  });
+  modal.present();
+
+  const { data, role } = await modal.onWillDismiss();
+
+  if (role === 'confirm') {
+    return data;
+  }
+  return null;
+}

+ 114 - 0
.history/soul-app/src/app/throw-drift-bottle/throw-drift-bottle.component_20241227180703.ts

@@ -0,0 +1,114 @@
+import { Component, OnInit } from '@angular/core';
+import { ModalController, ToastController, IonInput, IonItem, IonLabel, IonButton, IonCard, IonCardHeader, IonCardTitle, IonCardSubtitle, IonCardContent } from '@ionic/angular/standalone';
+import { CloudObject } from 'src/lib/ncloud';
+import { FormsModule } from '@angular/forms'; // 导入 FormsModule
+import { CommonModule } from '@angular/common';
+import { UserService } from 'src/app/user.service'; // 假设这是你的用户服务
+
+@Component({
+  selector: 'app-throw-drift-bottle',
+  templateUrl: './throw-drift-bottle.component.html',
+  styleUrls: ['./throw-drift-bottle.component.scss'],
+  standalone: true,
+  imports: [
+    IonCard,
+    IonCardHeader,
+    IonCardTitle,
+    IonCardSubtitle,
+    IonCardContent,
+    IonButton,
+    IonInput,
+    IonItem,
+    IonLabel,
+    FormsModule,
+    CommonModule
+  ],
+})
+export class ThrowDriftBottleComponent implements OnInit {
+  driftbottleData: { content: string, username: string, status: string, throwtime: Date } = { 
+    content: '', 
+    username: '', 
+    status: 'drifting', 
+    throwtime: new Date() // 初始化为当前时间
+  }; // 漂流瓶内容、用户名、状态和投掷时间
+
+  constructor(
+    private modalCtrl: ModalController,
+    private userService: UserService, // 注入用户服务
+    private toastCtrl: ToastController // 注入 ToastController
+  ) {}
+
+  ngOnInit() {
+    const username = this.userService.getUsername(); // 获取当前用户的用户名
+    if (username) {
+      this.driftbottleData.username = username;
+    } else {
+      console.error('用户未登录或未找到用户名');
+    }
+  }
+
+  async throw() {
+    // 更新投掷时间为当前时间
+    this.driftbottleData.throwtime = new Date();
+
+    console.log('投掷漂流瓶:');
+    console.log(`内容: ${this.driftbottleData.content}`);
+    console.log(`用户名: ${this.driftbottleData.username}`);
+    console.log(`状态: ${this.driftbottleData.status}`);
+    console.log(`投掷时间: ${this.driftbottleData.throwtime}`);
+
+    const driftbottleData = {
+      content: this.driftbottleData.content,
+      username: this.driftbottleData.username,
+      status: this.driftbottleData.status,
+      throwtime: this.driftbottleData.throwtime.toISOString(), // 存储为 ISO 格式字符串
+    };
+
+    let driftbottle = new CloudObject("Driftbottle");
+    driftbottle.set(driftbottleData);
+    try {
+      await driftbottle.save();
+      console.log('漂流瓶已成功投掷');
+
+      // 显示成功的 toast 提示
+      const toast = await this.toastCtrl.create({
+        message: '扔出成功!',
+        duration: 2000,
+        position: 'middle'
+      });
+      toast.present();
+
+      this.modalCtrl.dismiss(driftbottle, "confirm");
+    } catch (err) {
+      console.error('投掷漂流瓶时出错', err);
+
+      // 显示错误的 toast 提示
+      const toast = await this.toastCtrl.create({
+        message: '扔出失败,请重试。',
+        duration: 2000,
+        position: 'middle'
+      });
+      toast.present();
+    }
+  }
+
+  cancel() {
+    this.modalCtrl.dismiss(null, "cancel");
+  }
+}
+
+export async function openThrowDriftBottleModal(modalCtrl: ModalController): Promise<any> {
+  const modal = await modalCtrl.create({
+    component: ThrowDriftBottleComponent,
+    breakpoints: [0.7, 1.0],
+    initialBreakpoint: 0.7
+  });
+  modal.present();
+
+  const { data, role } = await modal.onWillDismiss();
+
+  if (role === 'confirm') {
+    return data;
+  }
+  return null;
+}

+ 114 - 0
.history/soul-app/src/app/throw-drift-bottle/throw-drift-bottle.component_20241227181007.ts

@@ -0,0 +1,114 @@
+import { Component, OnInit } from '@angular/core';
+import { ModalController, ToastController, IonInput, IonItem, IonLabel, IonButton, IonCard, IonCardHeader, IonCardTitle, IonCardSubtitle, IonCardContent } from '@ionic/angular/standalone';
+import { CloudObject } from 'src/lib/ncloud';
+import { FormsModule } from '@angular/forms'; // 导入 FormsModule
+import { CommonModule } from '@angular/common';
+import { UserService } from 'src/app/user.service'; // 假设这是你的用户服务
+
+@Component({
+  selector: 'app-throw-drift-bottle',
+  templateUrl: './throw-drift-bottle.component.html',
+  styleUrls: ['./throw-drift-bottle.component.scss'],
+  standalone: true,
+  imports: [
+    IonCard,
+    IonCardHeader,
+    IonCardTitle,
+    IonCardSubtitle,
+    IonCardContent,
+    IonButton,
+    IonInput,
+    IonItem,
+    IonLabel,
+    FormsModule,
+    CommonModule
+  ],
+})
+export class ThrowDriftBottleComponent implements OnInit {
+  driftbottleData: { content: string, username: string, status: string, throwtime: Date } = { 
+    content: '', 
+    username: '', 
+    status: 'drifting', 
+    throwtime: new Date() // 初始化为当前时间
+  }; // 漂流瓶内容、用户名、状态和投掷时间
+
+  constructor(
+    private modalCtrl: ModalController,
+    private userService: UserService, // 注入用户服务
+    private toastCtrl: ToastController // 注入 ToastController
+  ) {}
+
+  ngOnInit() {
+    const username = this.userService.getUsername(); // 获取当前用户的用户名
+    if (username) {
+      this.driftbottleData.username = username;
+    } else {
+      console.error('用户未登录或未找到用户名');
+    }
+  }
+
+  async throw() {
+    // 更新投掷时间为当前时间
+    this.driftbottleData.throwtime = new Date();
+
+    console.log('投掷漂流瓶:');
+    console.log(`内容: ${this.driftbottleData.content}`);
+    console.log(`用户名: ${this.driftbottleData.username}`);
+    console.log(`状态: ${this.driftbottleData.status}`);
+    console.log(`投掷时间: ${this.driftbottleData.throwtime}`);
+
+    const driftbottleData = {
+      content: this.driftbottleData.content,
+      username: this.driftbottleData.username,
+      status: this.driftbottleData.status,
+      throwtime: this.driftbottleData.throwtime, // 直接使用 Date 对象
+    };
+
+    let driftbottle = new CloudObject("Driftbottle");
+    driftbottle.set(driftbottleData);
+    try {
+      await driftbottle.save();
+      console.log('漂流瓶已成功投掷');
+
+      // 显示成功的 toast 提示
+      const toast = await this.toastCtrl.create({
+        message: '扔出成功!',
+        duration: 2000,
+        position: 'middle'
+      });
+      toast.present();
+
+      this.modalCtrl.dismiss(driftbottle, "confirm");
+    } catch (err) {
+      console.error('投掷漂流瓶时出错', err);
+
+      // 显示错误的 toast 提示
+      const toast = await this.toastCtrl.create({
+        message: '扔出失败,请重试。',
+        duration: 2000,
+        position: 'middle'
+      });
+      toast.present();
+    }
+  }
+
+  cancel() {
+    this.modalCtrl.dismiss(null, "cancel");
+  }
+}
+
+export async function openThrowDriftBottleModal(modalCtrl: ModalController): Promise<any> {
+  const modal = await modalCtrl.create({
+    component: ThrowDriftBottleComponent,
+    breakpoints: [0.7, 1.0],
+    initialBreakpoint: 0.7
+  });
+  modal.present();
+
+  const { data, role } = await modal.onWillDismiss();
+
+  if (role === 'confirm') {
+    return data;
+  }
+  return null;
+}

+ 114 - 0
.history/soul-app/src/app/throw-drift-bottle/throw-drift-bottle.component_20241227181100.ts

@@ -0,0 +1,114 @@
+import { Component, OnInit } from '@angular/core';
+import { ModalController, ToastController, IonInput, IonItem, IonLabel, IonButton, IonCard, IonCardHeader, IonCardTitle, IonCardSubtitle, IonCardContent } from '@ionic/angular/standalone';
+import { CloudObject } from 'src/lib/ncloud';
+import { FormsModule } from '@angular/forms'; // 导入 FormsModule
+import { CommonModule } from '@angular/common';
+import { UserService } from 'src/app/user.service'; // 假设这是你的用户服务
+
+@Component({
+  selector: 'app-throw-drift-bottle',
+  templateUrl: './throw-drift-bottle.component.html',
+  styleUrls: ['./throw-drift-bottle.component.scss'],
+  standalone: true,
+  imports: [
+    IonCard,
+    IonCardHeader,
+    IonCardTitle,
+    IonCardSubtitle,
+    IonCardContent,
+    IonButton,
+    IonInput,
+    IonItem,
+    IonLabel,
+    FormsModule,
+    CommonModule
+  ],
+})
+export class ThrowDriftBottleComponent implements OnInit {
+  driftbottleData: { content: string, username: string, status: string, throwtime: Date } = { 
+    content: '', 
+    username: '', 
+    status: 'drifting', 
+    throwtime: new Date() // 初始化为当前时间
+  }; // 漂流瓶内容、用户名、状态和投掷时间
+
+  constructor(
+    private modalCtrl: ModalController,
+    private userService: UserService, // 注入用户服务
+    private toastCtrl: ToastController // 注入 ToastController
+  ) {}
+
+  ngOnInit() {
+    const username = this.userService.getUsername(); // 获取当前用户的用户名
+    if (username) {
+      this.driftbottleData.username = username;
+    } else {
+      console.error('用户未登录或未找到用户名');
+    }
+  }
+
+  async throw() {
+    // 更新投掷时间为当前时间
+    this.driftbottleData.throwtime = new Date();
+
+    console.log('投掷漂流瓶:');
+    console.log(`内容: ${this.driftbottleData.content}`);
+    console.log(`用户名: ${this.driftbottleData.username}`);
+    console.log(`状态: ${this.driftbottleData.status}`);
+    console.log(`投掷时间: ${this.driftbottleData.throwtime}`);
+
+    const driftbottleData = {
+      content: this.driftbottleData.content,
+      username: this.driftbottleData.username,
+      status: this.driftbottleData.status,
+      throwtime: this.driftbottleData.throwtime.toISOString(), // 存储为 ISO 格式字符串
+    };
+
+    let driftbottle = new CloudObject("Driftbottle");
+    driftbottle.set(driftbottleData);
+    try {
+      await driftbottle.save();
+      console.log('漂流瓶已成功投掷');
+
+      // 显示成功的 toast 提示
+      const toast = await this.toastCtrl.create({
+        message: '扔出成功!',
+        duration: 2000,
+        position: 'middle'
+      });
+      toast.present();
+
+      this.modalCtrl.dismiss(driftbottle, "confirm");
+    } catch (err) {
+      console.error('投掷漂流瓶时出错', err);
+
+      // 显示错误的 toast 提示
+      const toast = await this.toastCtrl.create({
+        message: '扔出失败,请重试。',
+        duration: 2000,
+        position: 'middle'
+      });
+      toast.present();
+    }
+  }
+
+  cancel() {
+    this.modalCtrl.dismiss(null, "cancel");
+  }
+}
+
+export async function openThrowDriftBottleModal(modalCtrl: ModalController): Promise<any> {
+  const modal = await modalCtrl.create({
+    component: ThrowDriftBottleComponent,
+    breakpoints: [0.7, 1.0],
+    initialBreakpoint: 0.7
+  });
+  modal.present();
+
+  const { data, role } = await modal.onWillDismiss();
+
+  if (role === 'confirm') {
+    return data;
+  }
+  return null;
+}

+ 29 - 0
.history/soul-app/src/app/user.service_20241227151832.ts

@@ -0,0 +1,29 @@
+import { Injectable } from '@angular/core';
+import { CloudUser } from 'src/lib/ncloud';
+
+@Injectable({
+  providedIn: 'root'
+})
+export class UserService {
+
+  constructor() {}
+
+  // 获取当前用户信息
+  getCurrentUser(): CloudUser | null {
+    let user = new CloudUser();
+    if (!user.sessionToken) {
+      console.error("用户未登录");
+      return null;
+    }
+    return user;
+  }
+
+  // 获取当前用户的用户名
+  getUsername(): string {
+    const user = this.getCurrentUser();
+    if (user && user.data) {
+      return user.data['username'] || ''; // 使用方括号访问 username 字段
+    }
+    return '';
+  }
+}

+ 38 - 0
.history/soul-app/src/app/user.service_20241227152120.ts

@@ -0,0 +1,38 @@
+import { Injectable } from '@angular/core';
+import { CloudUser } from 'src/lib/ncloud';
+
+@Injectable({
+  providedIn: 'root'
+})
+export class UserService {
+
+  constructor() {}
+
+  // 获取当前用户信息
+  getCurrentUser(): CloudUser | null {
+    let user = new CloudUser();
+    if (!user.sessionToken) {
+      console.error("用户未登录");
+      return null;
+    }
+    return user;
+  }
+
+  // 获取当前用户的用户名
+  getUsername(): string {
+    const user = this.getCurrentUser();
+    if (user && user.data) {
+      return user.data['username'] || ''; // 使用方括号访问 username 字段
+    }
+    return '';
+  }
+
+  // 获取当前用户的 ID
+  getUserId(): string | null {
+    const user = this.getCurrentUser();
+    if (user) {
+      return user.id || null;
+    }
+    return null;
+  }
+}

+ 5 - 1
soul-app/src/app/app.component.ts

@@ -1,14 +1,18 @@
 import { Component } from '@angular/core';
 import { IonApp, IonRouterOutlet } from '@ionic/angular/standalone';
-import { RouterModule, Routes,provideRouter } from '@angular/router';
+import { RouterModule, Routes} from '@angular/router';
 import { PagePsysurveyComponent } from './page-psysurvey/page-psysurvey.component'; // 替换为你的实际路径
 import { PagePublishsurveyComponent } from './page-publishsurvey/page-publishsurvey.component'; // 替换为你的实际路径
+import { MyDriftBottleComponent } from './my-drift-bottle/my-drift-bottle.component';
+import { ThrowDriftBottleComponent } from './throw-drift-bottle/throw-drift-bottle.component';
 
 
 const routes: Routes = [
   { path: '', redirectTo: 'tabs/tab1', pathMatch: 'full' },
   { path: 'tabs/tab1', component: PagePsysurveyComponent },
   { path: 'tabs/publishsurvey', component: PagePublishsurveyComponent },
+  { path:'tabs/throw-drift-bottle',component:ThrowDriftBottleComponent},
+  { path:'tabs/my-drift-bottle',component:MyDriftBottleComponent}
   // 添加其他路由
 ];
 

+ 14 - 9
soul-app/src/app/app.routes.ts

@@ -1,24 +1,29 @@
 import { Routes } from '@angular/router';
 
 export const routes: Routes = [
-    {
+  {
     path: '',
     loadChildren: () => import('./tabs/tabs.routes').then((m) => m.routes),
-    },
-    // 聊天模块
-   {
+  },
+  // 聊天模块
+  {
     path: "chat/session/role/:roleId",
     loadComponent: () => import('./test-chat-panel/test-chat-panel.component').then(m => m.TestChatPanelComponent),
     runGuardsAndResolvers: "always",
-},
-{
+  },
+  {
     path: "chat/session/chat/:chatId",
     loadComponent: () => import('./test-chat-panel/test-chat-panel.component').then(m => m.TestChatPanelComponent),
     runGuardsAndResolvers: "always",
-},
-{
+  },
+  {
     path: 'chat/pro/chat/:chatId',
     redirectTo: '/chat/session/chat/:chatId',
     pathMatch: 'full'
   },
-];
+  // 添加我的漂流瓶路由
+  {
+    path: 'tabs/my-drift-bottle',
+    loadComponent: () => import('./my-drift-bottle/my-drift-bottle.component').then(m => m.MyDriftBottleComponent)
+  },
+];

+ 0 - 3
soul-app/src/app/catch-drift-bottle/catch-drift-bottle.component.html

@@ -1,3 +0,0 @@
-<p>
-  catch-drift-bottle works!
-</p>

+ 0 - 0
soul-app/src/app/catch-drift-bottle/catch-drift-bottle.component.scss


+ 0 - 22
soul-app/src/app/catch-drift-bottle/catch-drift-bottle.component.spec.ts

@@ -1,22 +0,0 @@
-import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
-
-import { CatchDriftBottleComponent } from './catch-drift-bottle.component';
-
-describe('CatchDriftBottleComponent', () => {
-  let component: CatchDriftBottleComponent;
-  let fixture: ComponentFixture<CatchDriftBottleComponent>;
-
-  beforeEach(waitForAsync(() => {
-    TestBed.configureTestingModule({
-      imports: [CatchDriftBottleComponent],
-    }).compileComponents();
-
-    fixture = TestBed.createComponent(CatchDriftBottleComponent);
-    component = fixture.componentInstance;
-    fixture.detectChanges();
-  }));
-
-  it('should create', () => {
-    expect(component).toBeTruthy();
-  });
-});

+ 0 - 15
soul-app/src/app/catch-drift-bottle/catch-drift-bottle.component.ts

@@ -1,15 +0,0 @@
-import { Component, OnInit } from '@angular/core';
-
-@Component({
-  selector: 'app-catch-drift-bottle',
-  templateUrl: './catch-drift-bottle.component.html',
-  styleUrls: ['./catch-drift-bottle.component.scss'],
-  standalone: true,
-})
-export class CatchDriftBottleComponent  implements OnInit {
-
-  constructor() { }
-
-  ngOnInit() {}
-
-}

+ 2 - 3
soul-app/src/app/drift-bottle/drift-bottle.component.html

@@ -1,4 +1,3 @@
-<!-- drift-bottle.component.html -->
 <ion-content [fullscreen]="true">
   <div class="top-image">
     <img src="/assets/img/漂流瓶.jpg" alt="漂流瓶">
@@ -16,12 +15,12 @@
   </div>
 
   <!-- 右边的按钮 -->
-  <div class="button-container right-button"  (click)="catchDriftBottle()">
+  <div class="button-container right-button" (click)="catchDriftBottle()">
     <img src="/assets/img/捞一个.png" alt="捞漂流瓶" class="circular-button">
   </div>
 
   <!-- 背景音乐 -->
-  <audio id="backgroundAudio" autoplay loop>
+  <audio id="backgroundAudio" loop>
     <source src="/assets/audio/海浪.mp3" type="audio/mpeg">
     Your browser does not support the audio element.
   </audio>

+ 47 - 9
soul-app/src/app/drift-bottle/drift-bottle.component.ts

@@ -1,11 +1,11 @@
-// drift-bottle.component.ts
-import { Component, OnInit } from '@angular/core';
+import { Component, OnInit, OnDestroy, Renderer2, ElementRef, ViewChild } from '@angular/core';
 import { Router } from '@angular/router';
 import { IonicModule } from '@ionic/angular';
 import { openThrowDriftBottleModal } from '../throw-drift-bottle/throw-drift-bottle.component';
 import { ModalController } from '@ionic/angular/standalone';
 import { HttpClient } from '@angular/common/http';
 import { CloudObject, CloudQuery } from 'src/lib/ncloud';
+import { UserService } from 'src/app/user.service'; // 假设这是你的用户服务
 
 @Component({
   selector: 'app-drift-bottle',
@@ -17,17 +17,43 @@ import { CloudObject, CloudQuery } from 'src/lib/ncloud';
     // 其他导入项...
   ]
 })
-export class DriftBottleComponent implements OnInit {
+export class DriftBottleComponent implements OnInit, OnDestroy {
   alertHeader: string = '';
   alertMessage: string = '';
 
+  @ViewChild('backgroundAudio', { static: false }) audioElement!: ElementRef<HTMLAudioElement>;
+
   constructor(
     private router: Router,
     private modalCtrl: ModalController,
-    private http: HttpClient
+    private http: HttpClient,
+    private renderer: Renderer2,
+    private userService: UserService // 注入用户服务
   ) {}
 
-  ngOnInit() {}
+  ngOnInit() {
+    if (this.audioElement && this.audioElement.nativeElement) {
+      const audio = this.audioElement.nativeElement;
+      audio.loop = true;
+      audio.play().catch(error => {
+        console.error('Failed to play audio:', error);
+      });
+    } else {
+      console.warn('Audio element not found');
+    }
+  }
+
+  ngOnDestroy() {
+    if (this.audioElement && this.audioElement.nativeElement) {
+      const audio = this.audioElement.nativeElement;
+      audio.pause();
+      audio.currentTime = 0; // 重置音频时间
+      console.log('Audio element paused and reset');
+    } else {
+      console.warn('Audio element not found during destroy');
+    }
+    console.log('ngOnDestroy called');
+  }
 
   throwDriftBottleModal() {
     openThrowDriftBottleModal(this.modalCtrl);
@@ -40,17 +66,28 @@ export class DriftBottleComponent implements OnInit {
     query.find().then((driftingBottles: any[]) => {
       if (driftingBottles.length === 0) {
         this.alertHeader = '失败';
-        this.alertMessage = '没捞…';
+        this.alertMessage = '没捞…';
         return;
       }
 
       const randomIndex = Math.floor(Math.random() * driftingBottles.length);
       const bottleToCatch = driftingBottles[randomIndex];
 
-      bottleToCatch.set("status", "catched");
+      const username = this.userService.getUsername(); // 获取当前用户的用户名
+      if (!username) {
+        console.error('用户未登录或未找到用户名');
+        this.alertHeader = '错误';
+        this.alertMessage = '用户未登录,请先登录。';
+        return;
+      }
+
+      bottleToCatch.set("status", "caught");
+      bottleToCatch.set("catcher", username); // 设置打捞者
+      bottleToCatch.set("catchTime", new Date()); // 设置打捞时间
+
       bottleToCatch.save().then(() => {
         this.alertHeader = '成功';
-        this.alertMessage = '捞到啦!';
+        this.alertMessage = '捞到啦!快去看看吧!';
       }).catch((err: any) => {
         console.error('更新漂流瓶状态时出错:', err);
         this.alertHeader = '错误';
@@ -67,7 +104,8 @@ export class DriftBottleComponent implements OnInit {
     this.alertHeader = '';
     this.alertMessage = '';
   }
+
   goMydriftbottle() {
-    this.router.navigate(['tabs/my-drift-bottle'])
+    this.router.navigate(['tabs/my-drift-bottle']);
   }
 }

+ 45 - 1
soul-app/src/app/my-drift-bottle/my-drift-bottle.component.html

@@ -11,4 +11,48 @@
       </ion-title>
     </div>
   </ion-toolbar>
-</ion-header>
+</ion-header>
+
+<ion-content>
+  <ion-list>
+    <ion-item>
+      <ion-label>
+        <h2>我扔出的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <section *ngIf="filteredDriftbottles.length > 0">
+      <ion-card *ngFor="let bottle of filteredDriftbottles">
+        <ion-card-header>
+          <ion-card-title>{{ bottle.get('content') }}</ion-card-title>
+        </ion-card-header>
+        <ion-card-content>
+          <p>扔出时间: {{ bottle.get('throwtime') }}</p>
+        </ion-card-content>
+      </ion-card>
+    </section>
+
+    <ion-item>
+      <ion-label>
+        <h2>我捞上的漂流瓶</h2>
+      </ion-label>
+    </ion-item>
+    
+    <section *ngIf="filteredDriftbottles2.length > 0">
+      <ion-card *ngFor="let bottle of filteredDriftbottles2">
+        <ion-card-header>
+          <ion-card-title>{{ bottle.get('content') }}</ion-card-title>
+        </ion-card-header>
+        <ion-card-content>
+          <p>打捞时间: {{ bottle.get('catchtime') }}</p>
+        </ion-card-content>
+      </ion-card>
+    </section>
+  </ion-list>
+
+  <div style="display: flex; justify-content: center; margin-top: auto;">
+    <ion-button (click)="throwNewDriftbottle()" expand="full">
+      投掷新的漂流瓶
+    </ion-button>
+  </div>
+</ion-content>

+ 1 - 0
soul-app/src/app/my-drift-bottle/my-drift-bottle.component.scss

@@ -51,4 +51,5 @@ ion-content {
   top: 10px;
   color:rgb(69, 166, 180);
   }
+
   

+ 60 - 16
soul-app/src/app/my-drift-bottle/my-drift-bottle.component.ts

@@ -1,27 +1,71 @@
 import { Component, OnInit } from '@angular/core';
-import { IonHeader,IonButton, IonContent, IonIcon, IonItem, IonLabel, IonList, 
-  IonListHeader,IonCardHeader,IonCardTitle,IonCardContent, IonTitle,IonCard, IonToolbar,IonInput,IonSearchbar } from '@ionic/angular/standalone';
-  import { Router } from '@angular/router';
- 
+import { Router } from '@angular/router';
+import { CommonModule } from '@angular/common'; // 导入 CommonModule
+
+import { IonHeader, IonButton, IonContent, IonIcon, IonItem, IonLabel, IonList, 
+  IonListHeader, IonCardHeader, IonCardTitle, IonCardContent, IonTitle, IonCard, IonToolbar, IonInput, IonSearchbar } from '@ionic/angular/standalone';
+import { CloudQuery, CloudUser } from 'src/lib/ncloud';
+import { UserService } from 'src/app/user.service'; // 假设这是你的用户服务
 
 @Component({
   selector: 'app-my-drift-bottle',
   templateUrl: './my-drift-bottle.component.html',
   styleUrls: ['./my-drift-bottle.component.scss'],
   standalone: true,
-  imports: [IonHeader,IonToolbar,IonTitle,IonContent,
-        IonList,IonListHeader,IonItem,IonCardTitle,
-        IonLabel,IonIcon,IonButton,IonCardContent,
-        IonInput,IonSearchbar,IonCard,IonCardHeader,
-        
-      ]
+  imports: [
+    CommonModule, // 添加 CommonModule
+    
+    IonHeader, IonToolbar, IonTitle, IonContent,
+    IonList, IonListHeader, IonItem, IonCardTitle,
+    IonLabel, IonIcon, IonButton, IonCardContent,
+    IonInput, IonSearchbar, IonCard, IonCardHeader,
+  ]
 })
-export class MyDriftBottleComponent  implements OnInit {
+export class MyDriftBottleComponent implements OnInit {
+  filteredDriftbottles2:any[]=[];
+  Driftbottles: any[]=[];
+  filteredDriftbottles: any[]=[];
+  username: String='';
+  
+
+  constructor(private router: Router, private userService: UserService) {}
+
+  ngOnInit() {
+    this.getDriftbottles(); // 获取所有漂流瓶并进行过滤
+  }
+
+  async getDriftbottles() {
+    let query=new CloudQuery("Driftbottle");
+    this.Driftbottles = await query.find(); 
+      this.filterDriftbottles(); 
+      this.filterDriftbottles2(); 
+
+  }
+
+  filterDriftbottles() {
+    let user = new CloudUser();
+    console.log(user)
+    this.filteredDriftbottles = this.Driftbottles.filter(driftbottle => {
+      console.log(driftbottle.get("username"), user.get("username"))
+      return (driftbottle.get("username") === user.get("username") || driftbottle.get("username") === 'all');
+    });
+  }
+  filterDriftbottles2(){
+    let user = new CloudUser();
+    console.log(user)
+    this.filteredDriftbottles2 = this.Driftbottles.filter(driftbottle => {
+      console.log(driftbottle.get("catcher"), user.get("username"))
+      return (driftbottle.get("catcher") === user.get("username") || driftbottle.get("catcher") === 'all');
+    });
+  }
+
+  
 
-  constructor(private router: Router) { }
-  goDriftbottle(){
-    this.router.navigate(['tabs/drift-bottle'])
+  goDriftbottle() {
+    this.router.navigate(['tabs/drift-bottle']);
   }
-  ngOnInit() {}
 
-}
+  throwNewDriftbottle() {
+    this.router.navigate(['tabs/throw-drift-bottle']); // 假设这是投掷新漂流瓶的路由
+  }
+}

+ 1 - 3
soul-app/src/app/page-psysurvey/page-psysurvey.component.ts

@@ -3,8 +3,6 @@ import { Component, OnInit } from '@angular/core';
 import { Router } from '@angular/router';
 import { IonHeader,IonButton, IonContent, IonIcon,
   IonCardHeader,IonCardTitle,IonCardContent, IonTitle,IonCard, IonToolbar } from '@ionic/angular/standalone';
-  import { HttpClient } from '@angular/common/http';
-  import { UserService } from '../user.service'; // 确保路径正确
   import { FormsModule } from '@angular/forms'; // 导入 FormsModule
 import { CloudQuery, CloudUser } from 'src/lib/ncloud';
 
@@ -28,7 +26,7 @@ export class PagePsysurveyComponent  implements OnInit {
   filteredSurveys: any[] = []; // 存储过滤后的问卷
   userDepartment: string = '' ; // 当前用户的学院
 
-  constructor(private router: Router,private http: HttpClient,private userService: UserService) { }
+  constructor(private router: Router) { }
   goTab1(){
     this.router.navigate(['tabs/tab1']);
    }

+ 56 - 19
soul-app/src/app/throw-drift-bottle/throw-drift-bottle.component.ts

@@ -1,8 +1,9 @@
 import { Component, OnInit } from '@angular/core';
-import { ModalController, IonInput, IonItem, IonLabel, IonButton, IonCard, IonCardHeader, IonCardTitle, IonCardSubtitle, IonCardContent } from '@ionic/angular/standalone';
+import { ModalController, ToastController, IonInput, IonItem, IonLabel, IonButton, IonCard, IonCardHeader, IonCardTitle, IonCardSubtitle, IonCardContent } from '@ionic/angular/standalone';
 import { CloudObject } from 'src/lib/ncloud';
 import { FormsModule } from '@angular/forms'; // 导入 FormsModule
 import { CommonModule } from '@angular/common';
+import { UserService } from 'src/app/user.service'; // 假设这是你的用户服务
 
 @Component({
   selector: 'app-throw-drift-bottle',
@@ -24,32 +25,71 @@ import { CommonModule } from '@angular/common';
   ],
 })
 export class ThrowDriftBottleComponent implements OnInit {
-  driftbottleData: { content: string } = { content: '' }; // 漂流瓶内容
- 
+  driftbottleData: { content: string, username: string, status: string, throwtime: Date } = { 
+    content: '', 
+    username: '', 
+    status: 'drifting', 
+    throwtime: new Date() // 初始化为当前时间
+  }; // 漂流瓶内容、用户名、状态和投掷时间
 
-  constructor(private modalCtrl: ModalController) {}
+  constructor(
+    private modalCtrl: ModalController,
+    private userService: UserService, // 注入用户服务
+    private toastCtrl: ToastController // 注入 ToastController
+  ) {}
 
-  ngOnInit() {}
+  ngOnInit() {
+    const username = this.userService.getUsername(); // 获取当前用户的用户名
+    if (username) {
+      this.driftbottleData.username = username;
+    } else {
+      console.error('用户未登录或未找到用户名');
+    }
+  }
+
+  async throw() {
+    // 更新投掷时间为当前时间
+    this.driftbottleData.throwtime = new Date();
 
-  throw() {
     console.log('投掷漂流瓶:');
     console.log(`内容: ${this.driftbottleData.content}`);
-    
-    // 这里可以添加逻辑将漂流瓶内容发布到后端或其他处理
+    console.log(`用户名: ${this.driftbottleData.username}`);
+    console.log(`状态: ${this.driftbottleData.status}`);
+    console.log(`投掷时间: ${this.driftbottleData.throwtime}`);
+
     const driftbottleData = {
       content: this.driftbottleData.content,
-      
+      username: this.driftbottleData.username,
+      status: this.driftbottleData.status,
+      throwtime: this.driftbottleData.throwtime.toISOString(), // 存储为 ISO 格式字符串
     };
 
     let driftbottle = new CloudObject("Driftbottle");
     driftbottle.set(driftbottleData);
-    driftbottle.save().then(data => {
-      console.log('漂流瓶已成功投掷', data);
+    try {
+      await driftbottle.save();
+      console.log('漂流瓶已成功投掷');
+
+      // 显示成功的 toast 提示
+      const toast = await this.toastCtrl.create({
+        message: '扔出成功!',
+        duration: 2000,
+        position: 'middle'
+      });
+      toast.present();
+
       this.modalCtrl.dismiss(driftbottle, "confirm");
-      
-    }).catch(err => {
-      console.error('投掷漂流瓶时出错');
-    });
+    } catch (err) {
+      console.error('投掷漂流瓶时出错', err);
+
+      // 显示错误的 toast 提示
+      const toast = await this.toastCtrl.create({
+        message: '扔出失败,请重试。',
+        duration: 2000,
+        position: 'middle'
+      });
+      toast.present();
+    }
   }
 
   cancel() {
@@ -71,7 +111,4 @@ export async function openThrowDriftBottleModal(modalCtrl: ModalController): Pro
     return data;
   }
   return null;
-}
-
-
-
+}

+ 26 - 4
soul-app/src/app/user.service.ts

@@ -1,6 +1,6 @@
 import { Injectable } from '@angular/core';
 import { CloudUser } from 'src/lib/ncloud';
-import { Observable } from "rxjs"
+
 @Injectable({
   providedIn: 'root'
 })
@@ -9,8 +9,30 @@ export class UserService {
   constructor() {}
 
   // 获取当前用户信息
-  getCurrentUser(): CloudUser {
-    let user = new CloudUser()
-    return user
+  getCurrentUser(): CloudUser | null {
+    let user = new CloudUser();
+    if (!user.sessionToken) {
+      console.error("用户未登录");
+      return null;
+    }
+    return user;
+  }
+
+  // 获取当前用户的用户名
+  getUsername(): string {
+    const user = this.getCurrentUser();
+    if (user && user.data) {
+      return user.data['username'] || ''; // 使用方括号访问 username 字段
+    }
+    return '';
+  }
+
+  // 获取当前用户的 ID
+  getUserId(): string | null {
+    const user = this.getCurrentUser();
+    if (user) {
+      return user.id || null;
+    }
+    return null;
   }
 }