7 1 day ago
parent
commit
943de5760c

+ 1 - 4
myapp/src/app/app-routing.module.ts

@@ -7,10 +7,7 @@ const routes: Routes = [
     path: '',
     loadChildren: () => import('./tabs/tabs.module').then(m => m.TabsPageModule)
   },
-  {
-    path: 'tab4',
-    loadChildren: () => import('./tab4/tab4.module').then( m => m.Tab4PageModule)
-  },
+  
   {
     path: 'tab5',
     loadChildren: () => import('./tab5/tab5.module').then( m => m.Tab5PageModule)

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

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

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

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

+ 0 - 17
myapp/src/app/tab3/tab3.page.html

@@ -1,17 +0,0 @@
-<ion-header [translucent]="true">
-  <ion-toolbar>
-    <ion-title>
-      Tab 3
-    </ion-title>
-  </ion-toolbar>
-</ion-header>
-
-<ion-content [fullscreen]="true">
-  <ion-header collapse="condense">
-    <ion-toolbar>
-      <ion-title size="large">Tab 3</ion-title>
-    </ion-toolbar>
-  </ion-header>
-
-  <app-explore-container name="Tab 3 page"></app-explore-container>
-</ion-content>

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

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

+ 0 - 13
myapp/src/app/tab3/tab3.page.ts

@@ -1,13 +0,0 @@
-import { Component } from '@angular/core';
-
-@Component({
-  selector: 'app-tab3',
-  templateUrl: 'tab3.page.html',
-  styleUrls: ['tab3.page.scss'],
-  standalone: false,
-})
-export class Tab3Page {
-
-  constructor() {}
-
-}

+ 0 - 17
myapp/src/app/tab4/tab4-routing.module.ts

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

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

+ 0 - 13
myapp/src/app/tab4/tab4.page.html

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

+ 0 - 17
myapp/src/app/tab4/tab4.page.spec.ts

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

+ 0 - 16
myapp/src/app/tab4/tab4.page.ts

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

+ 32 - 0
myapp/src/app/tab5/edit-profile.component.html

@@ -0,0 +1,32 @@
+<ion-header>
+  <ion-toolbar>
+    <ion-title>个人资料</ion-title>
+    <ion-buttons slot="end">
+      <ion-button (click)="cancel()">取消</ion-button>
+    </ion-buttons>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content class="ion-padding">
+  <ion-item>
+    <ion-label position="floating">姓名</ion-label>
+    <ion-input [(ngModel)]="name"></ion-input>
+  </ion-item>
+
+  <ion-item>
+    <ion-label position="floating">性别</ion-label>
+    <ion-input [(ngModel)]="gender"></ion-input>
+  </ion-item>
+
+  <ion-item>
+    <ion-label position="floating">年龄</ion-label>
+    <ion-input type="number" [(ngModel)]="age"></ion-input>
+  </ion-item>
+
+  <ion-item>
+    <ion-label position="floating">所在地</ion-label>
+    <ion-input [(ngModel)]="location"></ion-input>
+  </ion-item>
+
+  <ion-button expand="block" (click)="saveProfile()">保存</ion-button>
+</ion-content>

+ 0 - 0
myapp/src/app/tab3/tab3.page.scss → myapp/src/app/tab5/edit-profile.component.scss


+ 56 - 0
myapp/src/app/tab5/edit-profile.component.ts

@@ -0,0 +1,56 @@
+import { Component, Input, OnInit } from '@angular/core';
+import { ModalController } from '@ionic/angular';
+import { IonicModule } from '@ionic/angular';
+import { CommonModule } from '@angular/common';
+import { FormsModule } from '@angular/forms';
+
+@Component({
+  selector: 'app-edit-profile',
+  templateUrl: 'edit-profile.component.html',
+  styleUrls: ['edit-profile.component.scss'],
+  imports: [IonicModule, CommonModule, FormsModule],
+  standalone: true
+})
+export class EditProfileComponent implements OnInit {
+  @Input() currentUser: any;
+
+  name: string | undefined;
+  gender: string | undefined;
+  age: number | undefined;
+  location: string | undefined;
+
+  constructor(private modalCtrl: ModalController) {}
+
+  ngOnInit() {
+    // 尝试从缓存中获取数据
+    const cachedData = localStorage.getItem('userProfile');
+    if (cachedData) {
+      const { name, gender, age, location } = JSON.parse(cachedData);
+      this.name = name;
+      this.gender = gender;
+      this.age = age;
+      this.location = location;
+    } else if (this.currentUser) {
+      this.name = this.currentUser.data.name || '';
+      this.gender = this.currentUser.data.gender || '';
+      this.age = this.currentUser.data.age || 0;
+      this.location = this.currentUser.data.location || '';
+    }
+  }
+
+  saveProfile() {
+    const updatedData = {
+      name: this.name,
+      gender: this.gender,
+      age: this.age,
+      location: this.location
+    };
+    // 设置缓存
+    localStorage.setItem('userProfile', JSON.stringify(updatedData));
+    this.modalCtrl.dismiss(updatedData);
+  }
+
+  cancel() {
+    this.modalCtrl.dismiss();
+  }
+}

+ 26 - 0
myapp/src/app/tab5/register.page.html

@@ -0,0 +1,26 @@
+<ion-header>
+  <ion-toolbar>
+    <ion-title>注册</ion-title>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content class="ion-padding">
+  <ion-item>
+    <ion-label position="floating">用户名</ion-label>
+    <ion-input [(ngModel)]="registerUsername"></ion-input>
+  </ion-item>
+
+  <ion-item>
+    <ion-label position="floating">密码</ion-label>
+    <ion-input type="password" [(ngModel)]="registerPassword"></ion-input>
+  </ion-item>
+
+  <ion-item>
+    <ion-label position="floating">邮箱</ion-label>
+    <ion-input [(ngModel)]="registerEmail"></ion-input>
+  </ion-item>
+
+  <ion-button expand="block" (click)="register()">注册</ion-button>
+  <!-- 添加返回登录页面的按钮 -->
+  <ion-button expand="block" (click)="goBackToLogin()">返回登录</ion-button>
+</ion-content>

+ 1 - 0
myapp/src/app/tab5/register.page.scss

@@ -0,0 +1 @@
+/* 可以根据需要添加样式 */

+ 48 - 0
myapp/src/app/tab5/register.page.ts

@@ -0,0 +1,48 @@
+import { Component } from '@angular/core';
+import { CloudUser } from '../../lib/ncloud';
+import { Router } from '@angular/router';
+import { IonicModule } from '@ionic/angular';
+import { CommonModule } from '@angular/common';
+import { FormsModule } from '@angular/forms';
+
+@Component({
+  selector: 'app-register',
+  templateUrl: 'register.page.html',
+  styleUrls: ['register.page.scss'],
+  imports: [IonicModule, CommonModule, FormsModule],
+  standalone: true
+})
+export class RegisterPage {
+  user = new CloudUser();
+  registerUsername = '';
+  registerPassword = '';
+  registerEmail = '';
+
+  constructor(private router: Router) {}
+
+  async register() {
+    if (!this.registerUsername || !this.registerPassword || !this.registerEmail) {
+      alert('请输入用户名、密码和邮箱');
+      return;
+    }
+
+    try {
+      this.user.set({
+        username: this.registerUsername,
+        password: this.registerPassword,
+        email: this.registerEmail
+      });
+      await this.user.save();
+      alert('注册成功,请登录');
+      this.router.navigate(['/tabs/tab5']); // 跳转回登录界面
+    } catch (error) {
+      console.error('注册失败:', error);
+      alert('注册失败,请重试');
+    }
+  }
+
+  // 添加返回登录页面的方法
+  goBackToLogin() {
+    this.router.navigate(['/tabs/tab5']);
+  }
+}

+ 12 - 3
myapp/src/app/tab5/tab5-routing.module.ts

@@ -1,17 +1,26 @@
 import { NgModule } from '@angular/core';
-import { Routes, RouterModule } from '@angular/router';
-
+import { RouterModule, Routes } from '@angular/router';
 import { Tab5Page } from './tab5.page';
+import { UserDashboardPage } from './user-dashboard.page';
+import { RegisterPage } from './register.page';
 
 const routes: Routes = [
   {
     path: '',
     component: Tab5Page
+  },
+  {
+    path: 'user-dashboard',
+    component: UserDashboardPage
+  },
+  {
+    path: 'register',
+    component: RegisterPage
   }
 ];
 
 @NgModule({
   imports: [RouterModule.forChild(routes)],
-  exports: [RouterModule],
+  exports: [RouterModule]
 })
 export class Tab5PageRoutingModule {}

+ 48 - 91
myapp/src/app/tab5/tab5.page.html

@@ -1,99 +1,56 @@
-<!-- my-profile.page.html -->
 <ion-header>
-  <ion-toolbar color="primary">
-    <ion-buttons slot="start">
-      <ion-button>
-        <ion-icon name="person-circle" slot="icon-only"></ion-icon>
-      </ion-button>
-    </ion-buttons>
-    <ion-title class="header-title">我的空间</ion-title>
-    <ion-buttons slot="end">
-      <ion-button>
-        <ion-icon name="notifications" slot="icon-only"></ion-icon>
-        <ion-badge color="danger" class="notification-badge">2</ion-badge>
-      </ion-button>
-    </ion-buttons>
+  <ion-toolbar>
+    <ion-title>用户中心</ion-title>
   </ion-toolbar>
 </ion-header>
 
 <ion-content class="ion-padding">
-  <!-- 身份信息卡 -->
-  <ion-card class="identity-card">
-    <div class="card-header">
-      <ion-avatar class="family-avatar">
-        <img src="E:/邻助星/workspace/myapp/111.png"> <!-- 卡通头像 -->
-      </ion-avatar>
-      <div class="title-group">
-        <h1>温馨家庭</h1>
-        <ion-chip color="success">
-          <ion-icon name="shield-checkmark"></ion-icon>
-          <ion-label>金牌认证家庭</ion-label>
-        </ion-chip>
-      </div>
-    </div>
-
-    <ion-grid class="status-grid">
-      <ion-row>
-        <ion-col>
-          <ion-icon name="heart-circle" color="danger"></ion-icon>
-          <div>健康指数</div>
-          <ion-badge color="light">92/100</ion-badge>
-        </ion-col>
-        <ion-col>
-          <ion-icon name="timer" color="warning"></ion-icon>
-          <div>本月服务</div>
-          <ion-badge color="light">18.5h</ion-badge>
-        </ion-col>
-        <ion-col>
-          <ion-icon name="diamond" color="tertiary"></ion-icon>
-          <div>贡献值</div>
-          <ion-badge color="light">2,480</ion-badge>
-        </ion-col>
-      </ion-row>
-    </ion-grid>
-  </ion-card>
-
-  <!-- 资产看板 -->
-  <ion-grid class="dashboard-grid">
-    <ion-row>
-      <ion-col size="6">
-        <ion-card class="asset-card time-bank">
-          <ion-icon name="hourglass" color="warning"></ion-icon>
-          <h3>时间银行</h3>
-          <div class="value">127h</div>
-          <ion-progress-bar value="0.6" color="warning"></ion-progress-bar>
-        </ion-card>
-      </ion-col>
-      <ion-col size="6">
-        <ion-card class="asset-card family-value">
-          <ion-icon name="git-network" color="success"></ion-icon>
-          <h3>家庭树</h3>
-          <div class="value">5人</div>
-          <div class="sub-text">2位小辈在线</div>
-        </ion-card>
-      </ion-col>
-    </ion-row>
-  </ion-grid>
-
-  <!-- 快捷功能 -->
-  <ion-list class="quick-actions">
-    <ion-list-header>
-      <ion-label>快捷服务</ion-label>
-    </ion-list-header>
-    <ion-item button detail>
-      <ion-icon name="medkit" slot="start" color="danger"></ion-icon>
-      <ion-label>健康档案</ion-label>
-      <ion-note>3项待更新</ion-note>
+  <!-- 登录部分 -->
+  <div *ngIf="!isLoggedIn">
+    <ion-item>
+      <ion-label position="floating">用户名</ion-label>
+      <ion-input [(ngModel)]="username"></ion-input>
     </ion-item>
-    <ion-item button detail>
-      <ion-icon name="calendar" slot="start" color="primary"></ion-icon>
-      <ion-label>孝亲日程</ion-label>
-      <ion-note>明天体检提醒</ion-note>
+    
+    <ion-item>
+      <ion-label position="floating">密码</ion-label>
+      <ion-input type="password" [(ngModel)]="password"></ion-input>
     </ion-item>
-    <ion-item button detail>
-      <ion-icon name="wallet" slot="start" color="success"></ion-icon>
-      <ion-label>积分商城</ion-label>
-      <ion-note>新品上架5件</ion-note>
-    </ion-item>
-  </ion-list>
+    
+    <ion-button expand="block" (click)="login()">登录</ion-button>
+    <ion-button expand="block" (click)="goToRegister()">注册</ion-button>
+  </div>
+
+  <!-- 已登录部分 -->
+  <div *ngIf="isLoggedIn">
+    <ion-card>
+      <ion-card-header>
+        <ion-card-title>欢迎, {{currentUser?.data?.username}}</ion-card-title>
+        <ion-button slot="end" size="small" (click)="enterEditMode()" *ngIf="!editMode">编辑</ion-button>
+      </ion-card-header>
+      <ion-card-content *ngIf="!editMode">
+        <p>用户ID: {{currentUser?.id}}</p>
+        <p>注册时间: {{currentUser?.data?.createdAt | date}}</p>
+        <p>邮箱: {{currentUser?.data?.email}}</p>
+      </ion-card-content>
+
+      <!-- 用户信息编辑表单 -->
+      <ion-card-content *ngIf="editMode">
+        <ion-item>
+          <ion-label position="floating">用户名</ion-label>
+          <ion-input [(ngModel)]="editedUsername"></ion-input>
+        </ion-item>
+        
+        <ion-item>
+          <ion-label position="floating">邮箱</ion-label>
+          <ion-input [(ngModel)]="editedEmail"></ion-input>
+        </ion-item>
+        
+        <ion-button expand="block" color="success" (click)="saveEdit()">保存</ion-button>
+        <ion-button expand="block" (click)="cancelEdit()">取消</ion-button>
+      </ion-card-content>
+    </ion-card>
+    
+    <ion-button expand="block" color="danger" (click)="logout()">登出</ion-button>
+  </div>
 </ion-content>

+ 92 - 7
myapp/src/app/tab5/tab5.page.ts

@@ -1,16 +1,101 @@
-import { Component, OnInit } from '@angular/core';
+import { Component } from '@angular/core';
+import { CloudUser } from '../../lib/ncloud';
+import { Router } from '@angular/router';
 
 @Component({
   selector: 'app-tab5',
-  templateUrl: './tab5.page.html',
-  styleUrls: ['./tab5.page.scss'],
-  standalone: false
+  templateUrl: 'tab5.page.html',
+  styleUrls: ['tab5.page.scss'],
+  standalone: false, // 确保 standalone 设置为 false,否则可能会导致错误发生
 })
-export class Tab5Page implements OnInit {
+export class Tab5Page {
+  user = new CloudUser();
+  username = '';
+  password = '';
+  isLoggedIn = false;
+  currentUser: any = null;
 
-  constructor() { }
+  // 新增注册相关变量
+  registerUsername = '';
+  registerPassword = '';
+  registerEmail = '';
 
-  ngOnInit() {
+  // 新增用户信息编辑相关变量
+  editMode = false; // 确保添加该属性
+  editedUsername = '';
+  editedEmail = '';
+
+  constructor(private router: Router) {
+    this.checkLoginStatus();
+  }
+
+  async checkLoginStatus() {
+    this.currentUser = await this.user.current();
+    this.isLoggedIn = !!this.currentUser;
+  }
+
+  async login() {
+    if (!this.username || !this.password) {
+      alert('请输入用户名和密码');
+      return;
+    }
+
+    // 清除用户相关的缓存信息
+    localStorage.removeItem("NCloud/dev/User");
+
+    const result = await this.user.login(this.username, this.password);
+    if (result) {
+      this.isLoggedIn = true;
+      this.currentUser = result;
+      this.router.navigate(['/tabs/tab5/user-dashboard']); // 跳转到新页面
+    } else {
+      alert('登录失败,请检查用户名和密码');
+    }
+  }
+
+  async logout() {
+    const success = await this.user.logout();
+    if (success) {
+      this.isLoggedIn = false;
+      this.currentUser = null;
+      alert('登出成功');
+    } else {
+      alert('登出失败');
+    }
   }
 
+  goToRegister() {
+    this.router.navigate(['/tabs/tab5/register']);
+  }
+
+  enterEditMode() {
+    this.editMode = true;
+    this.editedUsername = this.currentUser?.data?.username || '';
+    this.editedEmail = this.currentUser?.data?.email || '';
+  }
+
+  async saveEdit() {
+    if (!this.editedUsername || !this.editedEmail) {
+      alert('请输入用户名和邮箱');
+      return;
+    }
+
+    try {
+      this.user.set({
+        username: this.editedUsername,
+        email: this.editedEmail
+      });
+      await this.user.save();
+      this.currentUser = this.user;
+      this.editMode = false;
+      alert('用户信息更新成功');
+    } catch (error) {
+      console.error('更新用户信息失败:', error);
+      alert('更新用户信息失败,请重试');
+    }
+  }
+
+  cancelEdit() {
+    this.editMode = false;
+  }
 }

+ 22 - 0
myapp/src/app/tab5/user-dashboard.page.html

@@ -0,0 +1,22 @@
+<ion-header>
+  <ion-toolbar>
+    <ion-title>用户面板</ion-title>
+    <ion-buttons slot="end">
+      <ion-button (click)="logout()">登出</ion-button>
+    </ion-buttons>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content class="ion-padding">
+  <ion-card>
+    <ion-card-header>
+      <ion-card-title>欢迎, {{currentUser?.data?.username}}</ion-card-title>
+    </ion-card-header>
+    <ion-card-content>
+      <p>用户ID: {{currentUser?.id}}</p>
+      <p>注册时间: {{currentUser?.data?.createdAt | date}}</p>
+      <p>邮箱: {{currentUser?.data?.email}}</p>
+    </ion-card-content>
+  </ion-card>
+
+  <ion-button expand="block" (click)="goToEditProfile()">个人资料</ion-button>

+ 0 - 0
myapp/src/app/tab4/tab4.page.scss → myapp/src/app/tab5/user-dashboard.page.scss


+ 54 - 0
myapp/src/app/tab5/user-dashboard.page.ts

@@ -0,0 +1,54 @@
+import { Component } from '@angular/core';
+import { CloudUser } from '../../lib/ncloud';
+import { Router } from '@angular/router';
+import { IonicModule } from '@ionic/angular';
+import { CommonModule } from '@angular/common';
+import { ModalController } from '@ionic/angular'; // 导入 ModalController
+import { EditProfileComponent } from './edit-profile.component'; // 假设编辑资料组件名为 EditProfileComponent
+
+@Component({
+  selector: 'app-user-dashboard',
+  templateUrl: 'user-dashboard.page.html',
+  styleUrls: ['user-dashboard.page.scss'],
+  imports: [IonicModule, CommonModule],
+  standalone: true 
+})
+export class UserDashboardPage {
+  user = new CloudUser();
+  currentUser: any = null;
+
+  constructor(private router: Router, private modalCtrl: ModalController) {
+    this.getCurrentUser();
+  }
+
+  async getCurrentUser() {
+    this.currentUser = await this.user.current();
+  }
+
+  async logout() {
+    const success = await this.user.logout();
+    if (success) {
+      this.router.navigate(['/tabs/tab5']); 
+    }
+  }
+
+  async goToEditProfile() {
+    const modal = await this.modalCtrl.create({
+      component: EditProfileComponent,
+      componentProps: {
+        currentUser: this.currentUser
+      }
+    });
+
+    modal.onDidDismiss().then(async (data) => {
+      if (data.data) {
+        // 更新用户信息
+        this.user.set(data.data);
+        await this.user.save();
+        this.currentUser = await this.user.current();
+      }
+    });
+
+    return await modal.present();
+  }
+}

+ 1 - 8
myapp/src/app/tabs/tabs-routing.module.ts

@@ -15,14 +15,7 @@ const routes: Routes = [
         path: 'tab2',
         loadChildren: () => import('../tab2/tab2.module').then(m => m.Tab2PageModule)
       },
-      {
-        path: 'tab3',
-        loadChildren: () => import('../tab3/tab3.module').then(m => m.Tab3PageModule)
-      },
-      {
-        path: 'tab4',
-        loadChildren: () => import('../tab4/tab4.module').then(m => m.Tab4PageModule)
-      },
+      
       {
         path: 'tab5',
         loadChildren: () => import('../tab5/tab5.module').then(m => m.Tab5PageModule)

+ 1 - 10
myapp/src/app/tabs/tabs.page.html

@@ -11,16 +11,7 @@
       <ion-label>需求发布</ion-label>
     </ion-tab-button>
 
-    <ion-tab-button tab="tab3">
-      <ion-icon name="business-outline"></ion-icon>
-      <ion-label>社区动态</ion-label>
-    </ion-tab-button>
-
-    <ion-tab-button tab="tab4">
-      <ion-icon name="diamond-outline"></ion-icon>
-      <ion-label>积分商城</ion-label>
-    </ion-tab-button>
-
+   
     <ion-tab-button tab="tab5">
       <ion-icon name="person-circle-outline"></ion-icon>
       <ion-label>我的</ion-label>