0225273 7 ヶ月 前
コミット
915eea7a41

+ 31 - 0
package-lock.json

@@ -16,6 +16,9 @@
         "@angular/platform-browser": "^18.0.0",
         "@angular/platform-browser-dynamic": "^18.0.0",
         "@angular/router": "^18.0.0",
+        "@babylonjs/core": "^7.14.0",
+        "@babylonjs/loaders": "^7.14.0",
+        "@babylonjs/materials": "^7.14.0",
         "@capacitor/app": "6.0.0",
         "@capacitor/core": "6.1.0",
         "@capacitor/haptics": "6.0.0",
@@ -2614,6 +2617,28 @@
         "node": ">=6.9.0"
       }
     },
+    "node_modules/@babylonjs/core": {
+      "version": "7.14.0",
+      "resolved": "https://registry.npmmirror.com/@babylonjs/core/-/core-7.14.0.tgz",
+      "integrity": "sha512-1yTDyd+5W3GuarFoEYKtEr3dBE7/4N/a/2kwsz3DzBu7cPPjJgG0elRgfCkUm/bZ+9zHxUNfgip7sDF7elhYzQ=="
+    },
+    "node_modules/@babylonjs/loaders": {
+      "version": "7.14.0",
+      "resolved": "https://registry.npmmirror.com/@babylonjs/loaders/-/loaders-7.14.0.tgz",
+      "integrity": "sha512-TzxXXabwQ3qbUlSZUASU6AljPCtt0rQmlRQfsVvUp4TKBz8zYWNhTcWbO4hhBhwB2yWtuUwZAT04h2W8aKV5Wg==",
+      "peerDependencies": {
+        "@babylonjs/core": "^7.0.0",
+        "babylonjs-gltf2interface": "^7.0.0"
+      }
+    },
+    "node_modules/@babylonjs/materials": {
+      "version": "7.14.0",
+      "resolved": "https://registry.npmmirror.com/@babylonjs/materials/-/materials-7.14.0.tgz",
+      "integrity": "sha512-cqg4knLEDl3EinfYsrqcfG9QXMn+8OcFel0kbys5wvi4w38kx7/PvoEd5zLor0PivfHQdpK7gF77jeyZaZChRg==",
+      "peerDependencies": {
+        "@babylonjs/core": "^7.0.0"
+      }
+    },
     "node_modules/@capacitor/app": {
       "version": "6.0.0",
       "resolved": "https://registry.npmmirror.com/@capacitor/app/-/app-6.0.0.tgz",
@@ -7189,6 +7214,12 @@
         "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0"
       }
     },
+    "node_modules/babylonjs-gltf2interface": {
+      "version": "7.14.0",
+      "resolved": "https://registry.npmmirror.com/babylonjs-gltf2interface/-/babylonjs-gltf2interface-7.14.0.tgz",
+      "integrity": "sha512-yfoU8HA7k/qStdyFFCK3CXzUpyN/pksnPXj0I9kEf76XOospRm5VdLFvweombIyQQtMNV+aDAB8STqgECU3LDA==",
+      "peer": true
+    },
     "node_modules/balanced-match": {
       "version": "1.0.2",
       "resolved": "https://registry.npmmirror.com/balanced-match/-/balanced-match-1.0.2.tgz",

+ 3 - 0
package.json

@@ -21,6 +21,9 @@
     "@angular/platform-browser": "^18.0.0",
     "@angular/platform-browser-dynamic": "^18.0.0",
     "@angular/router": "^18.0.0",
+    "@babylonjs/core": "^7.14.0",
+    "@babylonjs/loaders": "^7.14.0",
+    "@babylonjs/materials": "^7.14.0",
     "@capacitor/app": "6.0.0",
     "@capacitor/core": "6.1.0",
     "@capacitor/haptics": "6.0.0",

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

@@ -68,6 +68,10 @@ const routes: Routes = [
   {
     path: 'consult',
     loadChildren: () => import('./consult/consult.module').then( m => m.ConsultPageModule)
+  },
+  {
+    path: 'babylon',
+    loadChildren: () => import('./babylon/babylon.module').then( m => m.BabylonPageModule)
   }
 
 

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

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

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

+ 6 - 0
src/app/babylon/babylon.page.html

@@ -0,0 +1,6 @@
+<div class="list">
+  <div (click)="showCharacter(item?.name)" class="character" *ngFor="let item of CharacterMeshList">
+    <h1>{{item?.name}}</h1>
+  </div>
+</div>
+<canvas id="renderCanvas" touch-action="none"></canvas>

+ 43 - 0
src/app/babylon/babylon.page.scss

@@ -0,0 +1,43 @@
+// 调试面板
+#scene-explorer-host {
+    position: absolute !important;
+}
+#sceneExplorer{
+    position:absolute!important;
+    height:100vh!important;
+}
+.babylonDebugLayer {
+    position: absolute;
+    top: 0;
+    right: 0;
+    bottom: 0;
+    width: 300px; /* 调试层的宽度 */
+    background-color: rgba(255, 255, 255, 0.8); /* 背景颜色和透明度 */
+    z-index: 20; /* 确保调试层在最顶层 */
+    overflow: auto; /* 如果内容过多,添加滚动条 */
+  }
+  
+  .babylonDebugLayer .content {
+    padding: 10px;
+  }
+
+// 展示区
+#renderCanvas {
+    width: 100vw;
+    height: 100vh;
+    display: block;
+    font-size: 0;
+    z-index: 1;
+}
+
+.list{
+    position: absolute;
+    top:20px;
+    z-index: 10;
+    width: 100vw;
+    display: flex;
+    justify-content: center;
+    .character{
+        
+    }
+}

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

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

