Bläddra i källkod

Daily habits-1.0

0210331 4 månader sedan
förälder
incheckning
8a8fcc827b
91 ändrade filer med 345 tillägg och 1895 borttagningar
  1. 0 29
      app/app-routing.module.ts
  2. 0 3
      app/app.component.html
  3. 0 0
      app/app.component.scss
  4. 0 21
      app/app.component.spec.ts
  5. 0 15
      app/app.component.ts
  6. 0 29
      app/app.module.ts
  7. 0 17
      app/calendar/calendar-routing.module.ts
  8. 0 20
      app/calendar/calendar.module.ts
  9. 0 13
      app/calendar/calendar.page.html
  10. 0 0
      app/calendar/calendar.page.scss
  11. 0 17
      app/calendar/calendar.page.spec.ts
  12. 0 15
      app/calendar/calendar.page.ts
  13. 0 4
      app/explore-container/explore-container.component.html
  14. 0 27
      app/explore-container/explore-container.component.scss
  15. 0 24
      app/explore-container/explore-container.component.spec.ts
  16. 0 12
      app/explore-container/explore-container.component.ts
  17. 0 14
      app/explore-container/explore-container.module.ts
  18. 0 16
      app/tab1/tab1-routing.module.ts
  19. 0 20
      app/tab1/tab1.module.ts
  20. 0 107
      app/tab1/tab1.page.html
  21. 0 138
      app/tab1/tab1.page.scss
  22. 0 27
      app/tab1/tab1.page.spec.ts
  23. 0 32
      app/tab1/tab1.page.ts
  24. 0 16
      app/tab2/tab2-routing.module.ts
  25. 0 27
      app/tab2/tab2.module.ts
  26. 0 44
      app/tab2/tab2.page.html
  27. 0 25
      app/tab2/tab2.page.scss
  28. 0 26
      app/tab2/tab2.page.spec.ts
  29. 0 32
      app/tab2/tab2.page.ts
  30. 0 16
      app/tab3/tab3-routing.module.ts
  31. 0 20
      app/tab3/tab3.module.ts
  32. 0 84
      app/tab3/tab3.page.html
  33. 0 21
      app/tab3/tab3.page.scss
  34. 0 26
      app/tab3/tab3.page.spec.ts
  35. 0 35
      app/tab3/tab3.page.ts
  36. 0 47
      app/tabs/tabs-routing.module.ts
  37. 0 19
      app/tabs/tabs.module.ts
  38. 0 23
      app/tabs/tabs.page.html
  39. 0 1
      app/tabs/tabs.page.scss
  40. 0 26
      app/tabs/tabs.page.spec.ts
  41. 0 24
      app/tabs/tabs.page.ts
  42. BIN
      assets/icon/favicon.png
  43. BIN
      assets/img/head.jpg
  44. 0 1
      assets/shapes.svg
  45. 0 3
      environments/environment.prod.ts
  46. 0 16
      environments/environment.ts
  47. 0 17
      modules/user/edit-info/edit-info-routing.module.ts
  48. 0 20
      modules/user/edit-info/edit-info.module.ts
  49. 0 47
      modules/user/edit-info/edit-info.page.html
  50. 0 0
      modules/user/edit-info/edit-info.page.scss
  51. 0 17
      modules/user/edit-info/edit-info.page.spec.ts
  52. 0 56
      modules/user/edit-info/edit-info.page.ts
  53. 0 17
      modules/user/login/login-routing.module.ts
  54. 0 20
      modules/user/login/login.module.ts
  55. 0 39
      modules/user/login/login.page.html
  56. 0 31
      modules/user/login/login.page.scss
  57. 0 17
      modules/user/login/login.page.spec.ts
  58. 0 86
      modules/user/login/login.page.ts
  59. 0 17
      modules/user/mine/mine-routing.module.ts
  60. 0 20
      modules/user/mine/mine.module.ts
  61. 0 16
      modules/user/mine/mine.page.html
  62. 0 27
      modules/user/mine/mine.page.scss
  63. 0 17
      modules/user/mine/mine.page.spec.ts
  64. 0 28
      modules/user/mine/mine.page.ts
  65. 0 14
      modules/user/user-routing.module.ts
  66. 0 14
      modules/user/user.module.ts
  67. 4 0
      src/app/app-routing.module.ts
  68. 26 57
      src/app/tab1/tab1.page.html
  69. 52 53
      src/app/tab1/tab1.page.scss
  70. 61 1
      src/app/tab1/tab1.page.ts
  71. 7 2
      src/app/tab3/tab3.page.html
  72. 18 4
      src/app/tab3/tab3.page.ts
  73. 4 0
      src/app/tabs/tabs-routing.module.ts
  74. 3 5
      src/app/tabs/tabs.page.html
  75. 13 1
      src/app/tabs/tabs.page.ts
  76. 0 0
      src/assets/img/tree.png
  77. 0 0
      src/assets/img/zilv.jpg
  78. 0 0
      src/modules/tab/tab-routing.module.ts
  79. 0 0
      src/modules/tab/tab.module.ts
  80. 0 0
      src/modules/tab/tree/tree-routing.module.ts
  81. 0 0
      src/modules/tab/tree/tree.module.ts
  82. 0 0
      src/modules/tab/tree/tree.page.html
  83. 0 0
      src/modules/tab/tree/tree.page.scss
  84. 0 0
      src/modules/tab/tree/tree.page.spec.ts
  85. 0 0
      src/modules/tab/tree/tree.page.ts
  86. 37 36
      src/modules/user/login/login.page.html
  87. 31 0
      src/modules/user/login/login.page.scss
  88. 49 56
      src/modules/user/login/login.page.ts
  89. 13 26
      src/modules/user/mine/mine.page.html
  90. 27 0
      src/modules/user/mine/mine.page.scss
  91. 0 2
      theme/variables.scss

+ 0 - 29
app/app-routing.module.ts

@@ -1,29 +0,0 @@
-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: 'calendar',
-    loadChildren: () => import('./calendar/calendar.module').then( m => m.CalendarPageModule)
-  },
-
-  {
-    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)
-  },
-];
-@NgModule({
-  imports: [
-    RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
-  ],
-  exports: [RouterModule]
-})
-export class AppRoutingModule {}

+ 0 - 3
app/app.component.html

@@ -1,3 +0,0 @@
-<ion-app>
-  <ion-router-outlet></ion-router-outlet>
-</ion-app>

+ 0 - 0
app/app.component.scss


+ 0 - 21
app/app.component.spec.ts

@@ -1,21 +0,0 @@
-import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
-import { TestBed } from '@angular/core/testing';
-
-import { AppComponent } from './app.component';
-
-describe('AppComponent', () => {
-
-  beforeEach(async () => {
-    await TestBed.configureTestingModule({
-      declarations: [AppComponent],
-      schemas: [CUSTOM_ELEMENTS_SCHEMA],
-    }).compileComponents();
-  });
-
-  it('should create the app', () => {
-    const fixture = TestBed.createComponent(AppComponent);
-    const app = fixture.componentInstance;
-    expect(app).toBeTruthy();
-  });
-
-});

+ 0 - 15
app/app.component.ts

@@ -1,15 +0,0 @@
-import { Component } from '@angular/core';
-
-// 根组件顶部引用并初始化Parse服务
-import * as Parse from "parse";
-Parse.initialize("dev");
-(Parse as any).serverURL = 'http://web2023.fmode.cn:9999/parse'
-
-@Component({
-  selector: 'app-root',
-  templateUrl: 'app.component.html',
-  styleUrls: ['app.component.scss'],
-})
-export class AppComponent {
-  constructor() {}
-}

+ 0 - 29
app/app.module.ts

@@ -1,29 +0,0 @@
-import { NgModule } from '@angular/core';
-import { BrowserModule } from '@angular/platform-browser';
-import { RouteReuseStrategy } from '@angular/router';
-
-import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
-
-import { AppRoutingModule } from './app-routing.module';
-import { AppComponent } from './app.component';
-import { FormsModule } from '@angular/forms';
-import { CalendarModule, DateAdapter } from 'angular-calendar';
-import { adapterFactory } from 'angular-calendar/date-adapters/date-fns';
-
-
-@NgModule({
-  declarations: [AppComponent],
-  imports: [
-    BrowserModule,
-    IonicModule.forRoot(),
-    AppRoutingModule,
-    FormsModule,
-    CalendarModule.forRoot({
-      provide: DateAdapter,
-      useFactory: adapterFactory,
-    }),
-  ],
-  providers: [{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy }],
-  bootstrap: [AppComponent],
-})
-export class AppModule {}

