Browse Source

feat: 优化一页的时候

gemercheung 1 year ago
parent
commit
01e2b40bef
1 changed files with 5 additions and 7 deletions
  1. 5 7
      src/core/Scene.js

+ 5 - 7
src/core/Scene.js

@@ -288,7 +288,7 @@ export default class Scene extends Mitt {
 
 
     console.log("slides", slides);
     console.log("slides", slides);
 
 
-    if (slides >= 1) {
+    if (slides >= 1 && total > 3) {
       for (var i = 0; i <= slides; i++) {
       for (var i = 0; i <= slides; i++) {
         (function (index, that) {
         (function (index, that) {
           setTimeout(function () {
           setTimeout(function () {
@@ -298,18 +298,18 @@ export default class Scene extends Mitt {
             console.log(`Width: ${offset}`);
             console.log(`Width: ${offset}`);
             if (index === slides) {
             if (index === slides) {
               console.log("last");
               console.log("last");
-              that.emit("submitScreenshot", isSaveJpg);
+              that.emit("submitScreenshot", true);
             }
             }
           }, index * 500);
           }, index * 500);
         })(i, this); // 传递当前迭代的索引i给setTimeout的回调函数
         })(i, this); // 传递当前迭代的索引i给setTimeout的回调函数
       }
       }
     } else {
     } else {
-      // 只有一个或0个
-      if (total >= 1 && total <= 3) {
+      // 只有一个
+      if (total >= 1) {
         console.log("total", total);
         console.log("total", total);
         this.player.floorplanControls.reset();
         this.player.floorplanControls.reset();
         this.screenshot(-0.3, 227);
         this.screenshot(-0.3, 227);
-        this.emit("submitScreenshot");
+        this.emit("submitScreenshot", true);
       }
       }
     }
     }
   }
   }
@@ -341,8 +341,6 @@ export default class Scene extends Mitt {
     // console.log("height", height);
     // console.log("height", height);
   }
   }
 
 
-
-
   onBindEvent = () => {
   onBindEvent = () => {
     window.addEventListener("resize", this.onResize, false);
     window.addEventListener("resize", this.onResize, false);
   };
   };