+ 174 - 0
src/app/babylon/babylon.page.ts

@@ -0,0 +1,174 @@
+import { Component, OnInit } from '@angular/core';
+import * as BABYLON from "@babylonjs/core/Legacy/legacy";
+import { Engine, Scene } from "@babylonjs/core";
+import { FreeCamera } from "@babylonjs/core/Cameras/freeCamera";
+import { HemisphericLight } from "@babylonjs/core/Lights/hemisphericLight";
+import { Vector3 } from "@babylonjs/core/Maths/math.vector";
+import { CreateGround } from "@babylonjs/core/Meshes/Builders/groundBuilder";
+import { CreateSphere } from "@babylonjs/core/Meshes/Builders/sphereBuilder";
+import { GridMaterial } from "@babylonjs/materials/grid/gridMaterial";
+
+import "@babylonjs/loaders/glTF";
+
+@Component({
+  selector: 'app-babylon',
+  templateUrl: './babylon.page.html',
+  styleUrls: ['./babylon.page.scss'],
+})
+export class BabylonPage implements OnInit {
+
+  private engine: BABYLON.Engine|undefined;
+  private scene: BABYLON.Scene|undefined;
+
+  CharacterMap:any = {}
+  CharacterMeshList = [
+    {name:"古风少女",
+    dirPath:"https://nova-cloud.obs.cn-south-1.myhuaweicloud.com/storage/3d/model/ancient-chinese-woman/gltf/",
+    filePath:"scene.gltf"},
+    {name:"中国象棋",
+    dirPath:"https://nova-cloud.obs.cn-south-1.myhuaweicloud.com/storage/3d/model/chinese-chess/gltf/",
+    filePath:"scene.gltf"},
+    {name:"卡通异瞳少女",
+    dirPath:"https://nova-cloud.obs.cn-south-1.myhuaweicloud.com/storage/3d/model/vtuber-selen/gltf/",
+    filePath:"scene.gltf"},
+    {name:"中国老杯子",
+    dirPath:"https://nova-cloud.obs.cn-south-1.myhuaweicloud.com/storage/3d/model/chinese-iron-cup/",
+    filePath:"scene.gltf"},
+    {name:"中国城市lowpoly",
+    dirPath:"https://nova-cloud.obs.cn-south-1.myhuaweicloud.com/storage/3d/model/chinese-city-lowpoly/gltf/",
+    filePath:"scene.gltf"},
+
+  ]
+  constructor() { }
+
+  ngOnInit() {
+    this.initBabylon()
+  }
+
+  initBabylon(){
+    // Get the canvas element from the DOM.
+    const canvas:any = document.getElementById("renderCanvas");
+    // Set the canvas size to match the device pixel ratio
+    const devicePixelRatio = window.devicePixelRatio || 1;
+    canvas.width = window.innerWidth * devicePixelRatio;
+    canvas.height = window.innerHeight * devicePixelRatio;
+    this.engine = new BABYLON.Engine(canvas, true);
+    this.scene = new BABYLON.Scene(this.engine);
+
+    // Create a basic light, aiming 0,1,0 - meaning, to the sky.
+    const light = new BABYLON.HemisphericLight('light1', new BABYLON.Vector3(0, 1, 0), this.scene);
+
+    // 加载粒子效果覆盖地面
+    this.loadGroundParticle()
+    
+    // 设置初始相机
+    // Add an ArcRotateCamera to the scene and attach it to the canvas
+    // let initPositon = new BABYLON.Vector3(0,12,0)
+    let initPositon = new BABYLON.Vector3(0,0,0)
+    let beta = Math.PI / 2.5 // 镜头初始 纬度 Math.PI / 3 斜下45度
+    let radius = 20 // 镜头初始半径
+    const camera = new BABYLON.ArcRotateCamera('camera1', Math.PI / 2, beta, radius, initPositon, this.scene);
+    camera.attachControl(canvas, true);
+
+    // Load the FBX model
+
+    this.CharacterMeshList.forEach(character=>{
+      BABYLON.SceneLoader.ImportMesh('', character.dirPath, character.filePath, this.scene, (meshes, particleSystems, skeletons) => {
+        console.log(meshes)
+        // characterMesh.isVisible
+        meshes.forEach(mesh=>mesh.isVisible=false)
+        this.CharacterMap[character?.name] = {
+          meshes:meshes,
+          particleSystems:particleSystems,
+          skeletons:skeletons
+        }
+        if (skeletons.length > 0) {
+          this.scene?.beginAnimation(skeletons[0], 0, 100, true);
+        }
+      });
+    })
+    setTimeout(() => {
+      this.showCharacter("机器人")
+    }, 3000);
+    
+
+    // Register a render loop to repeatedly render the scene.
+    this.engine.runRenderLoop(() => {
+      this.scene?.render();
+    });
+
+    // 开启调试层,用于抓取角度
+    this.scene.debugLayer.show();
+
+    // Watch for browser/canvas resize events
+    window.addEventListener('resize', () => {
+      this.engine?.resize();
+    });
+  }
+
+  showCharacter(name?:string){
+    if(!name) return
+
+    Object.keys(this.CharacterMap).forEach(tempname=>{
+      let character = this.CharacterMap[tempname];
+      if(tempname==name){
+        if(character.meshes?.length){
+          character.meshes.forEach((mesh:any)=>mesh.isVisible=true)
+        }
+      }else{
+        if(character.meshes?.length){
+          character.meshes.forEach((mesh:any)=>mesh.isVisible=false)
+        }
+      }
+    })
+
+   
+  }
+  loadGroundParticle(){
+      if(!this.scene) return
+      // 创建粒子系统
+      const particleSystem = new BABYLON.ParticleSystem("particles", 2000, this.scene);
+
+      // 纹理
+      particleSystem.particleTexture = new BABYLON.Texture("textures/flare.png", this.scene);
+
+      // 发射器
+      particleSystem.emitter = new BABYLON.Vector3(0, 0, 0); // 发射器位置
+      particleSystem.minEmitBox = new BABYLON.Vector3(-300, 0, -300); // 最小发射范围
+      particleSystem.maxEmitBox = new BABYLON.Vector3(300, 0, 300); // 最大发射范围
+
+      // 粒子颜色
+      particleSystem.color1 = new BABYLON.Color4(1, 1, 1, 1);
+      particleSystem.color2 = new BABYLON.Color4(0.5, 0.5, 1, 1);
+      particleSystem.colorDead = new BABYLON.Color4(0, 0, 0.2, 0.5);
+
+      // 粒子大小
+      particleSystem.minSize = 0.1;
+      particleSystem.maxSize = 0.5;
+
+      // 粒子生命周期
+      particleSystem.minLifeTime = 0.3;
+      particleSystem.maxLifeTime = 1.5;
+
+      // 发射速率
+      particleSystem.emitRate = 1000;
+
+      // 粒子方向
+      particleSystem.direction1 = new BABYLON.Vector3(-1, 1, -1);
+      particleSystem.direction2 = new BABYLON.Vector3(1, 1, 1);
+
+      // 重力
+      particleSystem.gravity = new BABYLON.Vector3(0, -9.81, 0);
+
+      // 粒子速度
+      particleSystem.minEmitPower = 0.5;
+      particleSystem.maxEmitPower = 1.5;
+      particleSystem.updateSpeed = 0.01;
+
+      // 开始粒子系统
+      particleSystem.start();
+  }
+
+}
+
+

