Explorar o código

0210348-代码优化

0210348 hai 2 meses
pai
achega
832b7618ca
Modificáronse 52 ficheiros con 638 adicións e 773 borrados
  1. 23 41
      src/app/app-routing.module.ts
  2. 17 0
      src/app/chatpage/chatpage-routing.module.ts
  3. 20 0
      src/app/chatpage/chatpage.module.ts
  4. 0 0
      src/app/chatpage/chatpage.page.html
  5. 0 0
      src/app/chatpage/chatpage.page.scss
  6. 17 0
      src/app/chatpage/chatpage.page.spec.ts
  7. 6 6
      src/app/chatpage/chatpage.page.ts
  8. 0 0
      src/app/child-page/bounty-store/bounty-store-routing.module.ts
  9. 0 0
      src/app/child-page/bounty-store/bounty-store.module.ts
  10. 0 0
      src/app/child-page/bounty-store/bounty-store.page.html
  11. 0 0
      src/app/child-page/bounty-store/bounty-store.page.scss
  12. 0 0
      src/app/child-page/bounty-store/bounty-store.page.spec.ts
  13. 0 0
      src/app/child-page/bounty-store/bounty-store.page.ts
  14. 3 3
      src/app/child-page/chat/chat-routing.module.ts
  15. 5 5
      src/app/child-page/chat/chat.module.ts
  16. 0 0
      src/app/child-page/chat/chat.page.html
  17. 0 0
      src/app/child-page/chat/chat.page.scss
  18. 5 5
      src/app/child-page/chat/chat.page.spec.ts
  19. 4 4
      src/app/child-page/chat/chat.page.ts
  20. 0 0
      src/app/child-page/chat/class-chat-completion.ts
  21. 56 5
      src/app/home/home.page.html
  22. 174 0
      src/app/home/home.page.scss
  23. 199 3
      src/app/home/home.page.ts
  24. 17 0
      src/app/mine/mine-routing.module.ts
  25. 20 0
      src/app/mine/mine.module.ts
  26. 0 0
      src/app/mine/mine.page.html
  27. 20 0
      src/app/mine/mine.page.scss
  28. 17 0
      src/app/mine/mine.page.spec.ts
  29. 4 4
      src/app/mine/mine.page.ts
  30. 0 16
      src/app/tab1/tab1-routing.module.ts
  31. 0 20
      src/app/tab1/tab1.module.ts
  32. 0 64
      src/app/tab1/tab1.page.html
  33. 0 174
      src/app/tab1/tab1.page.scss
  34. 0 27
      src/app/tab1/tab1.page.spec.ts
  35. 0 211
      src/app/tab1/tab1.page.ts
  36. 0 17
      src/app/tab2/tab2-routing.module.ts
  37. 0 27
      src/app/tab2/tab2.module.ts
  38. 0 26
      src/app/tab2/tab2.page.spec.ts
  39. 0 16
      src/app/tab3/tab3-routing.module.ts
  40. 0 20
      src/app/tab3/tab3.module.ts
  41. 0 21
      src/app/tab3/tab3.page.scss
  42. 0 26
      src/app/tab3/tab3.page.spec.ts
  43. 25 25
      src/app/tabs/tabs-routing.module.ts
  44. 2 3
      src/app/tabs/tabs.page.html
  45. 1 1
      src/app/tabs/tabs.page.ts
  46. 0 0
      src/modules/tab/tree/explore-container/explore-container.component.html
  47. 0 0
      src/modules/tab/tree/explore-container/explore-container.component.scss
  48. 0 0
      src/modules/tab/tree/explore-container/explore-container.component.spec.ts
  49. 0 0
      src/modules/tab/tree/explore-container/explore-container.component.ts
  50. 0 0
      src/modules/tab/tree/explore-container/explore-container.module.ts
  51. 1 1
      src/modules/tab/tree/tree.page.spec.ts
  52. 2 2
      src/modules/user/login/login.page.ts

+ 23 - 41
src/app/app-routing.module.ts

@@ -1,42 +1,24 @@
-import { NgModule } from '@angular/core';
-import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
-
-const routes: Routes = [
-  {
-    path: '',
-    loadChildren: () => import('./tabs/tabs.module').then(m => m.TabsPageModule)
-  },
-  {
-    path: 'user',
-    loadChildren: () => import('../modules/user/user.module').then(m => m.UserModule)
-  },
-  {
-    path: "tree",
-    loadChildren: () => import('../modules/tab/tree/tree.module').then(m => m.TreePageModule)
-  },
-  {
-    path: 'bounty-store',
-    loadChildren: () => import('../app/bounty-store/bounty-store.module').then(mod => mod.BountyStorePageModule)
-  },
-  {
-    path: 'memo',
-    loadChildren: () => import('../app/memo/memo.module').then(m => m.MemoPageModule)
-  },
-  {
-    path: 'ai-chat',
-    loadChildren: () => import('./ai-chat/ai-chat.module').then( m => m.AiChatPageModule)
-  },
  {
-    path: 'home',
-    loadChildren: () => import('./home/home.module').then( m => m.HomePageModule)
-  },
+import { NgModule } from '@angular/core';
+import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
 
-
-
-];
-@NgModule({
-  imports: [
-    RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
-  ],
-  exports: [RouterModule]
-})
-export class AppRoutingModule {}
+const routes: Routes = [
+  {
+    path: '',
+    loadChildren: () => import('./tabs/tabs.module').then(m => m.TabsPageModule)
+  },
+  {
+    path: 'user',
+    loadChildren: () => import('../modules/user/user.module').then(m => m.UserModule)
+  },
+  {
+    path: "timer",
+    loadChildren: () => import('../modules/tab/tree/tree.module').then(m => m.TreePageModule)
+  },
+];
+@NgModule({
+  imports: [
+    RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
+  ],
+  exports: [RouterModule]
+})
+export class AppRoutingModule {}

+ 17 - 0
src/app/chatpage/chatpage-routing.module.ts

@@ -0,0 +1,17 @@
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+
+import { ChatpagePage } from './chatpage.page';
+
+const routes: Routes = [
+  {
+    path: '',
+    component: ChatpagePage
+  }
+];
+
+@NgModule({
+  imports: [RouterModule.forChild(routes)],
+  exports: [RouterModule],
+})
+export class ChatpagePageRoutingModule {}

+ 20 - 0
src/app/chatpage/chatpage.module.ts

@@ -0,0 +1,20 @@
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { FormsModule } from '@angular/forms';
+
+import { IonicModule } from '@ionic/angular';
+
+import { ChatpagePageRoutingModule } from './chatpage-routing.module';
+
+import { ChatpagePage } from './chatpage.page';
+
+@NgModule({
+  imports: [
+    CommonModule,
+    FormsModule,
+    IonicModule,
+    ChatpagePageRoutingModule
+  ],
+  declarations: [ChatpagePage]
+})
+export class ChatpagePageModule {}

