浏览代码

Merge branch 'master' of http://git.fmode.cn:3000/0225273/APPmy

0225273 4 月之前
父节点
当前提交
046afdf7d5
共有 40 个文件被更改,包括 543 次插入24 次删除
  1. 9 9
      package-lock.json
  2. 1 1
      package.json
  3. 26 2
      src/app/app-routing.module.ts
  4. 4 0
      src/app/app.component.ts
  5. 17 0
      src/app/edit-profile/edit-profile-routing.module.ts
  6. 20 0
      src/app/edit-profile/edit-profile.module.ts
  7. 29 0
      src/app/edit-profile/edit-profile.page.html
  8. 8 0
      src/app/edit-profile/edit-profile.page.scss
  9. 17 0
      src/app/edit-profile/edit-profile.page.spec.ts
  10. 23 0
      src/app/edit-profile/edit-profile.page.ts
  11. 17 0
      src/app/following/following-routing.module.ts
  12. 20 0
      src/app/following/following.module.ts
  13. 13 0
      src/app/following/following.page.html
  14. 0 0
      src/app/following/following.page.scss
  15. 17 0
      src/app/following/following.page.spec.ts
  16. 15 0
      src/app/following/following.page.ts
  17. 17 0
      src/app/notification-settings/notification-settings-routing.module.ts
  18. 20 0
      src/app/notification-settings/notification-settings.module.ts
  19. 32 0
      src/app/notification-settings/notification-settings.page.html
  20. 0 0
      src/app/notification-settings/notification-settings.page.scss
  21. 17 0
      src/app/notification-settings/notification-settings.page.spec.ts
  22. 18 0
      src/app/notification-settings/notification-settings.page.ts
  23. 17 0
      src/app/privacy/privacy-routing.module.ts
  24. 20 0
      src/app/privacy/privacy.module.ts
  25. 50 0
      src/app/privacy/privacy.page.html
  26. 5 0
      src/app/privacy/privacy.page.scss
  27. 17 0
      src/app/privacy/privacy.page.spec.ts
  28. 15 0
      src/app/privacy/privacy.page.ts
  29. 5 1
      src/app/settings/settings.page.ts
  30. 29 8
      src/app/tab4/tab4.page.html
  31. 17 1
      src/app/tab4/tab4.page.scss
  32. 26 1
      src/app/tab4/tab4.page.ts
  33. 0 0
      src/modules/user/login/login-routing.module.ts
  34. 0 0
      src/modules/user/login/login.module.ts
  35. 0 0
      src/modules/user/login/login.page.html
  36. 0 0
      src/modules/user/login/login.page.scss
  37. 0 0
      src/modules/user/login/login.page.spec.ts
  38. 0 0
      src/modules/user/login/login.page.ts
  39. 1 1
      src/modules/user/user-routing.module.ts
  40. 1 0
      tsconfig.json

+ 9 - 9
package-lock.json

@@ -23,7 +23,7 @@
         "@capacitor/status-bar": "6.0.0",
         "@ionic/angular": "^8.0.0",
         "ionicons": "^7.0.0",
-        "parse": "^5.2.0",
+        "parse": "^5.3.0",
         "rxjs": "~7.8.0",
         "swiper": "^11.1.4",
         "tslib": "^2.3.0",