+ 0 - 17
app/calendar/calendar-routing.module.ts

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

+ 0 - 20
app/calendar/calendar.module.ts

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

+ 0 - 13
app/calendar/calendar.page.html

@@ -1,13 +0,0 @@
-<ion-header [translucent]="true">
-  <ion-toolbar>
-    <ion-title>calendar</ion-title>
-  </ion-toolbar>
-</ion-header>
-
-<ion-content [fullscreen]="true">
-  <ion-header collapse="condense">
-    <ion-toolbar>
-      <ion-title size="large">calendar</ion-title>
-    </ion-toolbar>
-  </ion-header>
-</ion-content>

+ 0 - 0
app/calendar/calendar.page.scss


+ 0 - 17
app/calendar/calendar.page.spec.ts

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

+ 0 - 15
app/calendar/calendar.page.ts

@@ -1,15 +0,0 @@
-import { Component, OnInit } from '@angular/core';
-
-@Component({
-  selector: 'app-calendar',
-  templateUrl: './calendar.page.html',
-  styleUrls: ['./calendar.page.scss'],
-})
-export class CalendarPage implements OnInit {
-
-  constructor() { }
-
-  ngOnInit() {
-  }
-
-}

+ 0 - 4
app/explore-container/explore-container.component.html

@@ -1,4 +0,0 @@
-<div id="container">
-  <strong>{{ name }}</strong>
-  <p>Explore <a target="_blank" rel="noopener noreferrer" href="https://ionicframework.com/docs/components">UI Components</a></p>
-</div>

+ 0 - 27
app/explore-container/explore-container.component.scss

@@ -1,27 +0,0 @@
-#container {
-  text-align: center;
-
-  position: absolute;
-  left: 0;
-  right: 0;
-  top: 50%;
-  transform: translateY(-50%);
-}
-
-#container strong {
-  font-size: 20px;
-  line-height: 26px;
-}
-
-#container p {
-  font-size: 16px;
-  line-height: 22px;
-
-  color: #8c8c8c;
-
-  margin: 0;
-}
-
-#container a {
-  text-decoration: none;
-}

+ 0 - 24
app/explore-container/explore-container.component.spec.ts

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

+ 0 - 12
app/explore-container/explore-container.component.ts

@@ -1,12 +0,0 @@
-import { Component, Input } from '@angular/core';
-
-@Component({
-  selector: 'app-explore-container',
-  templateUrl: './explore-container.component.html',
-  styleUrls: ['./explore-container.component.scss'],
-})
-export class ExploreContainerComponent {
-
-  @Input() name?: string;
-
-}

+ 0 - 14
app/explore-container/explore-container.module.ts

@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { CommonModule } from '@angular/common';
-import { FormsModule } from '@angular/forms';
-
-import { IonicModule } from '@ionic/angular';
-
-import { ExploreContainerComponent } from './explore-container.component';
-
-@NgModule({
-  imports: [ CommonModule, FormsModule, IonicModule],
-  declarations: [ExploreContainerComponent],
-  exports: [ExploreContainerComponent]
-})
-export class ExploreContainerComponentModule {}

+ 0 - 16
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
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 - 107
app/tab1/tab1.page.html

@@ -1,107 +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)="openModal()">
-    <ion-card-content>
-      <ion-grid>
-        <ion-row>
-          <ion-col size="3">
-            <div class="info-box">初始</div>
-            <div class="info-value">--KG</div>
-          </ion-col>
-          <ion-col size="3">
-            <div class="info-box">当前</div>
-            <div class="info-value">--KG</div>
-          </ion-col>
-          <ion-col size="3">
-            <div class="info-box">目标</div>
-            <div class="info-value">--KG</div>
-          </ion-col>
-          <ion-col size="3">
-            <div class="info-box">赏金</div>
-            <div class="info-value">--元</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>
-
-  
-   <!-- 大方框 -->
-  <ion-card>
-    <ion-card-content>
-      <ion-grid>
-        <ion-row>
-          <ion-col size="3">
-            <button class="habit-button" (click)="toggleButtonColor('运动')">
-              <ion-icon name="dumbbell"></ion-icon>
-              <div class="habit-label">运动</div>
-            </button>
-          </ion-col>
-          <ion-col size="3">
-            <ion-button shape="round" class="habit-button" (click)="toggleButtonColor('少吃')">
-              <ion-icon name="nutrition"></ion-icon>
-              <div>少吃</div>
-            </ion-button>
-          </ion-col>
-          <ion-col size="3">
-            <ion-button shape="round" class="habit-button" (click)="toggleButtonColor('喝水')">
-              <ion-icon name="water"></ion-icon>
-              <div>喝水</div>
-            </ion-button>
-          </ion-col>
-          <ion-col size="3">
-            <ion-button shape="round" class="habit-button" (click)="toggleButtonColor('吃蔬菜')">
-              <ion-icon name="leaf"></ion-icon>
-              <div>吃蔬菜</div>
-            </ion-button>
-          </ion-col>
-        </ion-row>
-        <ion-row>
-          <ion-col size="3">
-            <ion-button shape="round" class="habit-button" (click)="toggleButtonColor('水果')">
-              <ion-icon name="apple"></ion-icon>
-              <div>水果</div>
-            </ion-button>
-          </ion-col>
-          <ion-col size="3">
-            <ion-button shape="round" class="habit-button" (click)="toggleButtonColor('经常站立')">
-              <ion-icon name="walk"></ion-icon>
-              <div>经常站立</div>
-            </ion-button>
-          </ion-col>
-        </ion-row>
-      </ion-grid>
-    </ion-card-content>
-  </ion-card>
-</ion-content>
-  
-

+ 0 - 138
app/tab1/tab1.page.scss

@@ -1,138 +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: 120px;
-  height: 120px;
-  background-color: #3f51b5;
-  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;
-  font-size: 0.8em;
-  margin: 10px 0;
-  background-color: #fff;
-  border: 2px solid #000;
-  border-radius: 50%;
-  transition: background-color 0.3s;
-}
-
-.habit-button ion-icon {
-  font-size: 1.5em;
-}
-
-.habit-label {
-  text-align: center;
-  font-size: 0.8em;
-  color: #666;
-  margin-top: 5px;
-}
-
-.habit-button.blue {
-  background-color: #007bff; /* 蓝色背景 */
-}
-
-.habit-button.white {
-  background-color: #fff; /* 白色背景 */
-}
-
-// .habit-button div {
-//   font-size: 0.8em;
-//   margin-top: 5px;
-// }
-
-.habit-button:active {
-  transform: scale(0.9);
-  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
-}

+ 0 - 27
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 - 32
app/tab1/tab1.page.ts

@@ -1,32 +0,0 @@
-import { Component } from '@angular/core';
-import { AlertController } from '@ionic/angular';
-import { Router } from '@angular/router';
-
-@Component({
-  selector: 'app-tab1',
-  templateUrl: 'tab1.page.html',
-  styleUrls: ['tab1.page.scss']
-})
-export class Tab1Page {
-
-  constructor(private alertController: AlertController,private router: Router) {}
-
-  async openModal() {
-    const alert = await this.alertController.create({
-      header: '提示',
-      message: '弹窗了',
-      buttons: ['确定']
-    });
-    await alert.present();
-  }
-  blueColor:boolean=false;
-  toggleButtonColor(habit:string){
-    this.blueColor=!this.blueColor;
-  }
-
-  //3d圆点击事件
-  navigateToTreePage() {
-    this.router.navigate(['/tabs/tree']);
-  }
-}
-

+ 0 - 16
app/tab2/tab2-routing.module.ts

@@ -1,16 +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
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 - 44
app/tab2/tab2.page.html