+ 86 - 92
src/app/tab1/tab1.page.html

@@ -90,7 +90,7 @@
       <ion-icon name="heart-circle"></ion-icon>
       风格测试
     </ion-segment-button>
-    <ion-segment-button value="home">
+    <ion-segment-button (click)="gotoD()">
       <ion-icon name="home"></ion-icon>
       设计我家
     </ion-segment-button>
@@ -554,6 +554,91 @@
   <!-- 软装搭配页 -->
   <div *ngIf="selectedSegment === 'soft'">
     <!-- 软装搭配内容 -->
+        <!-- Swiper轮播图 手动创建 -->
+    <!-- Slider main container -->
+    <button (click)="slide1?.slideNext()">next</button>
+    <div #slide1Comp class="swiper">
+      <!-- Additional required wrapper其他必需的包装器 -->
+      <!-- 分页 -->
+      <div class="swiper-wrapper">
+        <div class="swiper-wrapper" style="transition-duration: 0ms; transform: translate3d(-280px, 0px, 0px);">
+          <div class="swiper-slide swiper-slide-duplicate" data-swiper-slide-index="7" style="width: 110px; margin-right: 30px;">
+            Slide 8
+          </div>
+          <div class="swiper-slide swiper-slide-duplicate" data-swiper-slide-index="8" style="width: 110px; margin-right: 30px;">
+            Slide 9
+          </div>
+          <div class="swiper-slide swiper-slide-duplicate swiper-slide-prev" data-swiper-slide-index="9" style="width: 110px; margin-right: 30px;">
+            Slide 10
+          </div>
+          <div class="swiper-slide swiper-slide-active" data-swiper-slide-index="0" style="width: 110px; margin-right: 30px;">
+            Slide 1
+          </div>
+          <div class="swiper-slide swiper-slide-next" data-swiper-slide-index="1" style="width: 110px; margin-right: 30px;">
+            Slide 2
+          </div>
+          <div class="swiper-slide" data-swiper-slide-index="2" style="width: 110px; margin-right: 30px;">
+            Slide 3
+          </div>
+          <div class="swiper-slide" data-swiper-slide-index="3" style="width: 110px; margin-right: 30px;">
+            Slide 4
+          </div>
+          <div class="swiper-slide" data-swiper-slide-index="4" style="width: 110px; margin-right: 30px;">
+            Slide 5
+          </div>
+          <div class="swiper-slide" data-swiper-slide-index="5" style="width: 110px; margin-right: 30px;">
+            Slide 6
+          </div>
+          <div class="swiper-slide" data-swiper-slide-index="6" style="width: 110px; margin-right: 30px;">
+            Slide 7
+          </div>
+          <div class="swiper-slide" data-swiper-slide-index="7" style="width: 110px; margin-right: 30px;">
+            Slide 8
+          </div>
+          <div class="swiper-slide" data-swiper-slide-index="8" style="width: 110px; margin-right: 30px;">
+            Slide 9
+          </div>
+          <div class="swiper-slide swiper-slide-duplicate-prev" data-swiper-slide-index="9" style="width: 110px; margin-right: 30px;">
+            Slide 10
+          </div>
+          <div class="swiper-slide swiper-slide-duplicate swiper-slide-duplicate-active" data-swiper-slide-index="0" style="width: 110px; margin-right: 30px;">
+            Slide 1
+          </div>
+          <div class="swiper-slide swiper-slide-duplicate swiper-slide-duplicate-next" data-swiper-slide-index="1" style="width: 110px; margin-right: 30px;">
+            Slide 2
+          </div>
+          <div class="swiper-slide swiper-slide-duplicate" data-swiper-slide-index="2" style="width: 110px; margin-right: 30px;">
+            Slide 3
+          </div>
+        </div>
+        <div class="swiper-pagination"></div>
+
+        <!-- If we need pagination分页按钮 -->
+        <div class="swiper-pagination swiper-pagination-clickable swiper-pagination-bullets">
+          <span class="swiper-pagination-bullet swiper-pagination-bullet-active" tabindex="0" role="button" aria-label="Go to slide 1"></span>
+          <span class="swiper-pagination-bullet" tabindex="0" role="button" aria-label="Go to slide 2"></span><span class="swiper-pagination-bullet" tabindex="0" role="button" aria-label="Go to slide 3"></span>
+          <span class="swiper-pagination-bullet" tabindex="0" role="button" aria-label="Go to slide 4"></span><span class="swiper-pagination-bullet" tabindex="0" role="button" aria-label="Go to slide 5"></span>
+          <span class="swiper-pagination-bullet" tabindex="0" role="button" aria-label="Go to slide 6"></span><span class="swiper-pagination-bullet" tabindex="0" role="button" aria-label="Go to slide 7"></span>
+          <span class="swiper-pagination-bullet" tabindex="0" role="button" aria-label="Go to slide 8"></span><span class="swiper-pagination-bullet" tabindex="0" role="button" aria-label="Go to slide 9"></span>
+          <span class="swiper-pagination-bullet" tabindex="0" role="button" aria-label="Go to slide 10"></span>
+        </div>
+        <span class="swiper-notification" aria-live="assertive" aria-atomic="true"></span>
+        <div class="swiper-pagination">
+          <div class="swiper-wrapper">
+            <!-- Slides幻灯片 -->
+            <div class="swiper-slide">
+              <img src="assets\img\ChineseStyle.png">
+            </div>
+            <div class="swiper-slide">
+              <img src="assets\img\NorthernEuropeStyle.png">
+            </div>
+            <div class="swiper-slide">
+              <img src="assets\img\WoodStyle.png">
+            </div>
+          </div>
+        </div>
+      </div>
+    </div>
     <img src="example3.jpg" alt="Example 4">
   </div>
 