@@ -2526,9 +2526,9 @@
       }
     },
     "node_modules/@babel/runtime-corejs3": {
-      "version": "7.24.6",
-      "resolved": "https://registry.npmmirror.com/@babel/runtime-corejs3/-/runtime-corejs3-7.24.6.tgz",
-      "integrity": "sha512-tbC3o8uHK9xMgMsvUm9qGqxVpbv6yborMBLbDteHIc7JDNHsTV0vDMQ5j1O1NXvO+BDELtL9KgoWYaUVIVGt8w==",
+      "version": "7.24.7",
+      "resolved": "https://registry.npmmirror.com/@babel/runtime-corejs3/-/runtime-corejs3-7.24.7.tgz",
+      "integrity": "sha512-eytSX6JLBY6PVAeQa2bFlDx/7Mmln/gaEpsit5a3WEvjGfiIytEsgAwuIXCPM0xvw0v0cJn3ilq0/TvXrW0kgA==",
       "dependencies": {
         "core-js-pure": "^3.30.2",
         "regenerator-runtime": "^0.14.0"
@@ -13428,11 +13428,11 @@
       }
     },
     "node_modules/parse": {
-      "version": "5.2.0",
-      "resolved": "https://registry.npmmirror.com/parse/-/parse-5.2.0.tgz",
-      "integrity": "sha512-FoD3kcLAQCw/2J1984sl3GUBzbHE2tA9mUcyw/EBWZ46WVZTzV+kjnA5tttXyzN4uodt21wSluzjbGnyLqreKw==",
+      "version": "5.3.0",
+      "resolved": "https://registry.npmmirror.com/parse/-/parse-5.3.0.tgz",
+      "integrity": "sha512-mWBnE6hHJhdvlx5KPQcYgCGRdgqKhPw+5fSC0j7vOfse3Lkh3xtDwOfmDpvv2LXZVBj72G/mgVKMRmbAICRzkQ==",
       "dependencies": {
-        "@babel/runtime-corejs3": "7.24.6",
+        "@babel/runtime-corejs3": "7.24.7",
         "idb-keyval": "6.2.1",
         "react-native-crypto-js": "1.0.0",
         "uuid": "10.0.0",
@@ -13440,7 +13440,7 @@
         "xmlhttprequest": "1.8.0"
       },
       "engines": {
-        "node": ">=18 <21"
+        "node": "18 || 19 || 20 || 22"
       },
       "optionalDependencies": {
         "crypto-js": "4.2.0"

+ 1 - 1
package.json

@@ -28,7 +28,7 @@
     "@capacitor/status-bar": "6.0.0",
     "@ionic/angular": "^8.0.0",
     "ionicons": "^7.0.0",
-    "parse": "^5.2.0",
+    "parse": "^5.3.0",
     "rxjs": "~7.8.0",
     "swiper": "^11.1.4",
     "tslib": "^2.3.0",

+ 26 - 2
src/app/app-routing.module.ts

@@ -1,5 +1,7 @@
 import { NgModule } from '@angular/core';
 import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
+// 引用路由守卫
+import { authGuard } from 'src/modules/user/auth.guard';
 
 const routes: Routes = [
   {
@@ -18,11 +20,33 @@ const routes: Routes = [
     path: 'settings',
     loadChildren: () => import('./settings/settings.module').then( m => m.SettingsPageModule)
   },
+  // {
+  //   path: 'login',
+  //   loadChildren: () => import('./login/login.module').then( m => m.LoginPageModule)
+  // },
   {
-    path: 'login',
-    loadChildren: () => import('./login/login.module').then( m => m.LoginPageModule)
+    path: 'edit-profile',
+    loadChildren: () => import('./edit-profile/edit-profile.module').then( m => m.EditProfilePageModule)
+  },
+  {
+    path: 'notification-settings',
+    loadChildren: () => import('./notification-settings/notification-settings.module').then( m => m.NotificationSettingsPageModule)
+  },
+  {
+    path: 'privacy',
+    loadChildren: () => import('./privacy/privacy.module').then( m => m.PrivacyPageModule)
+  },
+    // 添加:
+    {
+      path: 'user',
+      loadChildren: () => import('../modules/user/user.module').then(m => m.UserModule)
+    },
+  {
+    path: 'following',
+    loadChildren: () => import('./following/following.module').then( m => m.FollowingPageModule)
   }
 
+  
 
 ];
 @NgModule({

+ 4 - 0
src/app/app.component.ts

@@ -1,4 +1,8 @@
 import { Component } from '@angular/core';
+// 引用Parse JS SDK
+import Parse from "parse";
+Parse.initialize("dev"); // 设置applicationId
+Parse.serverURL = "http://web2023.fmode.cn:9999/parse"; // 设置serverURL
 
 @Component({
   selector: 'app-root',

+ 17 - 0
src/app/edit-profile/edit-profile-routing.module.ts

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

+ 20 - 0
src/app/edit-profile/edit-profile.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 { EditProfilePageRoutingModule } from './edit-profile-routing.module';
+
+import { EditProfilePage } from './edit-profile.page';
+
+@NgModule({
+  imports: [
+    CommonModule,
+    FormsModule,
+    IonicModule,
+    EditProfilePageRoutingModule
+  ],
+  declarations: [EditProfilePage]
+})
+export class EditProfilePageModule {}

+ 29 - 0
src/app/edit-profile/edit-profile.page.html

@@ -0,0 +1,29 @@
+<ion-header>
+  <ion-toolbar>
+    <ion-back-button slot="start" defaultHref="/settings"></ion-back-button>
+    <ion-title>个人信息设置</ion-title>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content>
+  <ion-list>
+    <ion-item>
+      <ion-label position="floating">用户名</ion-label>
+      <ion-input type="text" [(ngModel)]="username"></ion-input>
+    </ion-item>
+
+    <ion-item>
+      <ion-label>头像</ion-label>
+      <ion-avatar slot="end">
+        <img [src]="avatarUrl" />
+      </ion-avatar>
+    </ion-item>
+
+    <ion-item>
+      <ion-label position="floating">个人简介</ion-label>
+      <ion-textarea [(ngModel)]="bio"></ion-textarea>
+    </ion-item>
+
+    <ion-button expand="block" (click)="saveChanges()">保存</ion-button>
+  </ion-list>
+</ion-content>

+ 8 - 0
src/app/edit-profile/edit-profile.page.scss

@@ -0,0 +1,8 @@
+ion-avatar {
+    width: 50px;
+    height: 50px;
+  }
+  
+  ion-textarea {
+    min-height: 100px;
+  }

+ 17 - 0
src/app/edit-profile/edit-profile.page.spec.ts

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

+ 23 - 0
src/app/edit-profile/edit-profile.page.ts

@@ -0,0 +1,23 @@
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+  selector: 'app-edit-profile',
+  templateUrl: './edit-profile.page.html',
+  styleUrls: ['./edit-profile.page.scss'],
+})
+export class EditProfilePage implements OnInit {
+
+  constructor() { }
+
+  ngOnInit() {
+  }
+  username: string = 'JohnDoe';
+  avatarUrl: string = 'assets/avatar.jpg';
+  bio: string = 'Hello, I am a user of this app.';
+
+  saveChanges() {
+    // 在这里处理保存用户编辑后的个人信息逻辑
+    console.log('用户名:', this.username);
+    console.log('个人简介:', this.bio);
+  }
+}

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

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

+ 20 - 0
src/app/following/following.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 { FollowingPageRoutingModule } from './following-routing.module';
+
+import { FollowingPage } from './following.page';
+
+@NgModule({
+  imports: [
+    CommonModule,
+    FormsModule,
+    IonicModule,
+    FollowingPageRoutingModule
+  ],
+  declarations: [FollowingPage]
+})
+export class FollowingPageModule {}

+ 13 - 0
src/app/following/following.page.html

@@ -0,0 +1,13 @@
+<ion-header [translucent]="true">
+  <ion-toolbar>
+    <ion-title>following</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-content>

+ 0 - 0
src/app/login/login.page.scss → src/app/following/following.page.scss


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

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

+ 15 - 0
src/app/following/following.page.ts

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

+ 17 - 0
src/app/notification-settings/notification-settings-routing.module.ts

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

+ 20 - 0
src/app/notification-settings/notification-settings.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 { NotificationSettingsPageRoutingModule } from './notification-settings-routing.module';
+
+import { NotificationSettingsPage } from './notification-settings.page';
+
+@NgModule({
+  imports: [
+    CommonModule,
+    FormsModule,
+    IonicModule,
+    NotificationSettingsPageRoutingModule
+  ],
+  declarations: [NotificationSettingsPage]
+})
+export class NotificationSettingsPageModule {}

+ 32 - 0
src/app/notification-settings/notification-settings.page.html

@@ -0,0 +1,32 @@
+<ion-header>
+  <ion-toolbar>
+    <ion-back-button slot="start" defaultHref="/settings"></ion-back-button>
+    <ion-title>通知设置</ion-title>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content>
+  <ion-list>
+    <ion-item>
+      <ion-label>消息通知</ion-label>
+      <ion-toggle slot="end"></ion-toggle>
+    </ion-item>
+
+    <ion-item>
+      <ion-label>评论通知</ion-label>
+      <ion-toggle slot="end"></ion-toggle>
+    </ion-item>
+
+    <ion-item>
+      <ion-label>点赞通知</ion-label>
+      <ion-toggle slot="end"></ion-toggle>
+    </ion-item>
+
+    <ion-item>
+      <ion-label>关注通知</ion-label>
+      <ion-toggle slot="end"></ion-toggle>
+    </ion-item>
+  </ion-list>
+
+  <ion-button expand="block" (click)="saveSettings()">保存设置</ion-button>
+</ion-content>

+ 0 - 0
src/app/notification-settings/notification-settings.page.scss


+ 17 - 0
src/app/notification-settings/notification-settings.page.spec.ts

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

+ 18 - 0
src/app/notification-settings/notification-settings.page.ts

@@ -0,0 +1,18 @@
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+  selector: 'app-notification-settings',
+  templateUrl: './notification-settings.page.html',
+  styleUrls: ['./notification-settings.page.scss'],
+})
+export class NotificationSettingsPage implements OnInit {
+
+  constructor() { }
+
+  ngOnInit() {
+  }
+  saveSettings() {
+    // 在这里处理保存通知设置的逻辑
+    console.log('保存通知设置');
+  }
+}

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

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

+ 20 - 0
src/app/privacy/privacy.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 { PrivacyPageRoutingModule } from './privacy-routing.module';
+
+import { PrivacyPage } from './privacy.page';
+
+@NgModule({
+  imports: [
+    CommonModule,
+    FormsModule,
+    IonicModule,
+    PrivacyPageRoutingModule
+  ],
+  declarations: [PrivacyPage]
+})
+export class PrivacyPageModule {}

+ 50 - 0
src/app/privacy/privacy.page.html

@@ -0,0 +1,50 @@
+<ion-header>
+  <ion-toolbar>
+    <ion-back-button slot="start" defaultHref="/settings"></ion-back-button>
+    <ion-title>隐私设置</ion-title>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content>
+  <ion-list>
+    <ion-item>
+      <ion-icon slot="start" name="person-circle-outline"></ion-icon>
+      <ion-label>个人资料隐私设置</ion-label>
+    </ion-item>
+
+    <ion-item>
+      <ion-icon slot="start" name="videocam-outline"></ion-icon>
+      <ion-label>视频隐私设置</ion-label>
+    </ion-item>
+
+    <ion-item>
+      <ion-icon slot="start" name="chatbubble-ellipses-outline"></ion-icon>
+      <ion-label>评论和互动设置</ion-label>
+    </ion-item>
+
+    <ion-item>
+      <ion-icon slot="start" name="lock-closed-outline"></ion-icon>
+      <ion-label>账号安全设置</ion-label>
+    </ion-item>
+
+    <ion-item>
+      <ion-icon slot="start" name="document-text-outline"></ion-icon>
+      <ion-label>隐私政策和条款</ion-label>
+    </ion-item>
+
+    <ion-item>
+      <ion-icon slot="start" name="share-social-outline"></ion-icon>
+      <ion-label>数据分享设置</ion-label>
+    </ion-item>
+
+    <ion-item>
+      <ion-icon slot="start" name="notifications-outline"></ion-icon>
+      <ion-label>通知设置</ion-label>
+    </ion-item>
+
+    <ion-item>
+      <ion-icon slot="start" name="shield-checkmark-outline"></ion-icon>
+      <ion-label>隐私与安全建议</ion-label>
+    </ion-item>
+  </ion-list>
+</ion-content>

+ 5 - 0
src/app/privacy/privacy.page.scss

@@ -0,0 +1,5 @@
+ion-item {
+    ion-icon {
+      color: var(--ion-color-primary);
+    }
+  }

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

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

+ 15 - 0
src/app/privacy/privacy.page.ts

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

+ 5 - 1
src/app/settings/settings.page.ts

@@ -1,5 +1,6 @@
 import { Component, OnInit } from '@angular/core';
 import { NavController } from '@ionic/angular';
+import { Router } from '@angular/router';
 @Component({
   selector: 'app-settings',
   templateUrl: './settings.page.html',
@@ -7,19 +8,22 @@ import { NavController } from '@ionic/angular';
 })
 export class SettingsPage implements OnInit {
 
-  constructor(private navCtrl: NavController) { }
+  constructor(private navCtrl: NavController,private router: Router) { }
   ngOnInit() {
   }
    editProfile() {
     // 编辑个人信息
+    this.router.navigate(['/edit-profile']);
   }
 
   selectNotification() {
     // 选择通知设置
+    this.router.navigate(['/notification-settings']);
   }
 
   managePrivacy() {
     // 管理隐私设置
+    this.router.navigate(['/privacy']);
   }
 
   selectTheme() {

+ 29 - 8
src/app/tab4/tab4.page.html

@@ -15,6 +15,19 @@
   </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="../../modules/user/login">登录</ion-button>
+  <ion-button *ngIf="user?.id" fill="clear" routerLink="../../modules/user/edit/info">编辑资料</ion-button>
+  <ion-button *ngIf="user?.id" fill="clear" (click)="logout()">登出</ion-button>
+</ion-card> -->
 
 <ion-content>
     <ion-card-content>
@@ -27,12 +40,24 @@
     </ion-card-content>
 
   <ion-card>
+    <ion-grid>
+  <ion-row>
+    <ion-col size="4">
+      <p class="count" (click)="openFollowingPage()">{{user.following}}</p>
+      <p class="label">关注</p>
+    </ion-col>
+    <ion-col size="4">
+      <p class="count">{{user.followers}}</p>
+      <p class="label">粉丝</p>
+    </ion-col>
+    <ion-col size="4">
+      <p class="count">{{user.likes}}</p>
+      <p class="label">获赞</p>
+    </ion-col>
+  </ion-row>
+</ion-grid>
     <ion-card-content>
     <ion-segment scrollable>
-    <ion-segment-button value="followings">
-      <ion-icon name="people-outline"></ion-icon>
-      关注的人
-    </ion-segment-button>
     <ion-segment-button value="creators">
       <ion-icon name="brush-outline"></ion-icon>
       创作者中心
@@ -49,10 +74,6 @@
       <ion-icon name="chatbubbles-outline"></ion-icon>
       我的圈子
     </ion-segment-button>
-    <ion-segment-button value="my-followings">
-      <ion-icon name="heart-outline"></ion-icon>
-      我的关注
-    </ion-segment-button>
     <ion-segment-button value="my-orders">
       <ion-icon name="receipt-outline"></ion-icon>
       我的订单

+ 17 - 1
src/app/tab4/tab4.page.scss

@@ -42,4 +42,20 @@ p {
 }
 p.selected {
     color: blue; /* 设置选中文本颜色为蓝色 */
-}
+}
+.custom-card {
+  // 自定义样式
+  margin-left: 20px;
+  
+}
+ion-col {
+  text-align: center;
+  .count {
+    font-size: 24px;
+    font-weight: bold;
+  }
+  .label {
+    font-size: 14px;
+    color: #999;
+  }
+}

+ 26 - 1
src/app/tab4/tab4.page.ts

@@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core';
 import { NavController } from '@ionic/angular';
 import { Router } from '@angular/router';
 
+
 @Component({
   selector: 'app-tab4',
   templateUrl: './tab4.page.html',
@@ -72,7 +73,31 @@ export class Tab4Page implements OnInit {
   }
 
   openLoginPage() {
-    this.navCtrl.navigateForward('/login');
+    this.navCtrl.navigateForward('../../modules/user/login/login.module');
+  }
+
+  openFollowingPage(){
+    //打开关注页面
+    this.router.navigate(['/following']);
+  }
+
+  // 由于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();
+  // }
+
+  user={
+    followers: 1000,
+    following: 500,
+    likes: 2000
   }
 
   ngOnInit() {

+ 0 - 0
src/app/login/login-routing.module.ts → src/modules/user/login/login-routing.module.ts


+ 0 - 0
src/app/login/login.module.ts → src/modules/user/login/login.module.ts


+ 0 - 0
src/app/login/login.page.html → src/modules/user/login/login.page.html


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


+ 0 - 0
src/app/login/login.page.spec.ts → src/modules/user/login/login.page.spec.ts


+ 0 - 0
src/app/login/login.page.ts → src/modules/user/login/login.page.ts


+ 1 - 1
src/modules/user/user-routing.module.ts

@@ -2,7 +2,7 @@ import { NgModule } from '@angular/core';
 import { RouterModule, Routes } from '@angular/router';
 
 const routes: Routes = [
-    {path: 'login', loadChildren: () => import('../../app/login/login.module').then(mod => mod.LoginPageModule)},
+    {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)},
 ];

+ 1 - 0
tsconfig.json

@@ -2,6 +2,7 @@
 {
   "compileOnSave": false,
   "compilerOptions": {
+    "allowSyntheticDefaultImports": true,
     "baseUrl": "./",
     "outDir": "./dist/out-tsc",
     "forceConsistentCasingInFileNames": true,