@@ -1,44 +0,0 @@
-<ion-header>
-  <ion-toolbar>
-    <ion-title>备忘录</ion-title>
-  </ion-toolbar>
-</ion-header>
-
-<ion-content>
-  <!-- 搜索框 -->
-  <ion-item>
-    <ion-label position="floating">搜索备忘录</ion-label>
-    <ion-input [(ngModel)]="searchQuery"></ion-input>
-  </ion-item>
-
-  <!-- 备忘录输入 -->
-  <ion-item>
-    <ion-label position="floating">备忘录内容</ion-label>
-    <ion-input [(ngModel)]="memoContent"></ion-input>
-  </ion-item>
-  <ion-button expand="full" (click)="addMemo()">添加备忘录</ion-button>
-
-  <!-- 备忘录列表 -->
-  <ion-list>
-    <ion-item *ngFor="let memo of filteredMemos()">
-      {{ memo }}
-    </ion-item>
-  </ion-list>
-
-  <!-- 日历 -->
-  <!-- 日历 -->
-  <ion-card>
-    <ion-card-header>
-      <ion-card-title>日历</ion-card-title>
-    </ion-card-header>
-    <ion-card-content>
-      <div class="calendar-container">
-        <mwl-calendar-month-view
-          [viewDate]="viewDate"
-          [events]="events"
-          (dayClicked)="dayClicked($event.day)">
-        </mwl-calendar-month-view>
-      </div>
-    </ion-card-content>
-  </ion-card>
-</ion-content>

+ 0 - 25
app/tab2/tab2.page.scss

@@ -1,25 +0,0 @@
-ion-card {
-      margin: 20px 0;
-    }
-    
-ion-item {
-      margin: 10px 0;
-    }
-    
-ion-button {
-      margin: 20px 0;
-    }
-.calendar-container {
-      display: flex;
-      justify-content: center;
-      align-items: center;
-      width: 100%;
-      overflow-x: auto;
-      padding: 20px 0;
-    }
-    
-::ng-deep mwl-calendar-month-view {
-      width: 100%;
-      max-width: 100%;
-    }
-    

+ 0 - 26
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 - 32
app/tab2/tab2.page.ts

@@ -1,32 +0,0 @@
-import { Component } from '@angular/core';
-import { CalendarEvent } from 'angular-calendar';
-@Component({
-  selector: 'app-tab2',
-  templateUrl: 'tab2.page.html',
-  styleUrls: ['tab2.page.scss']
-})
-
-export class Tab2Page {
-  memoContent: string = '';
-  searchQuery: string = '';
-  memos: string[] = [];
-  viewDate: Date = new Date();
-  events: CalendarEvent[] = [];
-
-  constructor() {}
-
-  addMemo() {
-    if (this.memoContent.trim() !== '') {
-      this.memos.push(this.memoContent);
-      this.memoContent = '';
-    }
-  }
-
-  filteredMemos() {
-    return this.memos.filter((memo) => memo.includes(this.searchQuery));
-  }
-
-  dayClicked(day: any) {
-    console.log('Day clicked:', day);
-  }
-}

+ 0 - 16
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
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 - 84
app/tab3/tab3.page.html

@@ -1,84 +0,0 @@
-<ion-header [translucent]="true">
-</ion-header>
-
-<ion-content [fullscreen]="true">
-  <!-- <ion-header collapse="condense">
-    <ion-toolbar>
-      <ion-title size="large">Tab 3</ion-title>
-    </ion-toolbar>
-  </ion-header> -->
-  
-  <!-- 个人信息板块 -->
-  <ion-card>
-    <ion-card-header>
-      <ion-avatar>
-        <img src="assets/img/head.jpg" class="avatar-img">
-      </ion-avatar>
-      <ion-card-title>昵称:鱼聪明</ion-card-title>
-      <ion-card-subtitle>个性签名:坚持不懈,直到成功</ion-card-subtitle>
-    </ion-card-header>
-
-    <ion-card-content>
-      <ion-grid>
-        <ion-row>
-          <ion-col size="6">
-            打卡天数: 天
-          </ion-col>
-          <ion-col size="6">
-            累计减重: kg
-          </ion-col>
-        </ion-row>
-        <ion-row>
-          <ion-col size="6">
-            当前赏金: 元
-          </ion-col>
-          <ion-col size="6">
-            BMI指数:
-          </ion-col>
-        </ion-row>
-      </ion-grid>
-    </ion-card-content>
-  </ion-card>
-
-  <!-- 功能菜单 -->
-  <ion-list>
-    <ion-item button (click)="onItemClick('我的目标')">
-      <ion-icon name="body" slot="start"></ion-icon>
-      我的目标
-    </ion-item>
-    <ion-item button (click)="onItemClick('减肥搭子')">
-      <ion-icon name="people" slot="start"></ion-icon>
-      减肥搭子
-    </ion-item>
-    <ion-item button (click)="onItemClick('赏金商店')">
-      <ion-icon name="cash" slot="start"></ion-icon>
-      赏金商店
-    </ion-item>
-    <ion-item button (click)="onItemClick('我的账户')">
-      <ion-icon name="person" slot="start"></ion-icon>
-      我的账户
-    </ion-item>
-    <ion-item button (click)="onItemClick('背景设置')">
-      <ion-icon name="settings" slot="start"></ion-icon>
-      背景设置
-    </ion-item>
-    <ion-item button (click)="onItemClick('操作手册')">
-      <ion-icon name="book" slot="start"></ion-icon>
-      操作手册
-    </ion-item>
-    <ion-item button (click)="onItemClick('数据备份')">
-      <ion-icon name="cloud-download" slot="start"></ion-icon>
-      数据备份
-    </ion-item>
-    <ion-item button (click)="onItemClick('数据下载')">
-      <ion-icon name="download" slot="start"></ion-icon>
-      数据下载
-    </ion-item>
-    <!-- 登出按钮 -->
-    <ion-item button (click)="logout()">
-      <ion-icon name="log-out" slot="start"></ion-icon>
-      登出
-    </ion-item>
-  </ion-list>
-  
-</ion-content>

+ 0 - 21
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
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();
-  });
-});

+ 0 - 35
app/tab3/tab3.page.ts

@@ -1,35 +0,0 @@
-import { Component } from '@angular/core';
-import { NavController, ToastController } from '@ionic/angular';
-import * as Parse from "parse";
-
-@Component({
-  selector: 'app-tab3',
-  templateUrl: './tab3.page.html',
-  styleUrls: ['./tab3.page.scss']
-})
-export class Tab3Page {
-
-  constructor(private navCtrl: NavController, private toastController: ToastController) {}
-
-  async onItemClick(item: string) {
-    const toast = await this.toastController.create({
-      message: `Clicked on ${item}`,
-      duration: 2000,
-    });
-    toast.present();
-  }
-
-  async logout() {
-    try {
-      await Parse.User.logOut();
-      this.navCtrl.navigateRoot('/tabs/calendar'); // 登出后跳转到登录界面
-    } catch (error: any) {
-      console.error("Logout failed:", error);
-      const toast = await this.toastController.create({
-        message: `登出失败: ${error.message}`,
-        duration: 2000,
-      });
-      toast.present();
-    }
-  }
-}

+ 0 - 47
app/tabs/tabs-routing.module.ts

@@ -1,47 +0,0 @@
-import { NgModule } from '@angular/core';
-import { RouterModule, Routes } from '@angular/router';
-import { TabsPage } from './tabs.page';
-
-const routes: Routes = [
-  {
-    path: 'tabs',
-    component: TabsPage,
-    children: [
-      {
-        path: 'tab1',
-        loadChildren: () => import('../tab1/tab1.module').then(m => m.Tab1PageModule)
-      },
-      {
-        path: 'tab2',
-        loadChildren: () => import('../tab2/tab2.module').then(m => m.Tab2PageModule)
-      },
-      {
-        path: 'tab3',
-        loadChildren: () => import('../tab3/tab3.module').then(m => m.Tab3PageModule)
-      },
-      {
-        path: 'calendar',
-        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: '',
-        redirectTo: '/tabs/tab1',
-        pathMatch: 'full'
-      }
-    ]
-  },
-  {
-    path: '',
-    redirectTo: '/tabs/tab1',
-    pathMatch: 'full'
-  }
-];
-
-@NgModule({
-  imports: [RouterModule.forChild(routes)],
-})
-export class TabsPageRoutingModule {}

+ 0 - 19
app/tabs/tabs.module.ts