+ 0 - 0
src/app/ai-chat/ai-chat.page.html → src/app/chatpage/chatpage.page.html


+ 0 - 0
src/app/ai-chat/ai-chat.page.scss → src/app/chatpage/chatpage.page.scss


+ 17 - 0
src/app/chatpage/chatpage.page.spec.ts

@@ -0,0 +1,17 @@
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+import { ChatpagePage } from './chatpage.page';
+
+describe('ChatpagePage', () => {
+  let component: ChatpagePage;
+  let fixture: ComponentFixture<ChatpagePage>;
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(ChatpagePage);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  });
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});

+ 6 - 6
src/app/ai-chat/ai-chat.page.ts → src/app/chatpage/chatpage.page.ts

@@ -11,11 +11,11 @@ interface ChatHistoryItem {
 }
 
 @Component({
-  selector: 'app-ai-chat',
-  templateUrl: './ai-chat.page.html',
-  styleUrls: ['./ai-chat.page.scss'],
+  selector: 'app-chatpage',
+  templateUrl: './chatpage.page.html',
+  styleUrls: ['./chatpage.page.scss'],
 })
-export class AiChatPage implements OnInit {
+export class ChatpagePage implements OnInit {
   chatHistory: ChatHistoryItem[] = [];
   username: string = ''; // 用户名
   load: boolean | undefined;
@@ -115,7 +115,7 @@ export class AiChatPage implements OnInit {
   }
 
   goToChat(chatId: number) {
-    this.navCtrl.navigateForward(`/tabs/tab2`, {
+    this.navCtrl.navigateForward(`/tabs/chat`, {
       queryParams: { chatId: chatId.toString() },
     });
   }
@@ -130,7 +130,7 @@ export class AiChatPage implements OnInit {
       const latestChat = await query.first();
       const newChatId = latestChat ? latestChat.get('chatId') + 1 : 1;
 
-      this.navCtrl.navigateForward(`/tabs/tab2`, {
+      this.navCtrl.navigateForward(`/tabs/chat`, {
         queryParams: { chatId: newChatId.toString() },
       });
     }

+ 0 - 0
src/app/bounty-store/bounty-store-routing.module.ts → src/app/child-page/bounty-store/bounty-store-routing.module.ts


+ 0 - 0
src/app/bounty-store/bounty-store.module.ts → src/app/child-page/bounty-store/bounty-store.module.ts


+ 0 - 0
src/app/bounty-store/bounty-store.page.html → src/app/child-page/bounty-store/bounty-store.page.html


+ 0 - 0
src/app/bounty-store/bounty-store.page.scss → src/app/child-page/bounty-store/bounty-store.page.scss


+ 0 - 0
src/app/bounty-store/bounty-store.page.spec.ts → src/app/child-page/bounty-store/bounty-store.page.spec.ts


+ 0 - 0
src/app/bounty-store/bounty-store.page.ts → src/app/child-page/bounty-store/bounty-store.page.ts


+ 3 - 3
src/app/ai-chat/ai-chat-routing.module.ts → src/app/child-page/chat/chat-routing.module.ts

@@ -1,12 +1,12 @@
 import { NgModule } from '@angular/core';
 import { Routes, RouterModule } from '@angular/router';
 
-import { AiChatPage } from './ai-chat.page';
+import { ChatPage } from './chat.page';
 
 const routes: Routes = [
   {
     path: '',
-    component: AiChatPage
+    component: ChatPage
   }
 ];
 
@@ -14,4 +14,4 @@ const routes: Routes = [
   imports: [RouterModule.forChild(routes)],
   exports: [RouterModule],
 })
-export class AiChatPageRoutingModule {}
+export class ChatPageRoutingModule {}

+ 5 - 5
src/app/ai-chat/ai-chat.module.ts → src/app/child-page/chat/chat.module.ts

@@ -4,17 +4,17 @@ import { FormsModule } from '@angular/forms';
 
 import { IonicModule } from '@ionic/angular';
 
-import { AiChatPageRoutingModule } from './ai-chat-routing.module';
+import { ChatPageRoutingModule } from './chat-routing.module';
 
-import { AiChatPage } from './ai-chat.page';
+import { ChatPage } from './chat.page';
 
 @NgModule({
   imports: [
     CommonModule,
     FormsModule,
     IonicModule,
-    AiChatPageRoutingModule
+    ChatPageRoutingModule
   ],
-  declarations: [AiChatPage]
+  declarations: [ChatPage]
 })
-export class AiChatPageModule {}
+export class ChatPageModule {}

+ 0 - 0
src/app/tab2/tab2.page.html → src/app/child-page/chat/chat.page.html


+ 0 - 0
src/app/tab2/tab2.page.scss → src/app/child-page/chat/chat.page.scss


+ 5 - 5
src/app/ai-chat/ai-chat.page.spec.ts → src/app/child-page/chat/chat.page.spec.ts

@@ -1,12 +1,12 @@
 import { ComponentFixture, TestBed } from '@angular/core/testing';
-import { AiChatPage } from './ai-chat.page';
+import { ChatPage } from './chat.page';
 
-describe('AiChatPage', () => {
-  let component: AiChatPage;
-  let fixture: ComponentFixture<AiChatPage>;
+describe('ChatPage', () => {
+  let component: ChatPage;
+  let fixture: ComponentFixture<ChatPage>;
 
   beforeEach(() => {
-    fixture = TestBed.createComponent(AiChatPage);
+    fixture = TestBed.createComponent(ChatPage);
     component = fixture.componentInstance;
     fixture.detectChanges();
   });

+ 4 - 4
src/app/tab2/tab2.page.ts → src/app/child-page/chat/chat.page.ts

@@ -5,11 +5,11 @@ import { TestChatCompletion, TestChatMessage } from './class-chat-completion';
 import { ChangeDetectorRef } from '@angular/core';
 
 @Component({
-  selector: 'app-tab2',
-  templateUrl: './tab2.page.html',
-  styleUrls: ['./tab2.page.scss'],
+  selector: 'app-chat',
+  templateUrl: './chat.page.html',
+  styleUrls: ['./chat.page.scss'],
 })
-export class Tab2Page implements OnInit {
+export class ChatPage implements OnInit {
   chatId: number | null = null;
   messageList: Array<TestChatMessage> = [];
   userInput: string = '';

+ 0 - 0
src/app/tab2/class-chat-completion.ts → src/app/child-page/chat/class-chat-completion.ts


+ 56 - 5
src/app/home/home.page.html

@@ -1,13 +1,64 @@
 <ion-header [translucent]="true">
-  <ion-toolbar>
-    <ion-title>home</ion-title>
-  </ion-toolbar>
 </ion-header>
 
 <ion-content [fullscreen]="true">
   <ion-header collapse="condense">
     <ion-toolbar>
-      <ion-title size="large">home</ion-title>
+      <ion-searchbar placeholder="搜索"></ion-searchbar>
     </ion-toolbar>
   </ion-header>
-</ion-content>
+    
+  <!-- 方框 -->
+  <ion-card (click)="openEditModal()">
+    <ion-card-content>
+      <ion-grid>
+        <ion-row>
+          <ion-col size="3">
+            <div class="info-box">初始</div>
+            <div class="info-value">{{ initial }}KG</div>
+          </ion-col>
+          <ion-col size="3">
+            <div class="info-box">当前</div>
+            <div class="info-value">{{ current }}KG</div>
+          </ion-col>
+          <ion-col size="3">
+            <div class="info-box">目标</div>
+            <div class="info-value">{{ target }}KG</div>
+          </ion-col>
+          <ion-col size="3">
+            <div class="info-box">赏金</div>
+            <div class="info-value">{{ reward }}元</div>
+          </ion-col>
+        </ion-row>
+      </ion-grid>
+    </ion-card-content>
+  </ion-card>
+  
+  <!-- 3D效果的圆 -->
+  <div class="wave-container" (click)="navigateToTreePage()">
+    <div class="wave-circle">
+      <div class="wave">
+        <div class="wave-inner">
+          <span class="start-self-discipline">开始自律</span>
+        </div>
+      </div>
+    </div>
+  </div>
+
+  <!-- 每日小习惯 -->
+  <div class="daily-habit">
+    <div class="daily-habit-line"></div>
+    <div class="daily-habit-text">每日小习惯</div>
+  </div>
+
+  <!-- 每日小习惯按钮 -->
+  <div class="button-container">
+    <ion-button *ngFor="let button of buttons; let i = index" (click)="onButtonClick(i)" [color]="button.color" class="custom-button">
+      <ion-icon [name]="button.icon"></ion-icon>
+      <p>{{ button.text }}</p>
+    </ion-button>
+  </div>
+  <div class="habit-text-div">
+    <p class="habit-text centered" [ngClass]="{'success-text': allButtonsSuccess, 'failure-text': anyButtonFailure}">{{ habitText }}</p>
+  </div>
+</ion-content>

+ 174 - 0
src/app/home/home.page.scss

@@ -0,0 +1,174 @@
+ion-searchbar {
+  --background: #f4f4f4;
+  margin: 10px;
+  border-radius: 10px;
+}
+
+.info-box {
+  text-align: center;
+  font-weight: bold;
+}
+
+.info-value {
+  text-align: center;
+  margin-top: 10px;
+  font-size: 1.2em;
+  color: #888;
+}
+
+.wave-container {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  height: 200px;
+  position: relative;
+  margin: 20px 0;
+}
+
+.wave-circle {
+  width: 150px;
+  height: 150px;
+  background: radial-gradient(circle at 50% 50%, #6ec1e4, #378ab7);
+  border-radius: 50%;
+  position: relative;
+  overflow: hidden;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
+}
+
+/* .wave {
+  position: absolute;
+  width: 200%;
+  height: 200%;
+  top: -75%;
+  left: -50%;
+  background: rgba(255, 255, 255, 0.4);
+  border-radius: 50%;
+  animation: wave 4s infinite linear;
+} */
+
+.wave-inner {
+  width: 150px;
+  height: 150px;
+  background-color: #6ec1e4;
+  border-radius: 50%;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  cursor: pointer;
+  transition: transform 0.3s ease-in-out;
+  color: #ffffff;
+  font-size: 1.2rem;
+  font-weight: bold;
+  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
+}
+
+/* @keyframes wave {
+  0% {
+    transform: translateX(-50%) translateY(-50%) rotate(0deg);
+  }
+  100% {
+    transform: translateX(-50%) translateY(-50%) rotate(360deg);
+  }
+} */
+
+
+// 每日小习惯
+.daily-habit {
+  display: flex;
+  align-items: center;
+  margin: 20px 0;
+}
+
+.daily-habit-line {
+  width: 5px;
+  height: 20px;
+  background-color: green;
+  margin-right: 10px;
+}
+
+.daily-habit-text {
+  font-size: 1.2em;
+  color: #666;
+}
+
+.habit-button {
+  width: 60px;
+  height: 60px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  cursor: pointer;
+  transition: transform 0.3s ease-in-out;
+  color: #ffffff;
+  font-size: 1.2rem;
+  font-weight: bold;
+  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
+}
+
+/* @keyframes wave {
+  0% {
+    transform: translateX(-50%) translateY(-50%) rotate(0deg);
+  }
+  100% {
+    transform: translateX(-50%) translateY(-50%) rotate(360deg);
+  }
+} */
+
+
+
+//每日习惯css
+.button-container {
+  display: flex;
+  flex-wrap: wrap;
+  justify-content: center;
+
+  .custom-button {
+    margin: 10px;
+    width: calc(33.33% - 20px);
+    border-radius: 20px;
+  }
+
+  ion-icon {
+    margin-bottom: 10px; // 调整图标与文字之间的间距
+  }
+
+  p {
+    text-align: center;
+    font-weight: bold;
+    display: flex;
+    justify-content: center; // 水平居中
+    align-items: center; // 垂直居中
+    flex-wrap: wrap; // 允许文字换行
+    line-height: 1; // 保持文字垂直居中
+  }
+}
+
+
+  .success-text {
+    color: #32db64; // 荧光绿
+  }
+
+  .failure-text {
+    color: #ff4d4f; // 荧光红
+  }
+
+
+.habit-text {
+  margin-left: 10px;
+  text-align: center;
+  margin-top: 20px;
+  font-weight: bold;
+  height: 50px; // 设置固定高度以垂直居中
+
+  &.centered {
+    
+    justify-content: right; // 水平居中
+    align-items: center; // 垂直居中
+  }
+}
+.daily-habit{
+  margin-left: 10px;
+}

+ 199 - 3
src/app/home/home.page.ts

@@ -1,4 +1,7 @@
-import { Component, OnInit } from '@angular/core';
+import { Component, OnInit, OnDestroy } from '@angular/core';
+import { AlertController, NavController } from '@ionic/angular';
+import { Router } from '@angular/router';
+import * as Parse from 'parse';
 
 @Component({
   selector: 'app-home',
@@ -6,10 +9,203 @@ import { Component, OnInit } from '@angular/core';
   styleUrls: ['./home.page.scss'],
 })
 export class HomePage implements OnInit {
+  initial: number = 0;
+  current: number = 0;
+  target: number = 0;
+  reward: number = 0;
+  username: string = ''; // 当前用户的用户名
+  blueColor: boolean = false;
+  
+  constructor(
+    private alertController: AlertController,
+    private router: Router,
+    private navCtrl: NavController,
+  ) {}
 
-  constructor() { }
+  ngOnInit() {}
 
-  ngOnInit() {
+  ionViewDidEnter() {
+    this.loadUserData();
   }
 
+  ngOnDestroy() {}
+
+  async loadUserData() {
+    const currentUser = Parse.User.current();
+    if (currentUser) {
+      this.username = currentUser.getUsername()!;
+      this.loadData();
+    } else {
+      this.username = '未登录';
+      this.loadData();
+    }
+    console.log("tab1:" + this.username);
+  }
+
+  async loadData() {
+    try {
+      const query = new Parse.Query('weight_status');
+      query.equalTo('username', this.username); // 查找当前用户的数据
+      const weightStatus = await query.first();
+      if (weightStatus) {
+        this.initial = weightStatus.get('initial') || 0;
+        this.current = weightStatus.get('current') || 0;
+        this.target = weightStatus.get('target') || 0;
+        this.reward = this.calculateReward(this.initial, this.target);
+      }
+    } catch (error) {
+      console.error('Error loading data', error);
+    }
+  }
+
+  calculateReward(initial: number, target: number): number {
+    return (initial - target) * 10;
+  }
+
+  async openEditModal() {
+    if (this.username == '未登录') {
+      // 如果用户未登录,则显示登录提示
+      this.presentLoginAlert();
+      return;
+    }
+
+    const alert = await this.alertController.create({
+      header: '编辑体重信息',
+      subHeader: '请根据您的需求编辑以下信息',
+      inputs: [
+        {
+          name: 'initial',
+          type: 'number',
+          placeholder: '初始',
+          value: this.initial.toString()
+        },
+        {
+          name: 'current',
+          type: 'number',
+          placeholder: '当前',
+          value: this.current.toString()
+        },
+        {
+          name: 'target',
+          type: 'number',
+          placeholder: '目标',
+          value: this.target.toString()
+        },
+        {
+          name: 'reward',
+          type: 'number',
+          placeholder: '赏金',
+          value: this.reward.toString(),
+          disabled: true // 禁用输入框,显示但不能编辑
+        }
+      ],
+      buttons: [
+        {
+          text: '取消',
+          role: 'cancel'
+        },
+        {
+          text: '保存',
+          handler: async (data) => {
+            try {
+              const query = new Parse.Query('weight_status');
+              query.equalTo('username', this.username); // 查找当前用户的数据
+              let weightStatus = await query.first();
+              if (!weightStatus) {
+                weightStatus = new Parse.Object('weight_status');
+              }
+              const rewardValue = this.calculateReward(Number(data.initial), Number(data.target));
+              weightStatus.set('username', this.username);
+              weightStatus.set('initial', Number(data.initial));
+              weightStatus.set('current', Number(data.current));
+              weightStatus.set('target', Number(data.target));
+              weightStatus.set('reward', rewardValue);
+              await weightStatus.save();
+              this.loadData(); // 更新本地数据
+            } catch (error) {
+              console.error('Error updating data', error);
+            }
+          }
+        }
+      ]
+    });
+
+    await alert.present();
+  }
+
+  async presentLoginAlert() {
+    const alert = await this.alertController.create({
+      header: '未登录',
+      message: '请先登录以继续操作',
+      buttons: [
+        {
+          text: '取消',
+          role: 'cancel'
+        },
+        {
+          text: '去登录',
+          handler: () => {
+            this.navCtrl.navigateForward('/user/login');
+          }
+        }
+      ]
+    });
+
+    await alert.present();
+  }
+
+  toggleButtonColor(habit: string) {
+    this.blueColor = !this.blueColor;
+  }
+
+  //每日习惯按钮颜色变化
+  buttons = [
+    { text: '足量饮水', color: 'light', icon: 'water' },
+    { text: '干净饮食', color: 'light', icon: 'nutrition' },
+    { text: '健康作息', color: 'light', icon: 'bed' },
+    { text: '有氧', color: 'light', icon: 'bicycle' },
+    { text: '力量', color: 'light', icon: 'barbell' },
+    { text: '拉伸', color: 'light', icon: 'body' }
+  ];
+
+  habitText = '今日习惯待保持';
+
+  onButtonClick(index: number) {
+    const button = this.buttons[index];
+    switch(button.color) {
+      case 'light':
+        button.color = 'success';
+        break;
+      case 'success':
+        button.color = 'danger';
+        break;
+      case 'danger':
+        button.color = 'light';
+        break;
+    }
+  
+    this.checkHabitText();
+  }
+  
+  checkHabitText() {
+    if (this.buttons.every(btn => btn.color === 'success')) {
+      this.habitText = '你成功保持了良好的习惯';
+    } else if (this.buttons.some(btn => btn.color === 'danger')) {
+      this.habitText = '今日好习惯保持失败,再接再厉';
+    } else {
+      this.habitText = '今日习惯待保持';
+    }
+  }
+  
+  get allButtonsSuccess() {
+    return this.buttons.every(btn => btn.color === 'success');
+  }
+  
+  get anyButtonFailure() {
+    return this.buttons.some(btn => btn.color === 'danger');
+  }
+
+  navigateToTreePage() {
+    this.router.navigate(['/tabs/timer']);
+  }
 }

+ 17 - 0
src/app/mine/mine-routing.module.ts

@@ -0,0 +1,17 @@
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+
+import { MinePage } from './mine.page';
+
+const routes: Routes = [
+  {
+    path: '',
+    component: MinePage
+  }
+];
+
+@NgModule({
+  imports: [RouterModule.forChild(routes)],
+  exports: [RouterModule],
+})
+export class MinePageRoutingModule {}

+ 20 - 0
src/app/mine/mine.module.ts

@@ -0,0 +1,20 @@
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { FormsModule } from '@angular/forms';
+
+import { IonicModule } from '@ionic/angular';
+
+import { MinePageRoutingModule } from './mine-routing.module';
+
+import { MinePage } from './mine.page';
+
+@NgModule({
+  imports: [
+    CommonModule,
+    FormsModule,
+    IonicModule,
+    MinePageRoutingModule
+  ],
+  declarations: [MinePage]
+})
+export class MinePageModule {}

+ 0 - 0
src/app/tab3/tab3.page.html → src/app/mine/mine.page.html


+ 20 - 0
src/app/mine/mine.page.scss

@@ -0,0 +1,20 @@
+.avatar-img {
+  width: 100%;
+  height: 100%;
+  border-radius: 50%;
+  object-fit: cover;
+}
+
+ion-item.button {
+  --background-hover: rgba(0, 0, 0, 0.1);
+  --background-activated: rgba(0, 0, 0, 0.2);
+  transition: background-color 0.2s;
+
+  &:hover {
+    background-color: var(--background-hover);
+  }
+
+  &:active {
+    background-color: var(--background-activated);
+  }
+}

+ 17 - 0
src/app/mine/mine.page.spec.ts

@@ -0,0 +1,17 @@
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+import { MinePage } from './mine.page';
+
+describe('MinePage', () => {
+  let component: MinePage;
+  let fixture: ComponentFixture<MinePage>;
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(MinePage);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  });
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});

+ 4 - 4
src/app/tab3/tab3.page.ts → src/app/mine/mine.page.ts

@@ -3,11 +3,11 @@ import { NavController, ToastController } from '@ionic/angular';
 import * as Parse from "parse";
 
 @Component({
-  selector: 'app-tab3',
-  templateUrl: './tab3.page.html',
-  styleUrls: ['./tab3.page.scss']
+  selector: 'app-mine',
+  templateUrl: './mine.page.html',
+  styleUrls: ['./mine.page.scss'],
 })
-export class Tab3Page {
+export class MinePage {
 
   constructor(private navCtrl: NavController, private toastController: ToastController) {}
 

+ 0 - 16
src/app/tab1/tab1-routing.module.ts

@@ -1,16 +0,0 @@
-import { NgModule } from '@angular/core';
-import { RouterModule, Routes } from '@angular/router';
-import { Tab1Page } from './tab1.page';
-
-const routes: Routes = [
-  {
-    path: '',
-    component: Tab1Page,
-  }
-];
-
-@NgModule({
-  imports: [RouterModule.forChild(routes)],
-  exports: [RouterModule]
-})
-export class Tab1PageRoutingModule {}

+ 0 - 20
src/app/tab1/tab1.module.ts

@@ -1,20 +0,0 @@
-import { IonicModule } from '@ionic/angular';
-import { NgModule } from '@angular/core';
-import { CommonModule } from '@angular/common';
-import { FormsModule } from '@angular/forms';
-import { Tab1Page } from './tab1.page';
-import { ExploreContainerComponentModule } from '../explore-container/explore-container.module';
-
-import { Tab1PageRoutingModule } from './tab1-routing.module';
-
-@NgModule({
-  imports: [
-    IonicModule,
-    CommonModule,
-    FormsModule,
-    ExploreContainerComponentModule,
-    Tab1PageRoutingModule
-  ],
-  declarations: [Tab1Page]
-})
-export class Tab1PageModule {}

+ 0 - 64
src/app/tab1/tab1.page.html

@@ -1,64 +0,0 @@
-<ion-header [translucent]="true">
-</ion-header>
-
-<ion-content [fullscreen]="true">
-  <ion-header collapse="condense">
-    <ion-toolbar>
-      <ion-searchbar placeholder="搜索"></ion-searchbar>
-    </ion-toolbar>
-  </ion-header>
-    
-  <!-- 方框 -->
-  <ion-card (click)="openEditModal()">
-    <ion-card-content>
-      <ion-grid>
-        <ion-row>
-          <ion-col size="3">
-            <div class="info-box">初始</div>
-            <div class="info-value">{{ initial }}KG</div>
-          </ion-col>
-          <ion-col size="3">
-            <div class="info-box">当前</div>
-            <div class="info-value">{{ current }}KG</div>
-          </ion-col>
-          <ion-col size="3">
-            <div class="info-box">目标</div>
-            <div class="info-value">{{ target }}KG</div>
-          </ion-col>
-          <ion-col size="3">
-            <div class="info-box">赏金</div>
-            <div class="info-value">{{ reward }}元</div>
-          </ion-col>
-        </ion-row>
-      </ion-grid>
-    </ion-card-content>
-  </ion-card>
-  
-  <!-- 3D效果的圆 -->
-  <div class="wave-container" (click)="navigateToTreePage()">
-    <div class="wave-circle">
-      <div class="wave">
-        <div class="wave-inner">
-          <span class="start-self-discipline">开始自律</span>
-        </div>
-      </div>
-    </div>
-  </div>
-
-  <!-- 每日小习惯 -->
-  <div class="daily-habit">
-    <div class="daily-habit-line"></div>
-    <div class="daily-habit-text">每日小习惯</div>
-  </div>
-
-  <!-- 每日小习惯按钮 -->
-  <div class="button-container">
-    <ion-button *ngFor="let button of buttons; let i = index" (click)="onButtonClick(i)" [color]="button.color" class="custom-button">
-      <ion-icon [name]="button.icon"></ion-icon>
-      <p>{{ button.text }}</p>
-    </ion-button>
-  </div>
-  <div class="habit-text-div">
-    <p class="habit-text centered" [ngClass]="{'success-text': allButtonsSuccess, 'failure-text': anyButtonFailure}">{{ habitText }}</p>
-  </div>
-</ion-content>

+ 0 - 174
src/app/tab1/tab1.page.scss

@@ -1,174 +0,0 @@
-ion-searchbar {
-  --background: #f4f4f4;
-  margin: 10px;
-  border-radius: 10px;
-}
-
-.info-box {
-  text-align: center;
-  font-weight: bold;
-}
-
-.info-value {
-  text-align: center;
-  margin-top: 10px;
-  font-size: 1.2em;
-  color: #888;
-}
-
-.wave-container {
-  display: flex;
-  justify-content: center;
-  align-items: center;
-  height: 200px;
-  position: relative;
-  margin: 20px 0;
-}
-
-.wave-circle {
-  width: 150px;
-  height: 150px;
-  background: radial-gradient(circle at 50% 50%, #6ec1e4, #378ab7);
-  border-radius: 50%;
-  position: relative;
-  overflow: hidden;
-  display: flex;
-  justify-content: center;
-  align-items: center;
-  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
-}
-
-/* .wave {
-  position: absolute;
-  width: 200%;
-  height: 200%;
-  top: -75%;
-  left: -50%;
-  background: rgba(255, 255, 255, 0.4);
-  border-radius: 50%;
-  animation: wave 4s infinite linear;
-} */
-
-.wave-inner {
-  width: 150px;
-  height: 150px;
-  background-color: #6ec1e4;
-  border-radius: 50%;
-  display: flex;
-  justify-content: center;
-  align-items: center;
-  cursor: pointer;
-  transition: transform 0.3s ease-in-out;
-  color: #ffffff;
-  font-size: 1.2rem;
-  font-weight: bold;
-  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
-}
-
-/* @keyframes wave {
-  0% {
-    transform: translateX(-50%) translateY(-50%) rotate(0deg);
-  }
-  100% {
-    transform: translateX(-50%) translateY(-50%) rotate(360deg);
-  }
-} */
-
-
-// 每日小习惯
-.daily-habit {
-  display: flex;
-  align-items: center;
-  margin: 20px 0;
-}
-
-.daily-habit-line {
-  width: 5px;
-  height: 20px;
-  background-color: green;
-  margin-right: 10px;
-}
-
-.daily-habit-text {
-  font-size: 1.2em;
-  color: #666;
-}
-
-.habit-button {
-  width: 60px;
-  height: 60px;
-  display: flex;
-  justify-content: center;
-  align-items: center;
-  cursor: pointer;
-  transition: transform 0.3s ease-in-out;
-  color: #ffffff;
-  font-size: 1.2rem;
-  font-weight: bold;
-  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
-}
-
-/* @keyframes wave {
-  0% {
-    transform: translateX(-50%) translateY(-50%) rotate(0deg);
-  }
-  100% {
-    transform: translateX(-50%) translateY(-50%) rotate(360deg);
-  }
-} */
-
-
-
-//每日习惯css
-.button-container {
-  display: flex;
-  flex-wrap: wrap;
-  justify-content: center;
-
-  .custom-button {
-    margin: 10px;
-    width: calc(33.33% - 20px);
-    border-radius: 20px;
-  }
-
-  ion-icon {
-    margin-bottom: 10px; // 调整图标与文字之间的间距
-  }
-
-  p {
-    text-align: center;
-    font-weight: bold;
-    display: flex;
-    justify-content: center; // 水平居中
-    align-items: center; // 垂直居中
-    flex-wrap: wrap; // 允许文字换行
-    line-height: 1; // 保持文字垂直居中
-  }
-}
-
-
-  .success-text {
-    color: #32db64; // 荧光绿
-  }
-
-  .failure-text {
-    color: #ff4d4f; // 荧光红
-  }
-
-
-.habit-text {
-  margin-left: 10px;
-  text-align: center;
-  margin-top: 20px;
-  font-weight: bold;
-  height: 50px; // 设置固定高度以垂直居中
-
-  &.centered {
-    
-    justify-content: right; // 水平居中
-    align-items: center; // 垂直居中
-  }
-}
-.daily-habit{
-  margin-left: 10px;
-}

+ 0 - 27
src/app/tab1/tab1.page.spec.ts

@@ -1,27 +0,0 @@
-import { ComponentFixture, TestBed } from '@angular/core/testing';
-import { IonicModule } from '@ionic/angular';
-import { ExploreContainerComponentModule } from '../explore-container/explore-container.module';
-import { Tab1Page } from './tab1.page';
-import{Component}from'@angular/core';
-
-
-
-describe('Tab1Page', () => {
-  let component: Tab1Page;
-  let fixture: ComponentFixture<Tab1Page>;
-
-  beforeEach(async () => {
-    await TestBed.configureTestingModule({
-      declarations: [Tab1Page],
-      imports: [IonicModule.forRoot(), ExploreContainerComponentModule]
-    }).compileComponents();
-
-    fixture = TestBed.createComponent(Tab1Page);
-    component = fixture.componentInstance;
-    fixture.detectChanges();
-  });
-
-  it('should create', () => {
-    expect(component).toBeTruthy();
-  });
-});

+ 0 - 211
src/app/tab1/tab1.page.ts

@@ -1,211 +0,0 @@
-import { Component, OnInit, OnDestroy } from '@angular/core';
-import { AlertController, NavController } from '@ionic/angular';
-import { Router } from '@angular/router';
-import * as Parse from 'parse';
-
-@Component({
-  selector: 'app-tab1',
-  templateUrl: 'tab1.page.html',
-  styleUrls: ['tab1.page.scss']
-})
-export class Tab1Page implements OnInit, OnDestroy {
-  initial: number = 0;
-  current: number = 0;
-  target: number = 0;
-  reward: number = 0;
-  username: string = ''; // 当前用户的用户名
-  blueColor: boolean = false;
-  
-  constructor(
-    private alertController: AlertController,
-    private router: Router,
-    private navCtrl: NavController,
-  ) {}
-
-  ngOnInit() {}
-
-  ionViewDidEnter() {
-    this.loadUserData();
-  }
-
-  ngOnDestroy() {}
-
-  async loadUserData() {
-    const currentUser = Parse.User.current();
-    if (currentUser) {
-      this.username = currentUser.getUsername()!;
-      this.loadData();
-    } else {
-      this.username = '未登录';
-      this.loadData();
-    }
-    console.log("tab1:" + this.username);
-  }
-
-  async loadData() {
-    try {
-      const query = new Parse.Query('weight_status');
-      query.equalTo('username', this.username); // 查找当前用户的数据
-      const weightStatus = await query.first();
-      if (weightStatus) {
-        this.initial = weightStatus.get('initial') || 0;
-        this.current = weightStatus.get('current') || 0;
-        this.target = weightStatus.get('target') || 0;
-        this.reward = this.calculateReward(this.initial, this.target);
-      }
-    } catch (error) {
-      console.error('Error loading data', error);
-    }
-  }
-
-  calculateReward(initial: number, target: number): number {
-    return (initial - target) * 10;
-  }
-
-  async openEditModal() {
-    if (this.username == '未登录') {
-      // 如果用户未登录,则显示登录提示
-      this.presentLoginAlert();
-      return;
-    }
-
-    const alert = await this.alertController.create({
-      header: '编辑体重信息',
-      subHeader: '请根据您的需求编辑以下信息',
-      inputs: [
-        {
-          name: 'initial',
-          type: 'number',
-          placeholder: '初始',
-          value: this.initial.toString()
-        },
-        {
-          name: 'current',
-          type: 'number',
-          placeholder: '当前',
-          value: this.current.toString()
-        },
-        {
-          name: 'target',
-          type: 'number',
-          placeholder: '目标',
-          value: this.target.toString()
-        },
-        {
-          name: 'reward',
-          type: 'number',
-          placeholder: '赏金',
-          value: this.reward.toString(),
-          disabled: true // 禁用输入框,显示但不能编辑
-        }
-      ],
-      buttons: [
-        {
-          text: '取消',
-          role: 'cancel'
-        },
-        {
-          text: '保存',
-          handler: async (data) => {
-            try {
-              const query = new Parse.Query('weight_status');
-              query.equalTo('username', this.username); // 查找当前用户的数据
-              let weightStatus = await query.first();
-              if (!weightStatus) {
-                weightStatus = new Parse.Object('weight_status');
-              }
-              const rewardValue = this.calculateReward(Number(data.initial), Number(data.target));
-              weightStatus.set('username', this.username);
-              weightStatus.set('initial', Number(data.initial));
-              weightStatus.set('current', Number(data.current));
-              weightStatus.set('target', Number(data.target));
-              weightStatus.set('reward', rewardValue);
-              await weightStatus.save();
-              this.loadData(); // 更新本地数据
-            } catch (error) {
-              console.error('Error updating data', error);
-            }
-          }
-        }
-      ]
-    });
-
-    await alert.present();
-  }
-
-  async presentLoginAlert() {
-    const alert = await this.alertController.create({
-      header: '未登录',
-      message: '请先登录以继续操作',
-      buttons: [
-        {
-          text: '取消',
-          role: 'cancel'
-        },
-        {
-          text: '去登录',
-          handler: () => {
-            this.navCtrl.navigateForward('/user/login');
-          }
-        }
-      ]
-    });
-
-    await alert.present();
-  }
-
-  toggleButtonColor(habit: string) {
-    this.blueColor = !this.blueColor;
-  }
-
-  //每日习惯按钮颜色变化
-  buttons = [
-    { text: '足量饮水', color: 'light', icon: 'water' },
-    { text: '干净饮食', color: 'light', icon: 'nutrition' },
-    { text: '健康作息', color: 'light', icon: 'bed' },
-    { text: '有氧', color: 'light', icon: 'bicycle' },
-    { text: '力量', color: 'light', icon: 'barbell' },
-    { text: '拉伸', color: 'light', icon: 'body' }
-  ];
-
-  habitText = '今日习惯待保持';
-
-  onButtonClick(index: number) {
-    const button = this.buttons[index];
-    switch(button.color) {
-      case 'light':
-        button.color = 'success';
-        break;
-      case 'success':
-        button.color = 'danger';
-        break;
-      case 'danger':
-        button.color = 'light';
-        break;
-    }
-  
-    this.checkHabitText();
-  }
-  
-  checkHabitText() {
-    if (this.buttons.every(btn => btn.color === 'success')) {
-      this.habitText = '你成功保持了良好的习惯';
-    } else if (this.buttons.some(btn => btn.color === 'danger')) {
-      this.habitText = '今日好习惯保持失败,再接再厉';
-    } else {
-      this.habitText = '今日习惯待保持';
-    }
-  }
-  
-  get allButtonsSuccess() {
-    return this.buttons.every(btn => btn.color === 'success');
-  }
-  
-  get anyButtonFailure() {
-    return this.buttons.some(btn => btn.color === 'danger');
-  }
-
-  navigateToTreePage() {
-    this.router.navigate(['/tabs/tree']);
-  }
-}

+ 0 - 17
src/app/tab2/tab2-routing.module.ts

@@ -1,17 +0,0 @@
-import { NgModule } from '@angular/core';
-import { RouterModule, Routes } from '@angular/router';
-import { Tab2Page } from './tab2.page';
-
-
-const routes: Routes = [
-  {
-    path: '',
-    component: Tab2Page,
-  }
-];
-
-@NgModule({
-  imports: [RouterModule.forChild(routes)],
-  exports: [RouterModule]
-})
-export class Tab2PageRoutingModule {}

+ 0 - 27
src/app/tab2/tab2.module.ts

@@ -1,27 +0,0 @@
-import { IonicModule } from '@ionic/angular';
-import { NgModule } from '@angular/core';
-import { CommonModule } from '@angular/common';
-import { FormsModule } from '@angular/forms';
-import { Tab2Page } from './tab2.page';
-import { ExploreContainerComponentModule } from '../explore-container/explore-container.module';
-
-import { Tab2PageRoutingModule } from './tab2-routing.module';
-
-import { CalendarModule, DateAdapter } from 'angular-calendar';
-import { adapterFactory } from 'angular-calendar/date-adapters/date-fns';
-
-@NgModule({
-  imports: [
-    IonicModule,
-    CommonModule,
-    FormsModule,
-    ExploreContainerComponentModule,
-    Tab2PageRoutingModule,
-    CalendarModule.forRoot({
-      provide: DateAdapter,
-      useFactory: adapterFactory,
-    }),
-  ],
-  declarations: [Tab2Page]
-})
-export class Tab2PageModule {}

+ 0 - 26
src/app/tab2/tab2.page.spec.ts

@@ -1,26 +0,0 @@
-import { ComponentFixture, TestBed } from '@angular/core/testing';
-import { IonicModule } from '@ionic/angular';
-
-import { ExploreContainerComponentModule } from '../explore-container/explore-container.module';
-
-import { Tab2Page } from './tab2.page';
-
-describe('Tab2Page', () => {
-  let component: Tab2Page;
-  let fixture: ComponentFixture<Tab2Page>;
-
-  beforeEach(async () => {
-    await TestBed.configureTestingModule({
-      declarations: [Tab2Page],
-      imports: [IonicModule.forRoot(), ExploreContainerComponentModule]
-    }).compileComponents();
-
-    fixture = TestBed.createComponent(Tab2Page);
-    component = fixture.componentInstance;
-    fixture.detectChanges();
-  });
-
-  it('should create', () => {
-    expect(component).toBeTruthy();
-  });
-});

+ 0 - 16
src/app/tab3/tab3-routing.module.ts

@@ -1,16 +0,0 @@
-import { NgModule } from '@angular/core';
-import { RouterModule, Routes } from '@angular/router';
-import { Tab3Page } from './tab3.page';
-
-const routes: Routes = [
-  {
-    path: '',
-    component: Tab3Page,
-  }
-];
-
-@NgModule({
-  imports: [RouterModule.forChild(routes)],
-  exports: [RouterModule]
-})
-export class Tab3PageRoutingModule {}

+ 0 - 20
src/app/tab3/tab3.module.ts

@@ -1,20 +0,0 @@
-import { IonicModule } from '@ionic/angular';
-import { NgModule } from '@angular/core';
-import { CommonModule } from '@angular/common';
-import { FormsModule } from '@angular/forms';
-import { Tab3Page } from './tab3.page';
-import { ExploreContainerComponentModule } from '../explore-container/explore-container.module';
-
-import { Tab3PageRoutingModule } from './tab3-routing.module';
-
-@NgModule({
-  imports: [
-    IonicModule,
-    CommonModule,
-    FormsModule,
-    ExploreContainerComponentModule,
-    Tab3PageRoutingModule
-  ],
-  declarations: [Tab3Page]
-})
-export class Tab3PageModule {}

+ 0 - 21
src/app/tab3/tab3.page.scss

@@ -1,21 +0,0 @@
-.avatar-img {
-      width: 100%;
-      height: 100%;
-      border-radius: 50%;
-      object-fit: cover;
-    }
-    
-    ion-item.button {
-      --background-hover: rgba(0, 0, 0, 0.1);
-      --background-activated: rgba(0, 0, 0, 0.2);
-      transition: background-color 0.2s;
-    
-      &:hover {
-        background-color: var(--background-hover);
-      }
-    
-      &:active {
-        background-color: var(--background-activated);
-      }
-    }
-    

+ 0 - 26
src/app/tab3/tab3.page.spec.ts

@@ -1,26 +0,0 @@
-import { ComponentFixture, TestBed } from '@angular/core/testing';
-import { IonicModule } from '@ionic/angular';
-
-import { ExploreContainerComponentModule } from '../explore-container/explore-container.module';
-
-import { Tab3Page } from './tab3.page';
-
-describe('Tab3Page', () => {
-  let component: Tab3Page;
-  let fixture: ComponentFixture<Tab3Page>;
-
-  beforeEach(async () => {
-    await TestBed.configureTestingModule({
-      declarations: [Tab3Page],
-      imports: [IonicModule.forRoot(), ExploreContainerComponentModule]
-    }).compileComponents();
-
-    fixture = TestBed.createComponent(Tab3Page);
-    component = fixture.componentInstance;
-    fixture.detectChanges();
-  });
-
-  it('should create', () => {
-    expect(component).toBeTruthy();
-  });
-});

+ 25 - 25
src/app/tabs/tabs-routing.module.ts

@@ -8,47 +8,47 @@ const routes: Routes = [
     component: TabsPage,
     children: [
       {
-        path: 'tab1',
-        loadChildren: () => import('../tab1/tab1.module').then(m => m.Tab1PageModule)
+        path: 'home',
+        loadChildren: () => import('../home/home.module').then(m => m.HomePageModule)
       },
+        {
+          path: "timer",
+          loadChildren: () => import('../../modules/tab/tree/tree.module').then(mod => mod.TreePageModule)
+        },
       {
         path: 'memo',
         loadChildren: () => import('../memo/memo.module').then(m => m.MemoPageModule)
       },
       {
-        path: 'tab2',
-        loadChildren: () => import('../tab2/tab2.module').then(m => m.Tab2PageModule)
-      },
-      {
-        path: 'tab3',
-        loadChildren: () => import('../tab3/tab3.module').then(m => m.Tab3PageModule)
-      },
-      {
-        path: 'go-load',
-        loadChildren: () => import('../../modules/user/mine/mine.module').then(mod => mod.MinePageModule)
-      },
-      {
-        path: "tree",
-        loadChildren: () => import('../../modules/tab/tree/tree.module').then(mod => mod.TreePageModule)
-      },
-      {
-        path: 'bounty-store',
-        loadChildren: () => import('../bounty-store/bounty-store.module').then(mod => mod.BountyStorePageModule)
-      },
+        path: 'chatpage',
+        loadChildren: () => import('../chatpage/chatpage.module').then( m => m.ChatpagePageModule)
+      }, 
+        {
+          path: 'chat',
+          loadChildren: () => import('../child-page/chat/chat.module').then(m => m.ChatPageModule)
+        },
       {
-        path: 'ai-chat',
-        loadChildren: () => import('../ai-chat/ai-chat.module').then( m => m.AiChatPageModule)
+        path: 'mine',
+        loadChildren: () => import('../mine/mine.module').then(m => m.MinePageModule)
       },
+        {
+          path: 'go-load',
+          loadChildren: () => import('../../modules/user/mine/mine.module').then(mod => mod.MinePageModule)
+        },
+        {
+          path: 'bounty-store',
+          loadChildren: () => import('../child-page/bounty-store/bounty-store.module').then(mod => mod.BountyStorePageModule)
+        },
       {
         path: '',
-        redirectTo: '/tabs/tab1',
+        redirectTo: '/tabs/home',
         pathMatch: 'full'
       }
     ]
   },
   {
     path: '',
-    redirectTo: '/tabs/tab1',
+    redirectTo: '/tabs/home',
     pathMatch: 'full'
   }
 ];

+ 2 - 3
src/app/tabs/tabs.page.html

@@ -1,6 +1,6 @@
 <ion-tabs>
   <ion-tab-bar slot="bottom">
-    <ion-tab-button tab="tab1" href="/tabs/tab1">
+    <ion-tab-button tab="home" href="/tabs/home">
       <ion-icon aria-hidden="true" name="scale-outline"></ion-icon>
       <ion-label>首页</ion-label>
     </ion-tab-button>
@@ -12,13 +12,12 @@
     </ion-tab-button>
 
     
-    <ion-tab-button tab="ai-chat" href="/tabs/ai-chat">
+    <ion-tab-button tab="chatpage" href="/tabs/chatpage">
       <ion-icon aria-hidden="true" name="chatbox-ellipses-outline"></ion-icon>
       <ion-label>ai对话</ion-label>
     </ion-tab-button>
 
 
-
     <ion-tab-button (click)="checkLogin()">
       <ion-icon aria-hidden="true" name="person"></ion-icon>
       <ion-label>我的</ion-label>

+ 1 - 1
src/app/tabs/tabs.page.ts

@@ -15,7 +15,7 @@ export class TabsPage {
     const currentUser = Parse.User.current();
     if (currentUser) {
       // 如果已登录,跳转到“我的”界面
-      this.navCtrl.navigateForward('/tabs/tab3');
+      this.navCtrl.navigateForward('/tabs/mine');
     } else {
       // 如果未登录,跳转到“登录”界面
       this.navCtrl.navigateForward('/tabs/go-load');

+ 0 - 0
src/app/explore-container/explore-container.component.html → src/modules/tab/tree/explore-container/explore-container.component.html


+ 0 - 0
src/app/explore-container/explore-container.component.scss → src/modules/tab/tree/explore-container/explore-container.component.scss


+ 0 - 0
src/app/explore-container/explore-container.component.spec.ts → src/modules/tab/tree/explore-container/explore-container.component.spec.ts


+ 0 - 0
src/app/explore-container/explore-container.component.ts → src/modules/tab/tree/explore-container/explore-container.component.ts


+ 0 - 0
src/app/explore-container/explore-container.module.ts → src/modules/tab/tree/explore-container/explore-container.module.ts


+ 1 - 1
src/modules/tab/tree/tree.page.spec.ts

@@ -2,7 +2,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
 import { IonicModule } from '@ionic/angular';
 import { TreePage } from './tree.page';
 
-import { ExploreContainerComponentModule } from 'src/app/explore-container/explore-container.module';
+import { ExploreContainerComponentModule } from 'src/modules/tab/tree/explore-container/explore-container.module';
 
 describe('TreePage', () => {
   let component: TreePage;

+ 2 - 2
src/modules/user/login/login.page.ts

@@ -41,7 +41,7 @@ export class LoginPage implements OnInit {
     }
     console.log(user);
     if (user?.id) {
-      this.navCtrl.navigateForward('/tabs/tab3'); // 导航到主页或其他页面
+      this.navCtrl.navigateForward('/tabs/mine'); // 导航到主页或其他页面
     }
   }
 
@@ -55,7 +55,7 @@ export class LoginPage implements OnInit {
       if (result?.id) {
         // 注册成功后立即加载用户数据
         this.loadUserData();
-        this.navCtrl.navigateForward('/tabs/tab3'); // 导航到主页或其他页面
+        this.navCtrl.navigateForward('/tabs/mine'); // 导航到主页或其他页面
       }
     } catch (error: any) {
       let message: string = "";