chenlei 3 meses atrás
pai
commit
6121e0e6c1

BIN
pages/cover/imgs/titile_zuantou@2x-min.png


+ 16 - 28
subPackages/pages/ar/constants.js

@@ -1,62 +1,50 @@
 export const MARKER_LIST = [
-  'https://houseoss.4dkankan.com/project/kelamayi/1/IMG_20250811_124756.jpg',
-  'https://houseoss.4dkankan.com/project/kelamayi/1/IMG_20250811_124804.jpg',
   'https://houseoss.4dkankan.com/project/kelamayi/1/1 (1).jpg',
-  'https://houseoss.4dkankan.com/project/kelamayi/1/1 (3).jpg',
+  'https://houseoss.4dkankan.com/project/kelamayi/1/1 (2).jpg',
 
-  'https://houseoss.4dkankan.com/project/kelamayi/2/IMG_20250811_124615.jpg',
-  'https://houseoss.4dkankan.com/project/kelamayi/2/IMG_20250811_124626.jpg',
   'https://houseoss.4dkankan.com/project/kelamayi/2/2 (1).jpg',
   'https://houseoss.4dkankan.com/project/kelamayi/2/2 (2).jpg',
   'https://houseoss.4dkankan.com/project/kelamayi/2/2 (3).jpg',
   
-  'https://houseoss.4dkankan.com/project/kelamayi/3/IMG_20250811_124636.jpg',
   'https://houseoss.4dkankan.com/project/kelamayi/3/3 (1).jpg',
   'https://houseoss.4dkankan.com/project/kelamayi/3/3 (2).jpg',
-  'https://houseoss.4dkankan.com/project/kelamayi/3/3 (4).jpg',
+  'https://houseoss.4dkankan.com/project/kelamayi/3/3 (3).jpg',
 
   'https://houseoss.4dkankan.com/project/kelamayi/4/4 (1).jpg',
   'https://houseoss.4dkankan.com/project/kelamayi/4/4 (2).jpg',
-  'https://houseoss.4dkankan.com/project/kelamayi/4/4 (4).jpg',
-  'https://houseoss.4dkankan.com/project/kelamayi/4/4 (5).jpg',
+  'https://houseoss.4dkankan.com/project/kelamayi/4/4 (3).jpg',
 
   'https://houseoss.4dkankan.com/project/kelamayi/5/5 (1).jpg',
+  'https://houseoss.4dkankan.com/project/kelamayi/5/5 (2).jpg',
   'https://houseoss.4dkankan.com/project/kelamayi/5/5 (3).jpg',
-  'https://houseoss.4dkankan.com/project/kelamayi/5/5 (5).jpg',
+  'https://houseoss.4dkankan.com/project/kelamayi/5/5 (4).jpg',
 
-  'https://houseoss.4dkankan.com/project/kelamayi/6/IMG_20250811_124652.jpg',
   'https://houseoss.4dkankan.com/project/kelamayi/6/6 (1).jpg',
   'https://houseoss.4dkankan.com/project/kelamayi/6/6 (2).jpg',
-  'https://houseoss.4dkankan.com/project/kelamayi/6/6 (5).jpg',
+  'https://houseoss.4dkankan.com/project/kelamayi/6/6 (3).jpg',
+  'https://houseoss.4dkankan.com/project/kelamayi/6/6 (4).jpg',
 
-  'https://houseoss.4dkankan.com/project/kelamayi/7/IMG_20250811_124709.jpg',
   'https://houseoss.4dkankan.com/project/kelamayi/7/7 (1).jpg',
   'https://houseoss.4dkankan.com/project/kelamayi/7/7 (2).jpg',
-  'https://houseoss.4dkankan.com/project/kelamayi/7/7 (6).jpg',
-  'https://houseoss.4dkankan.com/project/kelamayi/7/7 (7).jpg',
+  'https://houseoss.4dkankan.com/project/kelamayi/7/7 (3).jpg',
+  'https://houseoss.4dkankan.com/project/kelamayi/7/7 (4).jpg',
 
-  'https://houseoss.4dkankan.com/project/kelamayi/8/IMG_20250811_124729.jpg',
-  'https://houseoss.4dkankan.com/project/kelamayi/8/IMG_20250811_124733.jpg',
   'https://houseoss.4dkankan.com/project/kelamayi/8/8 (1).jpg',
   'https://houseoss.4dkankan.com/project/kelamayi/8/8 (2).jpg',
-  'https://houseoss.4dkankan.com/project/kelamayi/8/8 (5).jpg',
+  'https://houseoss.4dkankan.com/project/kelamayi/8/8 (3).jpg',
+  'https://houseoss.4dkankan.com/project/kelamayi/8/8 (4).jpg',
 
-  'https://houseoss.4dkankan.com/project/kelamayi/9/IMG_20250811_124744.jpg',
-  'https://houseoss.4dkankan.com/project/kelamayi/9/IMG_20250811_124747.jpg',
+  'https://houseoss.4dkankan.com/project/kelamayi/9/9 (1).jpg',
   'https://houseoss.4dkankan.com/project/kelamayi/9/9 (2).jpg',
-  'https://houseoss.4dkankan.com/project/kelamayi/9/9 (5).jpg',
+  'https://houseoss.4dkankan.com/project/kelamayi/9/9 (3).jpg',
 
-  'https://houseoss.4dkankan.com/project/kelamayi/10/IMG_20250811_124808.jpg',
-  'https://houseoss.4dkankan.com/project/kelamayi/10/IMG_20250811_124814.jpg',
+  'https://houseoss.4dkankan.com/project/kelamayi/10/10 (1).jpg',
   'https://houseoss.4dkankan.com/project/kelamayi/10/10 (2).jpg',
-  'https://houseoss.4dkankan.com/project/kelamayi/10/10 (4).jpg',
-  'https://houseoss.4dkankan.com/project/kelamayi/10/10 (5).jpg',
+  'https://houseoss.4dkankan.com/project/kelamayi/10/10 (3).jpg',
 
-  'https://houseoss.4dkankan.com/project/kelamayi/11/IMG_20250811_124822.jpg',
-  'https://houseoss.4dkankan.com/project/kelamayi/11/IMG_20250811_124829.jpg',
+  'https://houseoss.4dkankan.com/project/kelamayi/11/11 (1).jpg',
   'https://houseoss.4dkankan.com/project/kelamayi/11/11 (2).jpg',
   'https://houseoss.4dkankan.com/project/kelamayi/11/11 (3).jpg',
-  'https://houseoss.4dkankan.com/project/kelamayi/11/11 (5).jpg',
 
   'https://houseoss.4dkankan.com/project/kelamayi/12/12 (1).jpg',
   'https://houseoss.4dkankan.com/project/kelamayi/12/12 (2).jpg',

+ 64 - 59
subPackages/pages/ar/index.js

@@ -71,29 +71,6 @@ Component({
 
         console.log('@@@@@@@@ VKSession.version', session.version)
 
-        try {
-          const promises = MARKER_LIST.map(async url => {
-            const cacheKey = 'image_marker_' + hash(url)
-            const sysPath = await getCachedImage(url, cacheKey)
-            return [sysPath, url]
-          })
-          wx.showLoading({
-            title: '资源加载中...',
-          })
-          await Promise.all(promises).then(arr => {
-            for (const [path, url] of arr) {
-              console.log('marker添加成功:', path)
-              const id = session.addMarker(path)
-              console.log('markerId:', id)
-              this.data.markerMap[id] = url
-            }
-          })
-        } catch(err) {
-          console.log(err)
-        } finally {
-          wx.hideLoading()
-        }
-
         //  VKSession EVENT resize
         session.on('resize', () => {
           this.calcCanvasSize()
@@ -154,6 +131,34 @@ Component({
         console.log('ready to initloop')
         // start 初始化完毕后,进行更新渲染循环
         this.initLoop()
+
+        const batchSize = 2;
+        const delay = 1000;
+        
+        for (let i = 0; i < MARKER_LIST.length; i += batchSize) {
+          const batch = MARKER_LIST.slice(i, i + batchSize);
+          const promises = batch.map(async url => {
+            const cacheKey = 'image_marker_' + hash(url);
+            const sysPath = await getCachedImage(url, cacheKey);
+            return [sysPath, url];
+          });
+          
+          // 等待当前批次完成
+          const results = await Promise.all(promises);
+          
+          // 处理当前批次结果
+          for (const [path, url] of results) {
+            console.log('marker添加成功:', path);
+            const id = session.addMarker(path);
+            console.log('markerId:', id);
+            this.data.markerMap[id] = url;
+          }
+          
+          // 如果不是最后一批,等待2秒
+          if (i + batchSize < MARKER_LIST.length) {
+            await new Promise(resolve => setTimeout(resolve, delay));
+          }
+        }
       })
     },
     loop() {
@@ -187,42 +192,42 @@ Component({
       }
 
       // 绘制而为提示框的逻辑
-      if (this.hintInfo) {
-        // 存在提示信息,则更新
-        const THREE = this.THREE
-
-        // 原点偏移矩阵,VK情况下,marker 点对应就是 0 0 0,世界矩阵可以认为是一个单位矩阵
-        // marker 右侧点可以理解是 0.5 0 0
-        const center = new THREE.Vector3()
-        const right = new THREE.Vector3(0.5, 0, 0)
-
-        // 获取设备空间坐标
-        const devicePos = center.clone().project(this.camera)
-
-        // 转换坐标系,从 (-1, 1) 转到 (0, 100),同时移到左上角 0 0,右下角 1 1
-        const screenPos = new THREE.Vector3(0, 0, 0)
-        screenPos.x = devicePos.x * 50 + 50
-        screenPos.y = 50 - devicePos.y * 50
-
-        // 获取右侧点信息
-        const deviceRightPos = right.clone().project(this.camera)
-        const screenRightPos = new THREE.Vector3(0, 0, 0)
-        screenRightPos.x = deviceRightPos.x * 50 + 50
-
-        const markerHalfWidth = screenRightPos.x - screenPos.x
-
-        this.setData({
-          hintBoxList: [
-            {
-              markerId: this.hintInfo.markerId,
-              left: screenPos.x - markerHalfWidth,
-              top: screenPos.y - markerHalfWidth,
-              width: markerHalfWidth * this.data.domWidth * 2 / 100,
-              height: markerHalfWidth * this.data.domWidth * 2 / 100,
-            }
-          ]
-        })
-      }
+      // if (this.hintInfo) {
+      //   // 存在提示信息,则更新
+      //   const THREE = this.THREE
+
+      //   // 原点偏移矩阵,VK情况下,marker 点对应就是 0 0 0,世界矩阵可以认为是一个单位矩阵
+      //   // marker 右侧点可以理解是 0.5 0 0
+      //   const center = new THREE.Vector3()
+      //   const right = new THREE.Vector3(0.5, 0, 0)
+
+      //   // 获取设备空间坐标
+      //   const devicePos = center.clone().project(this.camera)
+
+      //   // 转换坐标系,从 (-1, 1) 转到 (0, 100),同时移到左上角 0 0,右下角 1 1
+      //   const screenPos = new THREE.Vector3(0, 0, 0)
+      //   screenPos.x = devicePos.x * 50 + 50
+      //   screenPos.y = 50 - devicePos.y * 50
+
+      //   // 获取右侧点信息
+      //   const deviceRightPos = right.clone().project(this.camera)
+      //   const screenRightPos = new THREE.Vector3(0, 0, 0)
+      //   screenRightPos.x = deviceRightPos.x * 50 + 50
+
+      //   const markerHalfWidth = screenRightPos.x - screenPos.x
+
+      //   this.setData({
+      //     hintBoxList: [
+      //       {
+      //         markerId: this.hintInfo.markerId,
+      //         left: screenPos.x - markerHalfWidth,
+      //         top: screenPos.y - markerHalfWidth,
+      //         width: markerHalfWidth * this.data.domWidth * 2 / 100,
+      //         height: markerHalfWidth * this.data.domWidth * 2 / 100,
+      //       }
+      //     ]
+      //   })
+      // }
 
       this.renderer.autoClearColor = false
       this.renderer.state.setCullFace(this.THREE.CullFaceBack)