@@ -1,19 +0,0 @@
-import { IonicModule } from '@ionic/angular';
-import { NgModule } from '@angular/core';
-import { CommonModule } from '@angular/common';
-import { FormsModule } from '@angular/forms';
-
-import { TabsPageRoutingModule } from './tabs-routing.module';
-
-import { TabsPage } from './tabs.page';
-
-@NgModule({
-  imports: [
-    IonicModule,
-    CommonModule,
-    FormsModule,
-    TabsPageRoutingModule
-  ],
-  declarations: [TabsPage]
-})
-export class TabsPageModule {}

+ 0 - 23
app/tabs/tabs.page.html

@@ -1,23 +0,0 @@
-<ion-tabs>
-  <ion-tab-bar slot="bottom">
-    <ion-tab-button tab="tab1" href="/tabs/tab1">
-      <ion-icon aria-hidden="true" name="home"></ion-icon>
-      <ion-label>首页</ion-label>
-    </ion-tab-button>
-
-    <ion-tab-button tab="tab2" href="/tabs/tab2">
-      <ion-icon aria-hidden="true" name="pencil"></ion-icon>
-      <ion-label>记录一下</ion-label>
-    </ion-tab-button>
-
-    <ion-tab-button (click)="checkLogin()">
-      <ion-icon aria-hidden="true" name="person"></ion-icon>
-      <ion-label>我的</ion-label>
-    </ion-tab-button>
-    
-    <!-- <ion-tab-button tab="calendar" href="/tabs/calendar">
-      <ion-icon aria-hidden="true" name="calendar"></ion-icon>
-      <ion-label>日历</ion-label>
-    </ion-tab-button> -->
-  </ion-tab-bar>
-</ion-tabs>

+ 0 - 1
app/tabs/tabs.page.scss

@@ -1 +0,0 @@
-

+ 0 - 26
app/tabs/tabs.page.spec.ts

@@ -1,26 +0,0 @@
-import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
-import { ComponentFixture, TestBed } from '@angular/core/testing';
-
-import { TabsPage } from './tabs.page';
-
-describe('TabsPage', () => {
-  let component: TabsPage;
-  let fixture: ComponentFixture<TabsPage>;
-
-  beforeEach(async () => {
-    await TestBed.configureTestingModule({
-      declarations: [TabsPage],
-      schemas: [CUSTOM_ELEMENTS_SCHEMA],
-    }).compileComponents();
-  });
-
-  beforeEach(() => {
-    fixture = TestBed.createComponent(TabsPage);
-    component = fixture.componentInstance;
-    fixture.detectChanges();
-  });
-
-  it('should create', () => {
-    expect(component).toBeTruthy();
-  });
-});

+ 0 - 24
app/tabs/tabs.page.ts

@@ -1,24 +0,0 @@
-import { Component } from '@angular/core';
-import { NavController } from '@ionic/angular';
-import * as Parse from "parse";
-
-@Component({
-  selector: 'app-tabs',
-  templateUrl: 'tabs.page.html',
-  styleUrls: ['tabs.page.scss']
-})
-export class TabsPage {
-
-  constructor(private navCtrl: NavController) {}
-
-  async checkLogin() {
-    const currentUser = Parse.User.current();
-    if (currentUser) {
-      // 如果已登录,跳转到“我的”界面
-      this.navCtrl.navigateForward('/tabs/tab3');
-    } else {
-      // 如果未登录,跳转到“登录”界面
-      this.navCtrl.navigateForward('/tabs/calendar');
-    }
-  }
-}

BIN
assets/icon/favicon.png


BIN
assets/img/head.jpg


+ 0 - 1
assets/shapes.svg

@@ -1 +0,0 @@
-<svg width="350" height="140" xmlns="http://www.w3.org/2000/svg" style="background:#f6f7f9"><g fill="none" fill-rule="evenodd"><path fill="#F04141" style="mix-blend-mode:multiply" d="M61.905-34.23l96.194 54.51-66.982 54.512L22 34.887z"/><circle fill="#10DC60" style="mix-blend-mode:multiply" cx="155.5" cy="135.5" r="57.5"/><path fill="#3880FF" style="mix-blend-mode:multiply" d="M208.538 9.513l84.417 15.392L223.93 93.93z"/><path fill="#FFCE00" style="mix-blend-mode:multiply" d="M268.625 106.557l46.332-26.75 46.332 26.75v53.5l-46.332 26.75-46.332-26.75z"/><circle fill="#7044FF" style="mix-blend-mode:multiply" cx="299.5" cy="9.5" r="38.5"/><rect fill="#11D3EA" style="mix-blend-mode:multiply" transform="rotate(-60 148.47 37.886)" x="143.372" y="-7.056" width="10.196" height="89.884" rx="5.098"/><path d="M-25.389 74.253l84.86 8.107c5.498.525 9.53 5.407 9.004 10.905a10 10 0 0 1-.057.477l-12.36 85.671a10.002 10.002 0 0 1-11.634 8.42l-86.351-15.226c-5.44-.959-9.07-6.145-8.112-11.584l13.851-78.551a10 10 0 0 1 10.799-8.219z" fill="#7044FF" style="mix-blend-mode:multiply"/><circle fill="#0CD1E8" style="mix-blend-mode:multiply" cx="273.5" cy="106.5" r="20.5"/></g></svg>

+ 0 - 3
environments/environment.prod.ts

@@ -1,3 +0,0 @@
-export const environment = {
-  production: true
-};

+ 0 - 16
environments/environment.ts

@@ -1,16 +0,0 @@
-// This file can be replaced during build by using the `fileReplacements` array.
-// `ng build` replaces `environment.ts` with `environment.prod.ts`.
-// The list of file replacements can be found in `angular.json`.
-
-export const environment = {
-  production: false
-};
-
-/*
- * For easier debugging in development mode, you can import the following file
- * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
- *
- * This import should be commented out in production mode because it will have a negative impact
- * on performance if an error is thrown.
- */
-// import 'zone.js/plugins/zone-error';  // Included with Angular CLI.

+ 0 - 17
modules/user/edit-info/edit-info-routing.module.ts

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

+ 0 - 20
modules/user/edit-info/edit-info.module.ts

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

+ 0 - 47
modules/user/edit-info/edit-info.page.html

@@ -1,47 +0,0 @@
-<ion-header [translucent]="true">
-  <ion-toolbar>
-    <ion-title>资料编辑</ion-title>
-  </ion-toolbar>
-</ion-header>
-
-<ion-content [fullscreen]="true">
-  <ion-header collapse="condense">
-    <ion-toolbar>
-      <ion-title size="large">资料编辑</ion-title>
-    </ion-toolbar>
-  </ion-header>
-
-  <ion-card>
-    <ion-card-header>
-      <ion-card-title>{{currentUser?.get('username')}} - {{currentUser?.id}}</ion-card-title>
-    </ion-card-header>
-    <ion-card-content>
-      <ion-list>
-        <ion-item>
-          <ion-input label="姓名" type="text" [(ngModel)]="userInfo.name"></ion-input>
-        </ion-item>
-        <ion-item>
-          <ion-input label="手机" type="tel" [(ngModel)]="userInfo.mobile"></ion-input>
-        </ion-item>
-        <ion-item>
-          <ion-select label="性别" [(ngModel)]="userInfo.gender">
-            <ion-select-option value="男">男</ion-select-option>
-            <ion-select-option value="女">女</ion-select-option>
-          </ion-select>
-        </ion-item>
-        <ion-item>
-          <ion-label>生日</ion-label>
-          <ion-datetime-button datetime="birthday"></ion-datetime-button>
-          <ion-modal [keepContentsMounted]="true">
-            <ng-template>
-              <ion-datetime id="birthday" displayFormat="MM/DD/YYYY" [(ngModel)]="userInfo.birthday"></ion-datetime>
-            </ng-template>
-          </ion-modal>
-        </ion-item>
-      </ion-list>
-    </ion-card-content>
-  </ion-card>
-
-  <ion-button expand="block" (click)="save()">保存</ion-button>
-  <ion-button expand="block" (click)="cancel()">取消</ion-button>
-</ion-content>

+ 0 - 0
modules/user/edit-info/edit-info.page.scss


+ 0 - 17
modules/user/edit-info/edit-info.page.spec.ts

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

+ 0 - 56
modules/user/edit-info/edit-info.page.ts

