0225304 3 napja
szülő
commit
e21663180b

+ 18 - 0
myapp/src/app/services/audio.service.ts

@@ -23,6 +23,10 @@ export class AudioService {
     }
   }
 
+  /**
+   * 
+   * @param volumeCallback 音频记录
+   */
   async startRecording(volumeCallback: (volume: number) => void): Promise<void> {
     this.volumeCallback = volumeCallback;
     this.audioChunks = [];
@@ -46,6 +50,10 @@ export class AudioService {
     }
   }
 
+  /**
+   * 
+   * @param {MediaStream}stream 音频分析
+   */
   private setupAudioAnalysis(stream: MediaStream) {
     this.microphone = this.audioContext.createMediaStreamSource(stream);
     this.audioAnalyser = this.audioContext.createAnalyser();
@@ -76,6 +84,10 @@ export class AudioService {
     };
   }
 
+  /**
+   * 
+   * @returns 结束录音
+   */
   async stopRecording(): Promise<Blob> {
     return new Promise((resolve) => {
       this.mediaRecorder.onstop = () => {
@@ -93,6 +105,11 @@ export class AudioService {
     return this.audioChunks;
   }
 
+  /**
+   * 
+   * @param audioChunks 提取音频的分析信息并返回DataArray
+   * @param callback 
+   */
   analyzeAudio(audioChunks: Blob[], callback: (dataArray: Uint8Array) => void) {
     const audioBlob = new Blob(audioChunks, { type: 'audio/wav' });
     const fileReader = new FileReader();
@@ -129,6 +146,7 @@ export class AudioService {
     fileReader.readAsArrayBuffer(audioBlob);
   }
 
+  //清除
   private cleanupAudioNodes() {
     if (this.scriptProcessor) {
       this.scriptProcessor.disconnect();

+ 4 - 0
myapp/src/app/services/auth.service.ts

@@ -26,6 +26,7 @@ export class AuthService {
     return this._currentUser;
   }
 
+  //获取当前用户信息
   async getCurrentUser(): Promise<CloudUser | null> {
     if (!this._currentUser) {
       await this.initializeUser();
@@ -33,6 +34,7 @@ export class AuthService {
     return this._currentUser;
   }
 
+  //登录
   async login(username: string, password: string): Promise<boolean> {
     if (!this._currentUser) {
       await this.initializeUser();
@@ -47,6 +49,7 @@ export class AuthService {
     }
   }
 
+  //注册
   async register(username: string, password: string, email?: string): Promise<boolean> {
     try {
       const newUser = new CloudUser();
@@ -64,6 +67,7 @@ export class AuthService {
     }
   }
 
+  //登出
   async logout(): Promise<boolean> {
     if (!this._currentUser) return true;
     

+ 0 - 138
myapp/src/app/services/diary.service.ts

@@ -1,138 +0,0 @@
-// import { Injectable } from '@angular/core';
-// import { Diary } from '../modals/diary.modal';
-// import { AlertController } from '@ionic/angular'; // 添加这行
-
-// @Injectable({
-//   providedIn: 'root'
-// })
-// export class DiaryService {
-//   private storageKey = 'diaries';
-//     modalCtrl: any;
-  
-//     //alertCtrl: any;
-//     //storage: any;
-
-//   constructor(private alertCtrl: AlertController) {}
-
-//   async getDiaries(): Promise<Diary[]> {
-//     const data = localStorage.getItem(this.storageKey);
-//     return data ? JSON.parse(data) : [];
-//   }
-
-//   async addDiary(diary: Diary): Promise<void> {
-//     const diaries = await this.getDiaries();
-//     diaries.push(diary);
-//     localStorage.setItem(this.storageKey, JSON.stringify(diaries));
-//   }
-
-//   async updateDiary(updatedDiary: Diary): Promise<void> {
-//     const diaries = await this.getDiaries();
-//     const index = diaries.findIndex(d => d.id === updatedDiary.id);
-//     if (index !== -1) {
-//       diaries[index] = updatedDiary;
-//       localStorage.setItem(this.storageKey, JSON.stringify(diaries));
-//     }
-//   }
-
-// //   async deleteDiary(id: number): Promise<void> {
-// //     const diaries = await this.getDiaries();
-// //     const updatedDiaries = diaries.filter(d => d.id !== id);
-// //     //await this.storage.set('diaries', updatedDiaries);
-// //     localStorage.setItem(this.storageKey, JSON.stringify(updatedDiaries));
-// //   }
-
-// //   async deleteDiary(id: number): Promise<boolean> {
-// //     return new Promise<boolean>(async (resolve) => {
-// //       const alert = await this.alertCtrl.create({
-// //         header: '确认删除',
-// //         message: '确定要删除这篇日记吗?',
-// //         buttons: [
-// //           {
-// //             text: '取消',
-// //             role: 'cancel',
-// //             handler: () => resolve(false)
-// //           },
-// //           {
-// //             text: '删除',
-// //             handler: async () => {
-// //               const diaries = await this.getDiaries();
-// //               const updatedDiaries = diaries.filter(d => d.id !== id);
-// //               localStorage.setItem(this.storageKey, JSON.stringify(updatedDiaries));
-// //               resolve(true);
-// //             }
-// //           }
-// //         ]
-// //       });
-      
-// //       await alert.present();
-// //     });
-// //   }
-
-// //   async deleteDiary(id: number): Promise<boolean> {
-// //   const alert = await this.alertCtrl.create({
-// //     header: '确认删除',
-// //     message: '确定要删除这篇日记吗?',
-// //     buttons: [
-// //       {
-// //         text: '取消',
-// //         role: 'cancel',
-// //         handler: () => {
-// //           return false;
-// //         }
-// //       },
-// //       {
-// //         text: '删除',
-// //         handler: () => {
-// //           this.confirmDelete(id);
-// //           return true;
-// //         }
-// //       }
-// //     ]
-// //   });
-  
-// //   await alert.present();
-// //   return true;
-// // }
-
-// // private async confirmDelete(id: number) {
-// //   const diaries = await this.getDiaries();
-// //   const updatedDiaries = diaries.filter(d => d.id !== id);
-// //   localStorage.setItem(this.storageKey, JSON.stringify(updatedDiaries));
-// // }
-
-// async deleteDiary(id: number): Promise<boolean> {
-//     return new Promise<boolean>(async (resolve) => {
-//       const alert = await this.alertCtrl.create({
-//         header: '确认删除',
-//         message: '确定要删除这篇日记吗?',
-//         buttons: [
-//           {
-//             text: '取消',
-//             role: 'cancel',
-//             handler: () => resolve(false)
-//           },
-//           {
-//             text: '删除',
-//             handler: async () => {
-//               const diaries = await this.getDiaries();
-//               const updatedDiaries = diaries.filter(d => d.id !== id);
-//               localStorage.setItem(this.storageKey, JSON.stringify(updatedDiaries));
-//               resolve(true);
-//               // 关闭当前页面并返回tab1
-//             //this.modalCtrl.dismiss({ deleted: true });
-//             }
-//           }
-//         ]
-//       });
-      
-//       await alert.present();
-//     });
-//   }
-// //    async onDelete(id: number) {
-// //     const success = await this.diaryService.deleteDiary(id);
-// //     if (success) {
-// //       // 刷新列表
-// //       this.loadDiaries();
-// //     }
-// //  }
-// }

+ 4 - 1
myapp/src/app/tab1/edit/edit.page.ts

@@ -51,7 +51,10 @@ export class EditPage {
     const now = new Date();
     return `${now.getHours().toString().padStart(2, '0')}:${now.getMinutes().toString().padStart(2, '0')}`;
   }
-
+  /**
+   * 
+   * @returns 创建日记并保存
+   */
   async saveDiary() {
     if (!this.diary.user) {
       console.error('用户未登录,无法保存日记');

+ 25 - 14
myapp/src/app/tab1/tab1.page.ts

@@ -28,6 +28,10 @@ export class Tab1Page implements OnInit{
     })
   }
   
+  /**
+   * 
+   * @param {string}page 菜单导航
+   */
   navigateTo(page: string) {
   // 根据传入的页面参数进行导航
   switch(page) {
@@ -46,7 +50,10 @@ export class Tab1Page implements OnInit{
   }
   
 }
-  
+
+/**
+ * 获得用户信息,查询用户是否登录
+ */
 async loadCurrentUserAndDiaries() {
     // 获取当前用户
     this.currentUser = await CloudUser.current();
@@ -58,11 +65,13 @@ async loadCurrentUserAndDiaries() {
       // 用户未登录,清空日记列表
       this.diaryList = [];
     }
-  }
-  async loadDiaries() {
-    // let query=new CloudQuery("Diary"); 
-    // this.diaryList=await query.find();
+  } 
 
+  /**
+   * 
+   * @returns 查询用户日记列表
+   */
+  async loadDiaries() { 
     if (!this.currentUser) return;
     
     let query = new CloudQuery("Diary");
@@ -78,14 +87,12 @@ async loadCurrentUserAndDiaries() {
     this.diaryList=[];
   }
 
-  async goToEditPage(edit?:string) {
-  //   const modal = await this.modalCtrl.create({
-  //   component: EditPage,
-  //   componentProps: {
-  //     editMode: edit === '编辑'
-  //   }
-  // });
-
+/**
+ * 
+ * @param {string}edit 跳转到"创建日记"页面 
+ * @returns 
+ */
+  async goToEditPage(edit?:string) { 
   if (!this.currentUser) {
       // 如果用户未登录,跳转到登录页面
       this.navCtrl.navigateForward(['/login']);
@@ -109,7 +116,11 @@ async loadCurrentUserAndDiaries() {
   
   await modal.present();
   }
- 
+
+ /**
+  * 
+  * @param {CloudObject}diary 跳转到日记详情页面,查询及修改日记信息 
+  */
   goMessage(diary: CloudObject){
     //console.log(diary),
     this.navCtrl.navigateForward(['tabs', 'tab1', 'message'], {

+ 16 - 1
myapp/src/app/tab1/test-message/test-message.page.ts

@@ -29,7 +29,11 @@ export class TestMessagePage implements OnInit {
       this.loadDiary();
     });
   }
-
+  
+/**
+ * 
+ * @returns 返回从数据库中获取到的日记信息
+ */
   async loadDiary() {
     if (!this.diaryId) return;
     
@@ -52,6 +56,9 @@ export class TestMessagePage implements OnInit {
     }
   }
 
+/**
+ * 检查用户权限
+ */
   async showNotOwnerAlert() {
     const alert = await this.alertCtrl.create({
       header: '权限不足',
@@ -61,6 +68,10 @@ export class TestMessagePage implements OnInit {
     await alert.present();
   }
 
+/**
+ * 
+ * @returns 编辑修改日记信息
+ */
   async editDiary() {
     if (!this.diary || !this.currentUser) return;
 
@@ -100,6 +111,10 @@ export class TestMessagePage implements OnInit {
     await modal.present();
   }
 
+  /**
+   * 
+   * @returns 删除日记信息
+   */
   async deleteDiary() {
     if (!this.diary || !this.diary.id || !this.currentUser) return;
     

+ 3 - 0
myapp/src/app/tab2/dynamic-create/dynamic-create.page.ts

@@ -29,6 +29,7 @@ export class DynamicCreatePage implements OnInit {
     await this.currentUser.current();
   }
 
+  //创建动态
   onFileChange(event: any) {
     const files = event.target.files;
     if (files && files.length > 0) {
@@ -48,10 +49,12 @@ export class DynamicCreatePage implements OnInit {
     }
   }
 
+  
   removeImage(index: number) {
     this.images.splice(index, 1);
   }
 
+  //保存动态
   async submitDynamic() {
     if (!this.content) return;
 

+ 16 - 0
myapp/src/app/tab2/dynamic-detail/dynamic-detail.page.ts

@@ -36,12 +36,20 @@ export class DynamicDetailPage implements OnInit {
     await this.checkUserInteraction(dynamicId);
   }
 
+  /**
+   * 
+   * @param {string}dynamicId 查询Dynamic中单个动态的信息
+   */
   async loadDynamic(dynamicId: string) {
     const query = new CloudQuery("Dynamic");
     query.include("author");
     this.dynamic = await query.get(dynamicId);
   }
 
+  /**
+   * 
+   * @param dynamicId 查询动态关联的Interaction表
+   */
   async loadComments(dynamicId: string) {
     const query = new CloudQuery("Interaction");
     query.equalTo("dynamic", dynamicId);
@@ -51,6 +59,11 @@ export class DynamicDetailPage implements OnInit {
     this.comments = await query.find();
   }
 
+  /**
+   * 
+   * @param {string}dynamicId 查询动态关联的—_User信息
+   * @returns 
+   */
   async checkUserInteraction(dynamicId: string) {
     if (!this.currentUser.id) return;
     
@@ -62,6 +75,7 @@ export class DynamicDetailPage implements OnInit {
     this.isLiked = !!likeInteraction;
   }
 
+  //互动(喜爱)
   async toggleLike() {
     const dynamicId = this.dynamic.id;
     
@@ -99,6 +113,7 @@ export class DynamicDetailPage implements OnInit {
     this.isLiked = !this.isLiked;
   }
 
+  //互动(评论动态)
   async addComment() {
     const alert = await this.alertController.create({
       header: '添加评论',
@@ -144,6 +159,7 @@ export class DynamicDetailPage implements OnInit {
     await alert.present();
   }
 
+  //互动(分享动态)
   async shareDynamic() {
     const alert = await this.alertController.create({
       header: '分享动态',

+ 6 - 2
myapp/src/app/tab2/management/emotion-vent/emotion-vent.page.ts

@@ -114,8 +114,6 @@ generateBubbles() {
       type = 'normal';
       health = 1;
     }
-    
-    //const randomWord = this.negativeWords[Math.floor(Math.random() * this.negativeWords.length)];
     const randomColor = this.getColorForType(type);
     
     this.bubbles.push({
@@ -158,6 +156,7 @@ getScaleForType(type: string): number {
   }
 }
 
+//气泡移动逻辑
   startBubbleMovement() {
     const moveBubbles = () => {
       this.bubbles.forEach(bubble => {
@@ -181,6 +180,7 @@ getScaleForType(type: string): number {
     moveBubbles();
   }
 
+  //检测触碰逻辑
   onTouchMove(event: TouchEvent) {
     if (event.touches.length > 0) {
       this.hammerX = event.touches[0].clientX;
@@ -195,6 +195,7 @@ getScaleForType(type: string): number {
     // 触摸结束时可以添加一些效果
   }
 
+  //设置气泡移动边界
   checkCollision(x: number, y: number) {
     this.bubbles.forEach(bubble => {
       if (!bubble.burst) {
@@ -210,6 +211,7 @@ getScaleForType(type: string): number {
     });
   }
 
+  //气泡粉碎效果
  burstBubble(bubble: Bubble) {
   // 增加击中次数
   bubble.hits++;
@@ -274,6 +276,7 @@ showCrackEffect(bubble: Bubble) {
   }
 }
 
+//气泡粉碎音效
   playBurstSound(type: string) {
     // 这里可以添加爆裂音效
     const sounds = [
@@ -306,6 +309,7 @@ playHitSound() {
   sound.play().catch(e => console.log('Audio play error:', e));
 }
 
+//全部气泡粉碎的完成消息
 showCompletionMessage() {
     // 创建更漂亮的完成消息
     const message = document.createElement('div');

+ 2 - 0
myapp/src/app/tab2/management/management.page.ts

@@ -16,10 +16,12 @@ export class ManagementPage implements OnInit {
   ngOnInit() {
   }
 
+  //情绪粉碎室
   goVentRoom(){
     this.navCtrl.navigateForward(["tabs","tab2","management","emotion-vent"])
   }
 
+  //吼叫录音机
   goToScreamRoom(){
     this.navCtrl.navigateForward(["tabs","tab2","management","scream-room"])
   }

+ 20 - 0
myapp/src/app/tab2/management/scream-room/scream-room.page.ts

@@ -37,6 +37,7 @@ export class ScreamRoomPage implements OnInit {
     this.setupVisualizer();
   }
 
+  //画布布局
   private setupVisualizer() {
     const canvas = this.visualizerCanvas.nativeElement;
     this.canvasCtx = canvas.getContext('2d')!;
@@ -46,6 +47,7 @@ export class ScreamRoomPage implements OnInit {
     this.drawInitialVisualizer();
   }
 
+  //绘制吼叫艺术画
   private drawInitialVisualizer() {
     const { width, height } = this.visualizerCanvas.nativeElement;
     this.canvasCtx.clearRect(0, 0, width, height);
@@ -67,6 +69,9 @@ export class ScreamRoomPage implements OnInit {
     this.canvasCtx.stroke();
   }
 
+  /**
+   * 记录录音
+   */
   async startRecording() {
     try {
       this.isRecording = true;
@@ -85,6 +90,9 @@ export class ScreamRoomPage implements OnInit {
     }
   }
 
+  /**
+   * 结束录音
+   */
   async stopRecording() {
     this.isRecording = false;
     cancelAnimationFrame(this.animationId);
@@ -100,6 +108,9 @@ export class ScreamRoomPage implements OnInit {
     }
   }
 
+  /**
+   * 动态绘制艺术画
+   */
   private startVisualizerAnimation() {
     const canvas = this.visualizerCanvas.nativeElement;
     const { width, height } = canvas;
@@ -140,6 +151,9 @@ export class ScreamRoomPage implements OnInit {
     // 动画循环中已经处理,这里可以留空或添加额外效果
   }
 
+  /**
+   * 生成吼叫波浪艺术画
+   */
   private generateWaveformArt() {
     const canvas = document.createElement('canvas');
     canvas.width = 800;
@@ -210,6 +224,10 @@ export class ScreamRoomPage implements OnInit {
     }
   }
 
+  /**
+   * 
+   * @returns 保存生成的波浪艺术画
+   */
   async saveArtwork() {
     if (!this.waveformImage) return;
     
@@ -240,6 +258,7 @@ export class ScreamRoomPage implements OnInit {
       }
   }
 
+  //分享
   async shareArtwork() {
     if (!this.waveformImage) return;
     
@@ -265,6 +284,7 @@ export class ScreamRoomPage implements OnInit {
     await alert.present();
   }
 
+  //删除
   ngOnDestroy() {
     if (this.isRecording) {
       this.audioService.stopRecording();

+ 19 - 4
myapp/src/app/tab2/tab2.page.ts

@@ -14,9 +14,9 @@ export class Tab2Page implements OnInit {
 
   isLoading = true; // 添加加载状态变量
   currentUser: any = null;
-  dynamics: any[] = [];
-  //dynamics: CloudObject[]=[];
+  dynamics: any[] = []; 
   userInteractions: Record<string, any> = {}; // 记录用户对每个动态的互动状态
+  
   // 在组件类中添加
   tabs = [
     { id: 0, title: '推荐' },
@@ -46,7 +46,10 @@ export class Tab2Page implements OnInit {
      this.dynamics=[];
   }
 
-
+  /**
+   * 
+   * @returns 查询后端中已存在的动态以及每个动态的互动信息
+   */
   async loadData() {
     
     this.isLoading = true; // 开始加载
@@ -238,20 +241,32 @@ export class Tab2Page implements OnInit {
     await alert.present();
   }
  
+  /**
+   * 
+   * @param {string}thanks 跳转到感恩清单页面 
+   */
   goThankslist(thanks?:string){
     this.navCtrl.navigateForward(["tabs","tab2","thanks"],{
       
     })
   }
 
+  /**
+   * 跳转到情绪发泄室功能页面
+   */
    goToManage(){
     this.navCtrl.navigateForward(["tabs","tab2","management"])
   }
+
+  /**
+   * 
+   * @param {string}dynamicId 根据动态id查询单个动态信息
+   */
   goToDynamic(dynamicId:string){
     this.navCtrl.navigateForward(["tabs","tab2","dynamic-detail",dynamicId])
-    //this.router.navigate(['/dynamic-detail', dynamicId]);
   }
 
+  // 添加动态
   addDynamic(){
     this.navCtrl.navigateForward(["tabs","tab2","dynamic-create"])
   }

+ 7 - 8
myapp/src/app/tab2/thanks-cloud/thanks-cloud.page.ts

@@ -11,7 +11,6 @@ import { AlertController, NavController } from '@ionic/angular';
 export class ThanksCloudPage implements OnInit {
 
   constructor(
-    //private parseService: ParseService
     private alertController: AlertController,
     private navCtrl:NavController
   ) { 
@@ -20,6 +19,7 @@ export class ThanksCloudPage implements OnInit {
   currentUser: CloudUser | null = null;
   thanksList: CloudObject[]=[];
 
+  //查询ThanksType表
   async loadThanksType(){
 
     let query=new CloudQuery("ThanksType")
@@ -27,9 +27,9 @@ export class ThanksCloudPage implements OnInit {
   } 
 
   ngOnInit() {
-    //this.checkLoginAndLoadData();
+    
   }
-
+  //检查登录
     async checkLoginAndLoadData() {
     // 获取当前用户
     this.currentUser = await CloudUser.current();
@@ -42,6 +42,7 @@ export class ThanksCloudPage implements OnInit {
     }
   }
 
+  //登录注册弹窗
   async showLoginAlert() {
     const alert = await this.alertController.create({
       header: '未登录',
@@ -63,7 +64,8 @@ export class ThanksCloudPage implements OnInit {
     });
     await alert.present();
   }
-
+  
+  //查询当前用户的的感恩清单
   async loadThanksList() {
     if (!this.currentUser) return;
 
@@ -79,10 +81,7 @@ export class ThanksCloudPage implements OnInit {
     this.thanksList = await query.find();
   }
   
-  async importThanks(){
-  
-  }
-  
+  //创建感恩清单
   async addNewThanks(){
  
     if (!this.currentUser) {

+ 1 - 27
myapp/src/app/tab3/tab3.page.ts

@@ -217,33 +217,7 @@ openConsult(chatId?:string){
       建议练习: 正念呼吸法
       `;
   }
-
-  // /**
-  //  * 开始聊天  
-  //  */
-  // openChat(){
-  //   let options:ChatPanelOptions = {
-  //     roleId:"2DXJkRsjXK",
-  //     onChatSaved:(chat:FmodeChat)=>{
-  //       // chat?.chatSession?.id 本次会话的 chatId
-  //       console.log("onChatSaved",chat,chat?.chatSession,chat?.chatSession?.id)
-  //     },
-  //   }
-  //   openChatPanelModal(this.modalCtrl,options)
-  // }
-
-  // /**
-  //  * 恢复聊天
-  //  * @chatId 从onChatSaved生命周期中,获取chat?.chatSession?.id
-  //  */
-  // restoreChat(chatId:string){
-  //   let options:ChatPanelOptions = {
-  //     roleId:"2DXJkRsjXK",
-  //     chatId:chatId
-  //   }
-  //   openChatPanelModal(this.modalCtrl,options)
-  // }
-
+//开始聊天
   goChat(){
     this.router.navigateByUrl("/chat/session/role/2DXJkRsjXK")
   }

+ 3 - 0
myapp/src/app/tab4/login/login.page.ts

@@ -25,6 +25,7 @@ export class LoginPage {
     private toastCtrl: ToastController
   ) {}
 
+  //检查是否登陆成功
   async submit() {
     if (this.isLoading) return;
     
@@ -44,6 +45,7 @@ export class LoginPage {
     }
   }
 
+  //登录
   private async handleLogin() {
     if (!this.username || !this.password) {
       this.showToast('请输入用户名和密码');
@@ -60,6 +62,7 @@ export class LoginPage {
     }
   }
 
+  //注册
   private async handleRegister() {
     if (!this.username || !this.password) {
       this.showToast('请输入用户名和密码');

+ 13 - 1
myapp/src/app/tab4/tab4.page.ts

@@ -22,7 +22,6 @@ export class Tab4Page implements OnInit {
     private activatedRoute: ActivatedRoute
   ) { 
     this.activatedRoute.params.subscribe(()=>{
-      //this.loadDiaries();
       this.loadUserData();
     })
   }
@@ -31,6 +30,7 @@ export class Tab4Page implements OnInit {
     await this.loadUserData();
   }
 
+  //获取当前用户信息
   async loadUserData() {
     // 获取当前用户
     this.currentUser = await CloudUser.current();
@@ -40,6 +40,7 @@ export class Tab4Page implements OnInit {
     }
   }
 
+  //统计用户的日记信息
   async getDiaryStats() {
     if (!this.currentUser) return;
     
@@ -53,6 +54,11 @@ export class Tab4Page implements OnInit {
     this.recordDays = this.calculateRecordDays(diaries);
   }
 
+  /**
+   * 
+   * @param {CloudObject}diaries 计算用户日记总字数
+   * @returns 
+   */
   private calculateTotalWords(diaries: CloudObject[]): number {
     return diaries.reduce((total, diary) => {
       const content = diary.get('content') || '';
@@ -60,6 +66,11 @@ export class Tab4Page implements OnInit {
     }, 0);
   }
 
+  /**
+   * 
+   * @param {CloudObject}diaries 计算用户日记记录总天数 
+   * @returns 
+   */
   private calculateRecordDays(diaries: CloudObject[]): number {
     const uniqueDates = new Set();
     diaries.forEach(diary => {
@@ -71,6 +82,7 @@ export class Tab4Page implements OnInit {
     return uniqueDates.size;
   }
 
+  //登录注册
   async goLogin(action?:string){
       if (this.currentUser) {
       // 已登录,执行登出