@@ -699,97 +784,6 @@
     <img src="example3.jpg" alt="Example 8">
   </div>
 
-  <!-- 设计我家页 -->
-  <div *ngIf="selectedSegment === 'home'">
-    <!-- 设计我家内容 -->
-    <!-- Swiper轮播图 手动创建 -->
-    <!-- Slider main container -->
-    <button (click)="slide1?.slideNext()">next</button>
-    <div #slide1Comp class="swiper">
-      <!-- Additional required wrapper其他必需的包装器 -->
-      <!-- 分页 -->
-      <div class="swiper-wrapper">
-        <div class="swiper-wrapper" style="transition-duration: 0ms; transform: translate3d(-280px, 0px, 0px);">
-          <div class="swiper-slide swiper-slide-duplicate" data-swiper-slide-index="7" style="width: 110px; margin-right: 30px;">
-            Slide 8
-          </div>
-          <div class="swiper-slide swiper-slide-duplicate" data-swiper-slide-index="8" style="width: 110px; margin-right: 30px;">
-            Slide 9
-          </div>
-          <div class="swiper-slide swiper-slide-duplicate swiper-slide-prev" data-swiper-slide-index="9" style="width: 110px; margin-right: 30px;">
-            Slide 10
-          </div>
-          <div class="swiper-slide swiper-slide-active" data-swiper-slide-index="0" style="width: 110px; margin-right: 30px;">
-            Slide 1
-          </div>
-          <div class="swiper-slide swiper-slide-next" data-swiper-slide-index="1" style="width: 110px; margin-right: 30px;">
-            Slide 2
-          </div>
-          <div class="swiper-slide" data-swiper-slide-index="2" style="width: 110px; margin-right: 30px;">
-            Slide 3
-          </div>
-          <div class="swiper-slide" data-swiper-slide-index="3" style="width: 110px; margin-right: 30px;">
-            Slide 4
-          </div>
-          <div class="swiper-slide" data-swiper-slide-index="4" style="width: 110px; margin-right: 30px;">
-            Slide 5
-          </div>
-          <div class="swiper-slide" data-swiper-slide-index="5" style="width: 110px; margin-right: 30px;">
-            Slide 6
-          </div>
-          <div class="swiper-slide" data-swiper-slide-index="6" style="width: 110px; margin-right: 30px;">
-            Slide 7
-          </div>
-          <div class="swiper-slide" data-swiper-slide-index="7" style="width: 110px; margin-right: 30px;">
-            Slide 8
-          </div>
-          <div class="swiper-slide" data-swiper-slide-index="8" style="width: 110px; margin-right: 30px;">
-            Slide 9
-          </div>
-          <div class="swiper-slide swiper-slide-duplicate-prev" data-swiper-slide-index="9" style="width: 110px; margin-right: 30px;">
-            Slide 10
-          </div>
-          <div class="swiper-slide swiper-slide-duplicate swiper-slide-duplicate-active" data-swiper-slide-index="0" style="width: 110px; margin-right: 30px;">
-            Slide 1
-          </div>
-          <div class="swiper-slide swiper-slide-duplicate swiper-slide-duplicate-next" data-swiper-slide-index="1" style="width: 110px; margin-right: 30px;">
-            Slide 2
-          </div>
-          <div class="swiper-slide swiper-slide-duplicate" data-swiper-slide-index="2" style="width: 110px; margin-right: 30px;">
-            Slide 3
-          </div>
-        </div>
-        <div class="swiper-pagination"></div>
-
-        <!-- If we need pagination分页按钮 -->
-        <div class="swiper-pagination swiper-pagination-clickable swiper-pagination-bullets">
-          <span class="swiper-pagination-bullet swiper-pagination-bullet-active" tabindex="0" role="button" aria-label="Go to slide 1"></span>
-          <span class="swiper-pagination-bullet" tabindex="0" role="button" aria-label="Go to slide 2"></span><span class="swiper-pagination-bullet" tabindex="0" role="button" aria-label="Go to slide 3"></span>
-          <span class="swiper-pagination-bullet" tabindex="0" role="button" aria-label="Go to slide 4"></span><span class="swiper-pagination-bullet" tabindex="0" role="button" aria-label="Go to slide 5"></span>
-          <span class="swiper-pagination-bullet" tabindex="0" role="button" aria-label="Go to slide 6"></span><span class="swiper-pagination-bullet" tabindex="0" role="button" aria-label="Go to slide 7"></span>
-          <span class="swiper-pagination-bullet" tabindex="0" role="button" aria-label="Go to slide 8"></span><span class="swiper-pagination-bullet" tabindex="0" role="button" aria-label="Go to slide 9"></span>
-          <span class="swiper-pagination-bullet" tabindex="0" role="button" aria-label="Go to slide 10"></span>
-        </div>
-        <span class="swiper-notification" aria-live="assertive" aria-atomic="true"></span>
-        <div class="swiper-pagination">
-          <div class="swiper-wrapper">
-            <!-- Slides幻灯片 -->
-            <div class="swiper-slide">
-              <img src="assets\img\ChineseStyle.png">
-            </div>
-            <div class="swiper-slide">
-              <img src="assets\img\NorthernEuropeStyle.png">
-            </div>
-            <div class="swiper-slide">
-              <img src="assets\img\WoodStyle.png">
-            </div>
-          </div>
-        </div>
-      </div>
-    </div>
-    <img src="example3.jpg" alt="Example 9">
-  </div>
-
   <!-- 智能预算页 -->
   <div *ngIf="selectedSegment === 'budget'">
     <!-- 智能预算内容 -->

+ 6 - 2
src/app/tab1/tab1.page.ts

@@ -1,7 +1,8 @@
 import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
 
 import Swiper from 'swiper';
-
+import { NavController } from '@ionic/angular';
+import { Router } from '@angular/router';
 
 @Component({
   selector: 'app-tab1',
@@ -21,7 +22,7 @@ export class Tab1Page implements OnInit {
   selectedPackageCategory: string = 'top-listed-package'; // 默认选中上榜套餐
   selectedMaterialsCategory: string = 'decoration-materials'; // 默认选中装修建材
   
-  constructor() {}
+  constructor(private navCtrl: NavController,private router: Router) {}
 
   ngOnInit() {
     // 延迟500毫秒加载
@@ -30,6 +31,9 @@ export class Tab1Page implements OnInit {
     }, 500);
   }
   
+  gotoD(){
+    this.router.navigate(['/babylon']);
+  }
   // 初始化轮播图
   slide1:Swiper|undefined
   initSwiper(){