@@ -1,56 +0,0 @@
-import { Component, OnInit } from '@angular/core';
-import { NavController } from '@ionic/angular';
-import * as Parse from 'parse';
-
-@Component({
-  selector: 'app-edit-info',
-  templateUrl: './edit-info.page.html',
-  styleUrls: ['./edit-info.page.scss'],
-})
-export class EditInfoPage implements OnInit {
-
-  userInfo: any = {
-    name: '',
-    mobile: '',
-    gender: '',
-    birthday: ''
-  };
-  currentUser:Parse.User|undefined
-  constructor(private navController: NavController) {}
-
-  ngOnInit() {
-    this.currentUser = Parse.User.current();
-    if (this.currentUser) {
-      // 修改uesrInfo赋值逻辑,仅加载被编辑的字段属性值
-      let json = this.currentUser.toJSON();
-      for (const key in json) {
-        if (this.userInfo.hasOwnProperty(key)) {
-          this.userInfo[key] = json[key]
-        }
-      }
-    }
-    console.log(this.userInfo)
-  }
-
-  save() {
-    this.currentUser = Parse.User.current();
-    if (this.currentUser) {
-      console.log(this.userInfo)
-      for (const key in this.userInfo) {
-        if (this.userInfo.hasOwnProperty(key)) {
-          this.currentUser.set(key, this.userInfo[key]);
-        }
-      }
-      this.currentUser.save().then(() => {
-        this.navController.back();
-      }).catch((error) => {
-        console.error('Error saving user data: ', error);
-      });
-    }
-  }
-
-  cancel() {
-    this.navController.back();
-  }
-
-}

+ 0 - 17
modules/user/login/login-routing.module.ts

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

+ 0 - 20
modules/user/login/login.module.ts

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

+ 0 - 39
modules/user/login/login.page.html

@@ -1,39 +0,0 @@
-<ion-content [fullscreen]="true" class="ion-text-center">
-  <div class="login-container">
-    <ion-card class="login-card">
-      <ion-card-header>
-        <ion-card-title>登录/注册</ion-card-title>
-      </ion-card-header>
-    
-      <ion-card-content>
-        <ion-list>
-          <ion-item lines="none">
-            <ion-label position="floating" class="label-login">账号</ion-label>
-            <ion-input [(ngModel)]="username" placeholder="请输入用户名"></ion-input>
-          </ion-item>
-          <ion-item lines="none">
-            <ion-label position="floating" class="label-login">密码</ion-label>
-            <ion-input [(ngModel)]="password" type="password" placeholder="请输入密码"></ion-input>
-          </ion-item>
-        </ion-list>
-      </ion-card-content>
-    
-      <ion-row class="ion-login">
-        <ion-col size="6">
-          <ion-button expand="block" (click)="login()" color="primary">登录</ion-button>
-        </ion-col>
-        <ion-col size="6">
-          <ion-button expand="block" (click)="register()" color="primary">注册</ion-button>
-        </ion-col>
-      </ion-row>
-  
-      <!-- 返回按钮 -->
-      <ion-row class="ion-back">
-        <ion-col size="12">
-          <ion-button expand="block" (click)="back()" color="primary">返回</ion-button>
-        </ion-col>
-      </ion-row>
-      
-    </ion-card>
-  </div>
-</ion-content>

+ 0 - 31
modules/user/login/login.page.scss

@@ -1,31 +0,0 @@
-//窗口居中
-.login-container {
-  display: flex;
-  justify-content: center;
-  align-items: center;
-  height: 90vh; /* 使用视窗高度,保证内容居中且不畸形 */
-  padding: 0px; /* 可根据需要调整内边距 */
-  box-sizing: border-box; /* 确保内边距不影响总宽度 */
-}
-
-.login-card {
-  max-width: 400px; /* 设置最大宽度,避免内容过于扩展 */
-  width: 100%; /* 宽度100%,确保内容在容器内部居中 */
-  text-align: center; /* 文本居中 */
-}
-
-//登录注册
-.label-login{
-  font-size:30px;
-}
-
-
-//返回按钮
-.ion-login{
-  margin:0px 30px 0px 30px;
-  padding: auto;
-}
-.ion-back{
-  margin:0px 30px 10px 30px;
-  padding: auto;
-}

+ 0 - 17
modules/user/login/login.page.spec.ts

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

+ 0 - 86
modules/user/login/login.page.ts

@@ -1,86 +0,0 @@
-import { Component, OnInit } from '@angular/core';
-import { AlertController, NavController } from '@ionic/angular';
-import * as Parse from "parse"
-
-@Component({
-  selector: 'app-login',
-  templateUrl: './login.page.html',
-  styleUrls: ['./login.page.scss'],
-})
-export class LoginPage implements OnInit {
-
-  username: string = ""
-  password: string = ""
-  
-  constructor(
-    private navCtrl: NavController,
-    private alertController: AlertController
-  ) { }
-
-  ngOnInit() { }
-
-  async login() {
-    let user;
-    try {
-      user = await Parse.User.logIn(this.username, this.password);
-    } catch (error: any) {
-      let message: string = "";
-      if (error?.message.indexOf("is required") > -1) {
-        message = "必须输入账号或邮箱";
-      }
-      if (error?.message.indexOf("Invalid username") > -1) {
-        message = "账号或密码错误,请检查";
-      }
-      this.presentAlert({
-        header: "登录失败",
-        subHeader: "状态码:" + error.code,
-        message: message || error.message
-      });
-    }
-    console.log(user);
-    if (user?.id) {
-      this.navCtrl.navigateForward('/tabs/tab3'); // 修改这里
-    }
-  }
-
-  async register() {
-    let user = new Parse.User();
-    user.set("username", this.username);
-    user.set("password", this.password);
-    try {
-      let result = await user.signUp();
-      console.log(result);
-      if (result?.id) {
-        this.navCtrl.navigateForward('/tabs/tab3'); // 修改这里
-      }
-    } catch (error: any) {
-      let message: string = "";
-      if (error?.message.indexOf("already exists") > -1) {
-        message = "该账号已存在请修改后重试";
-      }
-      if (error?.message.indexOf("empty") > -1) {
-        message = "账号不能为空请输入后重试";
-      }
-      this.presentAlert({
-        header: "注册失败",
-        subHeader: "状态码:" + error.code,
-        message: message || error.message
-      });
-    }
-  }
-
-  async presentAlert(options: { header: string, subHeader: string, message: string }) {
-    const alert = await this.alertController.create({
-      header: options?.header,
-      subHeader: options?.subHeader,
-      message: options?.message,
-      buttons: ['好的'],
-    });
-
-    await alert.present();
-  }
-
-  back() {
-    this.navCtrl.back();
-  }
-}

+ 0 - 17
modules/user/mine/mine-routing.module.ts

@@ -1,17 +0,0 @@
-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 {}

+ 0 - 20
modules/user/mine/mine.module.ts

@@ -1,20 +0,0 @@
-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 - 16
modules/user/mine/mine.page.html

@@ -1,16 +0,0 @@
-<ion-content [fullscreen]="true" class="ion-text-center ion-align-items-center">
-  <div class="login-container">
-    <img src="../../../assets/img/zilv.jpg" alt="Logo" class="app-logo">
-
-    <ion-card class="login-card">
-      <ion-card-header>
-        <ion-card-title>欢迎使用我们的App</ion-card-title>
-      </ion-card-header>
-
-      <ion-card-content class="ion-text-center">
-        <p>请登录或注册以继续使用我们的服务。</p>
-        <ion-button expand="block" color="primary" fill="solid" routerLink="/user/login">去登录</ion-button>
-      </ion-card-content>
-    </ion-card>
-  </div>
-</ion-content>

+ 0 - 27
modules/user/mine/mine.page.scss

@@ -1,27 +0,0 @@
-.ion-content {
-  display: flex;
-  justify-content: center;
-  align-items: center;
-  height: 0vh; /* 使用视窗高度,确保内容垂直居中 */
-}
-
-.login-container {
-  text-align: center; /* 文本居中 */
-  //max-width: 400px; /* 设置最大宽度,避免内容过于扩展 */
-  width: 100%; /* 宽度100%,确保内容在容器内部居中 */
-  padding: 0 10px; /* 可根据需要调整内边距 */
-  box-sizing: border-box; /* 确保内边距不影响总宽度 */
-}
-
-.login-card {
-  margin:0px 10px;
-  //max-width: 500px; /* 设置最大宽度,避免内容过于扩展 */
-  text-align: center; /* 文本居中 */
-}
-
-.app-logo {
-  padding-top: 100px;
-  max-width: 95%; /* 图片宽度最大为容器宽度 */
-  height: auto; /* 自动高度 */
-  padding-bottom: 20px;
-}

