gemercheung 1 ano atrás
pai
commit
18cc1feec0

+ 21 - 0
miniprogram/components/ar-tracker/ar-tracker.js

@@ -7,6 +7,25 @@ Component({
   properties: {
 
   },
+  lifetimes: {
+    async attached() {
+      console.log('data', this.data)
+    },
+    async detached() {
+      console.error('detached')
+      this.video1 && (this.video1 = null);
+      this.video2 && (this.video2 = null);
+      this.animator1 && (this.animator1 = null);
+      this.animator2 && (this.animator2 = null);
+      this.animator3 && (this.animator3 = null);
+      this.setData({
+        isStartPlay1: false,
+        isStartPlay2: false,
+        isStartPlay3: false,
+      })
+
+    }
+  },
 
   /**
    * 组件的初始数据
@@ -14,6 +33,8 @@ Component({
   data: {
     loaded: false,
     isStartPlay1: false,
+    isStartPlay2: false,
+    isStartPlay3: false,
   },
 
   /**

+ 2 - 2
miniprogram/components/ar-tracker/ar-tracker.wxml

@@ -6,10 +6,10 @@
     <xr-asset-load type="gltf" asset-id="item2" src="https://houseoss.4dkankan.com/mini-ar-test/AR/2/gc99.glb" />
     <xr-asset-load type="gltf" asset-id="item3" src="https://houseoss.4dkankan.com/mini-ar-test/mtgj.glb" />
 
-    <xr-asset-load type="video-texture" asset-id="item1-v" src="https://houseoss.4dkankan.com/mini-ar-test/AR/1/video.mp4" options="autoPlay:false,loop:false,abortAudio:false,placeHolder:'https://houseoss.4dkankan.com/mini-ar-test/AR/1/video.mp4?x-oss-process=video/snapshot,t_0,f_jpg,w_1000,m_fast,ar_auto'" />
+    <xr-asset-load type="video-texture" asset-id="item1-v" src="https://houseoss.4dkankan.com/mini-ar-test/AR/1/video1-480.mp4" options="autoPlay:false,loop:false,abortAudio:false,placeHolder:https://houseoss.4dkankan.com/mini-ar-test/AR/1/video1-480.mp4?x-oss-process=video/snapshot,t_0,f_jpg,w_1000,m_fast,ar_auto'" />
     <xr-asset-material asset-id="item1-m" effect="simple" uniforms="u_baseColorMap: video-item1-v" />
 
-    <xr-asset-load type="video-texture" asset-id="item2-v" src="https://houseoss.4dkankan.com/mini-ar-test/AR/2/video.mp4" options="autoPlay:false,loop:false,abortAudio:false,placeHolder:'https://houseoss.4dkankan.com/mini-ar-test/AR/2/video.mp4?x-oss-process=video/snapshot,t_0,f_jpg,w_1000,m_fast,ar_auto'" />
+    <xr-asset-load type="video-texture" asset-id="item2-v" src="https://houseoss.4dkankan.com/mini-ar-test/AR/2/video2-480.mp4" options="autoPlay:false,loop:false,abortAudio:false,placeHolder:'https://houseoss.4dkankan.com/mini-ar-test/AR/2/video2-480.mp4?x-oss-process=video/snapshot,t_0,f_jpg,w_1000,m_fast,ar_auto'" />
     <xr-asset-material asset-id="item2-m" effect="simple" uniforms="u_baseColorMap: video-item2-v" />
 
   </xr-assets>

+ 2 - 2
miniprogram/components/xr-ar-vio-marker-1/index.wxml

@@ -1,10 +1,10 @@
-<xr-scene ar-system="modes:Plane Marker; planeMode: 1" bind:ready="handleReady" bind:ar-ready="handleARReady">
+<xr-scene ar-system="modes:Plane; planeMode: 1" bind:ready="handleReady" bind:ar-ready="handleARReady">
   <!-- vio + marker 模式下 planeMode 需设置为 1 (只允许水平面识别) -->
   <xr-assets bind:progress="handleAssetsProgress" bind:loaded="handleAssetsLoaded">
     <xr-asset-load type="gltf" asset-id="anchor" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/ar-plane-marker.glb" />
     <xr-asset-load type="gltf" asset-id="gltf-item" src="https://houseoss.4dkankan.com/mini-ar-test/AR/1/anima4.glb" />
     <xr-asset-load type="gltf" asset-id="butterfly" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/butterfly/index.glb" />
-    <xr-asset-load type="video-texture" asset-id="animaV" src="https://houseoss.4dkankan.com/mini-ar-test/AR/1/video.mp4" options="autoPlay:false,loop:false,abortAudio:false,placeHolder:'https://houseoss.4dkankan.com/mini-ar-test/AR/1/video.mp4?x-oss-process=video/snapshot,t_0,f_jpg,w_1000,m_fast,ar_auto'" />
+    <xr-asset-load type="video-texture" asset-id="animaV" src="https://houseoss.4dkankan.com/mini-ar-test/AR/1/video1-480.mp4" options="autoPlay:false,loop:false,abortAudio:false,placeHolder:'https://houseoss.4dkankan.com/mini-ar-test/AR/1/video1-480.mp4?x-oss-process=video/snapshot,t_0,f_jpg,w_1000,m_fast,ar_auto'" />
     <xr-asset-material asset-id="matAnimaV" effect="simple" uniforms="u_baseColorMap: video-animaV" />
   </xr-assets>
 

+ 2 - 2
miniprogram/components/xr-ar-vio-marker-2/index.wxml

@@ -1,4 +1,4 @@
-<xr-scene ar-system="modes:Plane Marker; planeMode: 1" bind:ready="handleReady" bind:ar-ready="handleARReady">
+<xr-scene ar-system="modes:Plane; planeMode: 1" bind:ready="handleReady" bind:ar-ready="handleARReady">
   <!-- vio + marker 模式下 planeMode 需设置为 1 (只允许水平面识别) -->
   <xr-assets bind:progress="handleAssetsProgress" bind:loaded="handleAssetsLoaded">
     <xr-asset-load type="gltf" asset-id="anchor" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/ar-plane-marker.glb" />
@@ -7,7 +7,7 @@
     <xr-asset-load type="gltf" asset-id="gltf-item" src="https://houseoss.4dkankan.com/mini-ar-test/AR/2/gc99.glb" />
     <!-- <xr-asset-load type="gltf" asset-id="butterfly" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/butterfly/index.glb" /> -->
 
-    <xr-asset-load type="video-texture" asset-id="cat" src="https://houseoss.4dkankan.com/mini-ar-test/AR/2/video.mp4" options="autoPlay:false,loop:false,abortAudio:false,placeHolder:https://houseoss.4dkankan.com/mini-ar-test/AR/2/video.mp4?x-oss-process=video/snapshot,t_0,f_jpg,w_1000,m_fast,ar_auto" />
+    <xr-asset-load type="video-texture" asset-id="cat" src="https://houseoss.4dkankan.com/mini-ar-test/AR/2/video2-480.mp4" options="autoPlay:false,loop:false,abortAudio:false,placeHolder:https://houseoss.4dkankan.com/mini-ar-test/AR/2/video2-480.mp4?x-oss-process=video/snapshot,t_0,f_jpg,w_1000,m_fast,ar_auto" />
 
     <xr-asset-material asset-id="catMat" effect="simple" uniforms="u_baseColorMap: video-cat" />
   </xr-assets>

+ 1 - 1
miniprogram/components/xr-ar-vio-marker-3/index.wxml

@@ -1,4 +1,4 @@
-<xr-scene ar-system="modes:Plane Marker; planeMode: 1" bind:ready="handleReady" bind:ar-ready="handleARReady">
+<xr-scene ar-system="modes:Plane; planeMode: 1" bind:ready="handleReady" bind:ar-ready="handleARReady">
   <!-- vio + marker 模式下 planeMode 需设置为 1 (只允许水平面识别) -->
   <xr-assets bind:progress="handleAssetsProgress" bind:loaded="handleAssetsLoaded">
     <xr-asset-load type="gltf" asset-id="anchor" src="https://mmbizwxaminiprogram-1258344707.cos.ap-guangzhou.myqcloud.com/xr-frame/demo/ar-plane-marker.glb" />

+ 38 - 38
project.config.json

@@ -1,39 +1,39 @@
-{
-  "description": "项目配置文件",
-  "miniprogramRoot": "miniprogram/",
-  "compileType": "miniprogram",
-  "setting": {
-    "useCompilerPlugins": [
-      "typescript"
-    ],
-    "babelSetting": {
-      "ignore": [],
-      "disablePlugins": [],
-      "outputPath": ""
-    },
-    "coverView": false,
-    "postcss": false,
-    "minified": false,
-    "enhance": true,
-    "showShadowRootInWxmlPanel": false,
-    "packNpmRelationList": [],
-    "ignoreUploadUnusedFiles": true,
-    "compileHotReLoad": false,
-    "skylineRenderEnable": true,
-    "es6": true
-  },
-  "simulatorType": "wechat",
-  "simulatorPluginLibVersion": {},
-  "condition": {},
-  "srcMiniprogramRoot": "miniprogram/",
-  "editorSetting": {
-    "tabIndent": "insertSpaces",
-    "tabSize": 2
-  },
-  "libVersion": "trial",
-  "packOptions": {
-    "ignore": [],
-    "include": []
-  },
-  "appid": "wxd55ee54235e90359"
+{
+  "description": "项目配置文件",
+  "miniprogramRoot": "miniprogram/",
+  "compileType": "miniprogram",
+  "setting": {
+    "useCompilerPlugins": [
+      "typescript"
+    ],
+    "babelSetting": {
+      "ignore": [],
+      "disablePlugins": [],
+      "outputPath": ""
+    },
+    "coverView": false,
+    "postcss": false,
+    "minified": false,
+    "enhance": true,
+    "showShadowRootInWxmlPanel": false,
+    "packNpmRelationList": [],
+    "ignoreUploadUnusedFiles": true,
+    "compileHotReLoad": false,
+    "skylineRenderEnable": true,
+    "es6": true
+  },
+  "simulatorType": "wechat",
+  "simulatorPluginLibVersion": {},
+  "condition": {},
+  "srcMiniprogramRoot": "miniprogram/",
+  "editorSetting": {
+    "tabIndent": "insertSpaces",
+    "tabSize": 2
+  },
+  "libVersion": "trial",
+  "packOptions": {
+    "ignore": [],
+    "include": []
+  },
+  "appid": "wxd55ee54235e90359"
 }

+ 21 - 21
project.private.config.json

@@ -1,22 +1,22 @@
-{
-  "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
-  "projectname": "mini-ar-demo",
-  "setting": {
-    "compileHotReLoad": true,
-    "skylineRenderEnable": true
-  },
-  "libVersion": "3.4.1",
-  "condition": {
-    "miniprogram": {
-      "list": [
-        {
-          "name": "pages/dunhuang/dunhuang",
-          "pathName": "pages/dunhuang/dunhuang",
-          "query": "fromScan=1",
-          "launchMode": "default",
-          "scene": null
-        }
-      ]
-    }
-  }
+{
+  "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
+  "projectname": "mini-ar-demo",
+  "setting": {
+    "compileHotReLoad": true,
+    "skylineRenderEnable": true
+  },
+  "libVersion": "3.4.1",
+  "condition": {
+    "miniprogram": {
+      "list": [
+        {
+          "name": "pages/dunhuang/dunhuang",
+          "pathName": "pages/dunhuang/dunhuang",
+          "query": "fromScan=1",
+          "launchMode": "default",
+          "scene": null
+        }
+      ]
+    }
+  }
 }