LiuSiQi 2 місяців тому
батько
коміт
4289b953e0

+ 2 - 1
angular.json

@@ -136,7 +136,8 @@
   "cli": {
     "schematicCollections": [
       "@ionic/angular-toolkit"
-    ]
+    ],
+    "analytics": "da8bcfbd-e182-4ef9-93c1-ccffc4b9fbdb"
   },
   "schematics": {
     "@ionic/angular-toolkit:component": {

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

@@ -5,6 +5,10 @@ const routes: Routes = [
   {
     path: '',
     loadChildren: () => import('./tabs/tabs.module').then(m => m.TabsPageModule)
+  },
+  {
+    path: 'new-page',
+    loadChildren: () => import('./new-page/new-page.module').then( m => m.NewPagePageModule)
   }
 ];
 @NgModule({

+ 17 - 0
src/app/new-page/new-page-routing.module.ts

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

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

+ 102 - 0
src/app/new-page/new-page.page.html

@@ -0,0 +1,102 @@
+<!-- <ion-header [translucent]="true">
+  <ion-toolbar>
+    <ion-title>new-page</ion-title>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content [fullscreen]="true">
+  <ion-header collapse="condense">
+    <ion-toolbar>
+      <ion-title size="large">new-page</ion-title>
+    </ion-toolbar>
+  </ion-header>
+</ion-content> -->
+
+<!-- <ion-header>
+  <ion-toolbar>
+    <ion-title>编辑个人资料</ion-title>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content class="edit-profile">
+  <div class="avatar-container">
+    <ion-avatar>
+      <img src="/assets/img/avatar.jpg" alt="Avatar">
+    </ion-avatar>
+  </div>
+
+  <ion-item>
+    <ion-label position="floating">用户名</ion-label>
+    <ion-input type="text" placeholder="请输入用户名"></ion-input>
+  </ion-item>
+
+  <ion-item>
+    <ion-label position="floating">邮箱</ion-label>
+    <ion-input type="email" placeholder="请输入邮箱"></ion-input>
+  </ion-item>
+
+  <ion-item>
+    <ion-label position="floating">电话</ion-label>
+    <ion-input type="tel" placeholder="请输入电话号码"></ion-input>
+  </ion-item>
+</ion-content> -->
+
+<!-- <ion-header>
+  <ion-toolbar>
+    <ion-title>编辑个人资料</ion-title>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content class="edit-profile">
+  <div class="avatar-container">
+    <ion-avatar>
+      <img src="/assets/img/man.jpg" alt="Avatar">
+    </ion-avatar>
+  </div>
+
+  <ion-item>
+    <ion-label position="floating">用户名</ion-label>
+    <ion-input type="text" placeholder="请输入用户名"></ion-input>
+  </ion-item>
+
+  <ion-item>
+    <ion-label position="floating">邮箱</ion-label>
+    <ion-input type="email" placeholder="请输入邮箱"></ion-input>
+  </ion-item>
+
+  <ion-item>
+    <ion-label position="floating">电话</ion-label>
+    <ion-input type="tel" placeholder="请输入电话号码"></ion-input>
+  </ion-item>
+</ion-content> -->
+
+<ion-header>
+  <ion-toolbar>
+    <ion-title>编辑个人信息</ion-title>
+  </ion-toolbar>
+</ion-header>
+
+<ion-content class="edit-profile">
+  <div class="avatar-container">
+    <ion-avatar class="avatar">
+      <img src="/assets/img/man.jpg" alt="Avatar">
+    </ion-avatar>
+  </div>
+
+  <ion-item>
+    <ion-label position="stacked">用户名</ion-label>
+    <ion-input type="text" placeholder="请输入用户名"></ion-input>
+  </ion-item>
+
+  <ion-item>
+    <ion-label position="stacked">邮箱</ion-label>
+    <ion-input type="email" placeholder="请输入邮箱"></ion-input>
+  </ion-item>
+
+  <ion-item>
+    <ion-label position="stacked">电话</ion-label>
+    <ion-input type="tel" placeholder="请输入电话号码"></ion-input>
+  </ion-item>
+
+  <ion-button expand="block" color="primary" class="save-button">保存</ion-button>
+</ion-content>

+ 68 - 0
src/app/new-page/new-page.page.scss

@@ -0,0 +1,68 @@
+// .edit-profile {
+//     .avatar-container {
+//       text-align: center;
+//       margin-top: 20px;
+  
+//       ion-avatar {
+//         width: 150px;
+//         height: 150px;
+//       }
+//     }
+  
+//     ion-item {
+//       margin-top: 20px;
+//     }
+//   }
+
+// .edit-profile {
+//     .avatar-container {
+//       text-align: center;
+//       margin-top: 20px;
+  
+//       ion-avatar {
+//         width: 150px;
+//         height: 150px;
+//       }
+//     }
+  
+//     ion-item {
+//       margin-top: 20px;
+//     }
+//   }
+
+.edit-profile {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  padding: 20px;
+
+  .avatar-container {
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    margin-top: 20px;
+
+    .avatar {
+      width: 150px;
+      height: 150px;
+    }
+  }
+
+  ion-item {
+    margin-top: 20px;
+
+    ion-label {
+      margin-bottom: 8px;
+    }
+
+    ion-input {
+      border-radius: 5px;
+      border: 1px solid #ccc;
+      padding: 8px;
+    }
+  }
+
+  .save-button {
+    margin-top: 20px;
+  }
+}

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

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

+ 32 - 0
src/app/new-page/new-page.page.ts

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

+ 1 - 1
src/app/tab3/tab3.page.html

@@ -13,7 +13,7 @@
         <div class="avatar">
           <!-- 圆形头像 -->
           <ion-avatar>
-            <img src="C:\Users\admin\Pictures\Screenshots" alt="Avatar">
+            <img src="/assets/img/man.jpg" alt="Avatar">
           </ion-avatar>
           <!-- 个人资料编辑按钮 -->
           <ion-button color="light" size="small" (click)="editProfile()">

+ 49 - 15
src/app/tab3/tab3.page.ts

@@ -1,3 +1,35 @@
+// import { Component } from '@angular/core';
+
+// @Component({
+//   selector: 'app-tab3',
+//   templateUrl: 'tab3.page.html',
+//   styleUrls: ['tab3.page.scss']
+// })
+// export class Tab3Page {
+
+//   constructor() {}
+
+//   editProfile() {
+//     this.navCtrl.navigateForward('/edit-profile');
+//   }
+
+//   viewInheritance() {
+//     // 查看数字遗产信息的逻辑
+//   }
+
+//   manageSecurity() {
+//     // 管理安全与隐私设置的逻辑
+//   }
+
+//   getHelp() {
+//     // 获取帮助与支持的逻辑
+//   }
+
+//   customizeSettings() {
+//     // 定制个性化设置的逻辑
+//   }
+// }
+import { Router } from '@angular/router';
 import { Component } from '@angular/core';
 
 @Component({
@@ -7,25 +39,27 @@ import { Component } from '@angular/core';
 })
 export class Tab3Page {
 
-  constructor() {}
+  constructor(private router: Router) {}
 
   editProfile() {
-    // 编辑个人资料的逻辑
+    this.router.navigate(['/new-page']);
   }
 
   viewInheritance() {
-    // 查看数字遗产信息的逻辑
-  }
-
-  manageSecurity() {
-    // 管理安全与隐私设置的逻辑
-  }
+        // 查看数字遗产信息的逻辑
+      }
+    
+      manageSecurity() {
+        // 管理安全与隐私设置的逻辑
+      }
+    
+      getHelp() {
+        // 获取帮助与支持的逻辑
+      }
+    
+      customizeSettings() {
+        // 定制个性化设置的逻辑
+      }
 
-  getHelp() {
-    // 获取帮助与支持的逻辑
-  }
-
-  customizeSettings() {
-    // 定制个性化设置的逻辑
-  }
+  
 }

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

@@ -2,17 +2,17 @@
 
   <ion-tab-bar slot="bottom">
     <ion-tab-button tab="tab1" href="/tabs/tab1">
-      <ion-icon aria-hidden="true" name="triangle"></ion-icon>
+      <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="ellipse"></ion-icon>
+      <ion-icon aria-hidden="true" name="diamond"></ion-icon>
       <ion-label>遗产联系人</ion-label>
     </ion-tab-button>
 
     <ion-tab-button tab="tab3" href="/tabs/tab3">
-      <ion-icon aria-hidden="true" name="square"></ion-icon>
+      <ion-icon aria-hidden="true" name="person"></ion-icon>
       <ion-label>我的</ion-label>
     </ion-tab-button>
   </ion-tab-bar>

BIN
src/assets/img/man.jpg