+ 0 - 17
modules/user/mine/mine.page.spec.ts

@@ -1,17 +0,0 @@
-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();
-  });
-});

+ 0 - 28
modules/user/mine/mine.page.ts

@@ -1,28 +0,0 @@
-import { Component, OnInit } from '@angular/core';
-// 由于Parse本身是js库,在ts中加载需要通过 * as Parse转换一下
-import * as Parse from "parse"
-@Component({
-  selector: 'app-mine',
-  templateUrl: './mine.page.html',
-  styleUrls: ['./mine.page.scss'],
-})
-export class MinePage implements OnInit {
-
-  constructor() {
-   
-  }
-
-  // 由于Parse.User.current()是随着localStorage变化的属性
-  // 为了避免首次复制后用户状态变化,页面不同步,通过get方法实现实时获取
-  user:Parse.User|undefined
-  async ngOnInit() {
-      this.user = await Parse.User.current()
-      setInterval(async ()=>{
-      this.user = await Parse.User.current()
-    },1000)
-  }
-  logout(){
-    Parse.User.logOut();
-  }
-
-}

+ 0 - 14
modules/user/user-routing.module.ts

@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { RouterModule, Routes } from '@angular/router';
-
-const routes: Routes = [
-    {path: 'login', loadChildren: () => import('./login/login.module').then(mod => mod.LoginPageModule)},
-    {path: 'mine', loadChildren: () => import('./mine/mine.module').then(mod => mod.MinePageModule)},
-    {path: 'edit/info', loadChildren: () => import('./edit-info/edit-info.module').then(mod => mod.EditInfoPageModule)},
-];
-
-@NgModule({
-  imports: [RouterModule.forChild(routes)],
-  exports: [RouterModule]
-})
-export class UserRoutingModule { }

+ 0 - 14
modules/user/user.module.ts

@@ -1,14 +0,0 @@
-import { NgModule } from '@angular/core';
-import { CommonModule } from '@angular/common';
-
-import { UserRoutingModule } from './user-routing.module';
-
-
-@NgModule({
-  declarations: [],
-  imports: [
-    CommonModule,
-    UserRoutingModule
-  ]
-})
-export class UserModule { }

+ 4 - 0
src/app/app-routing.module.ts

@@ -15,6 +15,10 @@ const routes: Routes = [
     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)
+  },
 ];
 @NgModule({
   imports: [

+ 26 - 57
src/app/tab1/tab1.page.html

@@ -33,70 +33,39 @@
       </ion-grid>
     </ion-card-content>
   </ion-card>
-
-  <!-- 3D效果的圆 -->
-  <div class="wave-container">
-    <div class="wave-circle">
-      <div class="wave">
-        <div class="wave-inner"></div>
+  
+<!-- 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="daily-habit">
+  <div class="daily-habit-line"></div>
+  <div class="daily-habit-text">每日小习惯</div>
+</div>
 
   
-   <!-- 大方框 -->
-  <ion-card>
-    <ion-card-content>
-      <ion-grid>
-        <ion-row>
-          <ion-col size="3">
-            <button class="habit-button" (click)="toggleButtonColor('运动')">
-              <ion-icon name="dumbbell"></ion-icon>
-              <div class="habit-label">运动</div>
-            </button>
-          </ion-col>
-          <ion-col size="3">
-            <ion-button shape="round" class="habit-button" (click)="toggleButtonColor('少吃')">
-              <ion-icon name="nutrition"></ion-icon>
-              <div>少吃</div>
-            </ion-button>
-          </ion-col>
-          <ion-col size="3">
-            <ion-button shape="round" class="habit-button" (click)="toggleButtonColor('喝水')">
-              <ion-icon name="water"></ion-icon>
-              <div>喝水</div>
-            </ion-button>
-          </ion-col>
-          <ion-col size="3">
-            <ion-button shape="round" class="habit-button" (click)="toggleButtonColor('吃蔬菜')">
-              <ion-icon name="leaf"></ion-icon>
-              <div>吃蔬菜</div>
-            </ion-button>
-          </ion-col>
-        </ion-row>
-        <ion-row>
-          <ion-col size="3">
-            <ion-button shape="round" class="habit-button" (click)="toggleButtonColor('水果')">
-              <ion-icon name="apple"></ion-icon>
-              <div>水果</div>
-            </ion-button>
-          </ion-col>
-          <ion-col size="3">
-            <ion-button shape="round" class="habit-button" (click)="toggleButtonColor('经常站立')">
-              <ion-icon name="walk"></ion-icon>
-              <div>经常站立</div>
-            </ion-button>
-          </ion-col>
-        </ion-row>
-      </ion-grid>
-    </ion-card-content>
-  </ion-card>
+   <!-- 每日小习惯按钮 -->
+   <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>
   
 

+ 52 - 53
src/app/tab1/tab1.page.scss

@@ -45,77 +45,76 @@ ion-searchbar {
   top: -75%;
   left: -50%;
   background: rgba(255, 255, 255, 0.4);
-  border-radius: 45%;
+  border-radius: 50%;
   animation: wave 4s infinite linear;
 }
 
-@keyframes wave {
+.wave-inner {
+  width: 120px;
+  height: 120px;
+  background-color: #3f51b5;
+  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: rotate(0deg);
+    transform: translateX(-50%) translateY(-50%) rotate(0deg);
   }
   100% {
-    transform: rotate(360deg);
+    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;
+//每日习惯css
+.button-container {
   display: flex;
+  flex-wrap: wrap;
   justify-content: center;
-  align-items: center;
-  font-size: 0.8em;
-  margin: 10px 0;
-  background-color: #fff;
-  border: 2px solid #000;
-  border-radius: 50%;
-  transition: background-color 0.3s;
-}
 
-.habit-button ion-icon {
-  font-size: 1.5em;
-}
+  .custom-button {
+    margin: 10px;
+    width: calc(33.33% - 20px);
+    border-radius: 20px;
+  }
 
-.habit-label {
-  text-align: center;
-  font-size: 0.8em;
-  color: #666;
-  margin-top: 5px;
+.habit-text-div{
+  padding-left: 50px;
+  margin-left: 50px;
 }
 
-.habit-button.blue {
-  background-color: #007bff; /* 蓝色背景 */
-}
+  .success-text {
+    color: #32db64; // 荧光绿
+  }
 
-.habit-button.white {
-  background-color: #fff; /* 白色背景 */
+  .failure-text {
+    color: #ff4d4f; // 荧光红
+  }
 }
 
-// .habit-button div {
-//   font-size: 0.8em;
-//   margin-top: 5px;
-// }
+.habit-text {
+  margin-left: 20px;
+  text-align: center;
+  margin-top: 20px;
+  font-weight: bold;
+  height: 50px; // 设置固定高度以垂直居中
 
-.habit-button:active {
-  transform: scale(0.9);
-  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
+  &.centered {
+    
+    justify-content: right; // 水平居中
+    align-items: center; // 垂直居中
+  }
 }
+.daily-habit{
+  margin-left: 10px;
+}

+ 61 - 1
src/app/tab1/tab1.page.ts

@@ -1,5 +1,7 @@
 import { Component } from '@angular/core';
 import { AlertController } from '@ionic/angular';
+import { Router } from '@angular/router';
+
 @Component({
   selector: 'app-tab1',
   templateUrl: 'tab1.page.html',
@@ -7,7 +9,7 @@ import { AlertController } from '@ionic/angular';
 })
 export class Tab1Page {
 
-  constructor(private alertController: AlertController) {}
+  constructor(private alertController: AlertController,private router: Router) {}
 
   async openModal() {
     const alert = await this.alertController.create({
@@ -21,5 +23,63 @@ export class Tab1Page {
   toggleButtonColor(habit:string){
     this.blueColor=!this.blueColor;
   }
+
+  //3d圆点击事件
+  navigateToTreePage() {
+    this.router.navigate(['/tabs/tree']);
+  };
+
+
+
+
+  //每日习惯按钮颜色变化
+  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');
+  }
+
+
+
 }
 

+ 7 - 2
src/app/tab3/tab3.page.html

@@ -2,11 +2,11 @@
 </ion-header>
 
 <ion-content [fullscreen]="true">
-  <ion-header collapse="condense">
+  <!-- <ion-header collapse="condense">
     <ion-toolbar>
       <ion-title size="large">Tab 3</ion-title>
     </ion-toolbar>
-  </ion-header>
+  </ion-header> -->
   
   <!-- 个人信息板块 -->
   <ion-card>
@@ -74,6 +74,11 @@
       <ion-icon name="download" slot="start"></ion-icon>
       数据下载
     </ion-item>
+    <!-- 登出按钮 -->
+    <ion-item button (click)="logout()">
+      <ion-icon name="log-out" slot="start"></ion-icon>
+      登出
+    </ion-item>
   </ion-list>
   
 </ion-content>

+ 18 - 4
src/app/tab3/tab3.page.ts

@@ -1,14 +1,15 @@
 import { Component } from '@angular/core';
-import { ToastController } from '@ionic/angular';
+import { NavController, ToastController } from '@ionic/angular';
+import * as Parse from "parse";
 
 @Component({
   selector: 'app-tab3',
-  templateUrl: 'tab3.page.html',
-  styleUrls: ['tab3.page.scss']
+  templateUrl: './tab3.page.html',
+  styleUrls: ['./tab3.page.scss']
 })
 export class Tab3Page {
 
-  constructor(private toastController: ToastController) {}
+  constructor(private navCtrl: NavController, private toastController: ToastController) {}
 
   async onItemClick(item: string) {
     const toast = await this.toastController.create({
@@ -18,4 +19,17 @@ export class Tab3Page {
     toast.present();
   }
 
+  async logout() {
+    try {
+      await Parse.User.logOut();
+      this.navCtrl.navigateRoot('/tabs/calendar'); // 登出后跳转到登录界面
+    } catch (error: any) {
+      console.error("Logout failed:", error);
+      const toast = await this.toastController.create({
+        message: `登出失败: ${error.message}`,
+        duration: 2000,
+      });
+      toast.present();
+    }
+  }
 }

+ 4 - 0
src/app/tabs/tabs-routing.module.ts

@@ -23,6 +23,10 @@ const routes: Routes = [
         path: 'calendar',
         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: '',
         redirectTo: '/tabs/tab1',

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

@@ -1,5 +1,4 @@
 <ion-tabs>
-
   <ion-tab-bar slot="bottom">
     <ion-tab-button tab="tab1" href="/tabs/tab1">
       <ion-icon aria-hidden="true" name="home"></ion-icon>
@@ -11,15 +10,14 @@
       <ion-label>记录一下</ion-label>
     </ion-tab-button>
 
-    <ion-tab-button tab="tab3" href="/tabs/tab3">
+    <ion-tab-button (click)="checkLogin()">
       <ion-icon aria-hidden="true" name="person"></ion-icon>
       <ion-label>我的</ion-label>
     </ion-tab-button>
     
-    <ion-tab-button tab="calendar" href="/tabs/calendar">
+    <!-- <ion-tab-button tab="calendar" href="/tabs/calendar">
       <ion-icon aria-hidden="true" name="calendar"></ion-icon>
       <ion-label>日历</ion-label>
-    </ion-tab-button>
+    </ion-tab-button> -->
   </ion-tab-bar>
-
 </ion-tabs>

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

@@ -1,4 +1,6 @@
 import { Component } from '@angular/core';
+import { NavController } from '@ionic/angular';
+import * as Parse from "parse";
 
 @Component({
   selector: 'app-tabs',
@@ -7,6 +9,16 @@ import { Component } from '@angular/core';
 })
 export class TabsPage {
 
-  constructor() {}
+  constructor(private navCtrl: NavController) {}
 
+  async checkLogin() {
+    const currentUser = Parse.User.current();
+    if (currentUser) {
+      // 如果已登录,跳转到“我的”界面
+      this.navCtrl.navigateForward('/tabs/tab3');
+    } else {
+      // 如果未登录,跳转到“登录”界面
+      this.navCtrl.navigateForward('/tabs/calendar');
+    }
+  }
 }

+ 0 - 0
assets/img/tree.png → src/assets/img/tree.png


+ 0 - 0
assets/img/zilv.jpg → src/assets/img/zilv.jpg


+ 0 - 0
modules/tab/tab-routing.module.ts → src/modules/tab/tab-routing.module.ts


+ 0 - 0
modules/tab/tab.module.ts → src/modules/tab/tab.module.ts


+ 0 - 0
modules/tab/tree/tree-routing.module.ts → src/modules/tab/tree/tree-routing.module.ts


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


+ 0 - 0
modules/tab/tree/tree.page.html → src/modules/tab/tree/tree.page.html


+ 0 - 0
modules/tab/tree/tree.page.scss → src/modules/tab/tree/tree.page.scss


+ 0 - 0
modules/tab/tree/tree.page.spec.ts → src/modules/tab/tree/tree.page.spec.ts


+ 0 - 0
modules/tab/tree/tree.page.ts → src/modules/tab/tree/tree.page.ts


+ 37 - 36
src/modules/user/login/login.page.html

@@ -1,38 +1,39 @@
-<ion-header [translucent]="true">
-  <ion-toolbar>
-    <ion-title>登录/注册</ion-title>
-  </ion-toolbar>
-</ion-header>
-
-<ion-content [fullscreen]="true">
-  <ion-header collapse="condense">
-    <ion-toolbar>
-      <ion-title size="large">登录/注册</ion-title>
-    </ion-toolbar>
-  </ion-header>
-
-  <ion-card>
-    <ion-card-header>
-      <ion-card-title>登录/注册</ion-card-title>
-    </ion-card-header>
+<ion-content [fullscreen]="true" class="ion-text-center">
+  <div class="login-container">
+    <ion-card class="login-card">
+      <ion-card-header>
+        <ion-card-title>登录/注册</ion-card-title>
+      </ion-card-header>
+    
+      <ion-card-content>
+        <ion-list>
+          <ion-item lines="none">
+            <ion-label position="floating" class="label-login">账号</ion-label>
+            <ion-input [(ngModel)]="username" placeholder="请输入用户名"></ion-input>
+          </ion-item>
+          <ion-item lines="none">
+            <ion-label position="floating" class="label-login">密码</ion-label>
+            <ion-input [(ngModel)]="password" type="password" placeholder="请输入密码"></ion-input>
+          </ion-item>
+        </ion-list>
+      </ion-card-content>
+    
+      <ion-row class="ion-login">
+        <ion-col size="6">
+          <ion-button expand="block" (click)="login()" color="primary">登录</ion-button>
+        </ion-col>
+        <ion-col size="6">
+          <ion-button expand="block" (click)="register()" color="primary">注册</ion-button>
+        </ion-col>
+      </ion-row>
   
-    <ion-card-content>
-
-      <ion-list [inset]="true">
-        <ion-item>
-          <ion-input [(ngModel)]="username" label="账号" placeholder="请输入用户名"></ion-input>
-        </ion-item>
-        <ion-item>
-          <ion-input [(ngModel)]="password" label="密码" type="password" placeholder="请输入密码"></ion-input>
-        </ion-item>
-      </ion-list>
-     
-    </ion-card-content>
-  
-    <ion-button (click)="login()" fill="clear">登录</ion-button>
-    <ion-button (click)="register()" fill="clear">注册</ion-button>
-  </ion-card>
-
-  <!-- 新增路由返回逻辑,执行back函数 -->
-  <ion-button expand="block" (click)="back()">返回</ion-button>
+      <!-- 返回按钮 -->
+      <ion-row class="ion-back">
+        <ion-col size="12">
+          <ion-button expand="block" (click)="back()" color="primary">返回</ion-button>
+        </ion-col>
+      </ion-row>
+      
+    </ion-card>
+  </div>
 </ion-content>

+ 31 - 0
src/modules/user/login/login.page.scss

@@ -0,0 +1,31 @@
+//窗口居中
+.login-container {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  height: 90vh; /* 使用视窗高度,保证内容居中且不畸形 */
+  padding: 0px; /* 可根据需要调整内边距 */
+  box-sizing: border-box; /* 确保内边距不影响总宽度 */
+}
+
+.login-card {
+  max-width: 400px; /* 设置最大宽度,避免内容过于扩展 */
+  width: 100%; /* 宽度100%,确保内容在容器内部居中 */
+  text-align: center; /* 文本居中 */
+}
+
+//登录注册
+.label-login{
+  font-size:30px;
+}
+
+
+//返回按钮
+.ion-login{
+  margin:0px 30px 0px 30px;
+  padding: auto;
+}
+.ion-back{
+  margin:0px 30px 10px 30px;
+  padding: auto;
+}

+ 49 - 56
src/modules/user/login/login.page.ts

@@ -1,7 +1,7 @@
 import { Component, OnInit } from '@angular/core';
 import { AlertController, NavController } from '@ionic/angular';
 import * as Parse from "parse"
-// 引用Router服务
+
 @Component({
   selector: 'app-login',
   templateUrl: './login.page.html',
@@ -9,70 +9,67 @@ import * as Parse from "parse"
 })
 export class LoginPage implements OnInit {
 
-  username:string = ""
-  password:string = ""
+  username: string = ""
+  password: string = ""
+  
   constructor(
-    // 新增:Router服务,用于路由跳转
-    private navCtrl:NavController,
-    private alertController:AlertController
+    private navCtrl: NavController,
+    private alertController: AlertController
   ) { }
 
-  ngOnInit() {
-  }
+  ngOnInit() { }
 
-  async login(){
-    let user
+  async login() {
+    let user;
     try {
-      user = await Parse.User.logIn(this.username,this.password)
-    } catch (error:any) {
-      let message:string = ""
-      // 新增提示词详情,根据Parse.User.login方法返回的不同英文提示词,增加对应的中文内容转换
-      if(error?.message.indexOf("is required")>-1){
-        message = "必须输入账号或邮箱"
+      user = await Parse.User.logIn(this.username, this.password);
+    } catch (error: any) {
+      let message: string = "";
+      if (error?.message.indexOf("is required") > -1) {
+        message = "必须输入账号或邮箱";
       }
-      if(error?.message.indexOf("Invalid username")>-1){
-        message = "账号或密码错误,请检查"
+      if (error?.message.indexOf("Invalid username") > -1) {
+        message = "账号或密码错误,请检查";
       }
       this.presentAlert({
-        header:"登录失败",
-        subHeader:"状态码:"+error.code,
-        message:message || error.message
-      })
+        header: "登录失败",
+        subHeader: "状态码:" + error.code,
+        message: message || error.message
+      });
     }
-    console.log(user)
-    if(user?.id){
-      this.navCtrl.back()
+    console.log(user);
+    if (user?.id) {
+      this.navCtrl.navigateForward('/tabs/tab3'); // 修改这里
     }
   }
-  async register(){
-    let user = new Parse.User()
-    user.set("username",this.username)
-    user.set("password",this.password)
+
+  async register() {
+    let user = new Parse.User();
+    user.set("username", this.username);
+    user.set("password", this.password);
     try {
-        let result = await user.signUp();
-        console.log(result)
-        if(result?.id){
-          this.navCtrl.back()
-        }
-        // Hooray! Let them use the app now.
-    } catch (error:any) {
-        // 新增提示词详情,根据Parse.User.signUp方法返回的不同英文提示词,增加对应的中文内容转换
-        let message:string = ""
-        if(error?.message.indexOf("already exists")>-1){
-          message = "该账号已存在请修改后重试"
-        }
-        if(error?.message.indexOf("empty")>-1){
-          message = "账号不能为空请输入后重试"
-        }
-        this.presentAlert({
-          header:"注册失败",
-          subHeader:"状态码:"+error.code,
-          message:message || error.message
-        })
+      let result = await user.signUp();
+      console.log(result);
+      if (result?.id) {
+        this.navCtrl.navigateForward('/tabs/tab3'); // 修改这里
+      }
+    } catch (error: any) {
+      let message: string = "";
+      if (error?.message.indexOf("already exists") > -1) {
+        message = "该账号已存在请修改后重试";
+      }
+      if (error?.message.indexOf("empty") > -1) {
+        message = "账号不能为空请输入后重试";
+      }
+      this.presentAlert({
+        header: "注册失败",
+        subHeader: "状态码:" + error.code,
+        message: message || error.message
+      });
     }
   }
 
-  async presentAlert(options:{header:string,subHeader:string,message:string}) {
+  async presentAlert(options: { header: string, subHeader: string, message: string }) {
     const alert = await this.alertController.create({
       header: options?.header,
       subHeader: options?.subHeader,
@@ -83,11 +80,7 @@ export class LoginPage implements OnInit {
     await alert.present();
   }
 
-  /**
-   * 返回上级页面函数
-   * @desc
-   */
-  back(){
-    this.navCtrl.back()
+  back() {
+    this.navCtrl.back();
   }
 }

+ 13 - 26
src/modules/user/mine/mine.page.html

@@ -1,29 +1,16 @@
-<ion-header [translucent]="true">
-  <ion-toolbar>
-    <ion-title>我的</ion-title>
-  </ion-toolbar>
-</ion-header>
-
-<ion-content [fullscreen]="true">
-  <ion-header collapse="condense">
-    <ion-toolbar>
-      <ion-title size="large">我的</ion-title>
-    </ion-toolbar>
-  </ion-header>
-
-  <ion-card>
-    <img alt="" src="https://ionicframework.com/docs/img/demos/card-media.png" />
-    <ion-card-header>
-      <ion-card-title>{{user?.get("username") || '未登录'}}</ion-card-title>
-      <ion-card-subtitle *ngIf="!user?.id">请您登陆后继续使用</ion-card-subtitle>
-      <ion-card-subtitle *ngIf="user?.id">{{user?.get("name")}}-{{user?.get("gender")}}</ion-card-subtitle>
-    </ion-card-header>
- 
-    <!-- 新增:根据用户状态,显示登录/登出按钮,执行跳转或登出函数 -->
-    <ion-button *ngIf="!user?.id" fill="clear" routerLink="/user/login">登录</ion-button>
-    <ion-button *ngIf="user?.id" fill="clear" routerLink="/user/edit/info">编辑资料</ion-button>
-    <ion-button *ngIf="user?.id" fill="clear" (click)="logout()">登出</ion-button>
-  </ion-card>
+<ion-content [fullscreen]="true" class="ion-text-center ion-align-items-center">
+  <div class="login-container">
+    <img src="../../../assets/img/zilv.jpg" alt="Logo" class="app-logo">
 
+    <ion-card class="login-card">
+      <ion-card-header>
+        <ion-card-title>欢迎使用我们的App</ion-card-title>
+      </ion-card-header>
 
+      <ion-card-content class="ion-text-center">
+        <p>请登录或注册以继续使用我们的服务。</p>
+        <ion-button expand="block" color="primary" fill="solid" routerLink="/user/login">去登录</ion-button>
+      </ion-card-content>
+    </ion-card>
+  </div>
 </ion-content>

+ 27 - 0
src/modules/user/mine/mine.page.scss

@@ -0,0 +1,27 @@
+.ion-content {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  height: 0vh; /* 使用视窗高度,确保内容垂直居中 */
+}
+
+.login-container {
+  text-align: center; /* 文本居中 */
+  //max-width: 400px; /* 设置最大宽度,避免内容过于扩展 */
+  width: 100%; /* 宽度100%,确保内容在容器内部居中 */
+  padding: 0 10px; /* 可根据需要调整内边距 */
+  box-sizing: border-box; /* 确保内边距不影响总宽度 */
+}
+
+.login-card {
+  margin:0px 10px;
+  //max-width: 500px; /* 设置最大宽度,避免内容过于扩展 */
+  text-align: center; /* 文本居中 */
+}
+
+.app-logo {
+  padding-top: 100px;
+  max-width: 95%; /* 图片宽度最大为容器宽度 */
+  height: auto; /* 自动高度 */
+  padding-bottom: 20px;
+}

+ 0 - 2
theme/variables.scss

@@ -1,2 +0,0 @@
-// For information on how to create your own theme, please see:
-// http://ionicframework.com/docs/theming/