Explorar el Código

修改 createHotList 因部分安卓手机的钉钉和支付宝浏览器如果立即添加到列表会卡住
展示页面更改consoleLog 还有去除updateHotvisible

xzw hace 3 años
padre
commit
fde4a137aa
Se han modificado 4 ficheros con 72 adiciones y 29 borrados
  1. 54 17
      index.html
  2. 6 3
      js/Hot.js
  3. 6 6
      js/main_2020_show.js
  4. 6 3
      js/manage.js

+ 54 - 17
index.html

@@ -787,7 +787,7 @@
         <div class="cad">
             <div id="cad"></div>
         </div>
-
+        
     </div>
    
     <script>
@@ -795,23 +795,60 @@
         var changeLog = ()=>{
             browser
             if((number == "TEST" || browser.valueFromHash('TEST')) && browser.isMobile()){
-                var exchange = function (o) {
-                console["old" + o] = console[o];
-                console[o] = function () {
-                  var args =   Array.from(arguments)
-                  console["old" + o].apply(this, arguments)
-                  var t = document.getElementById("consoleLog").innerHTML;
-                  
-                  var str = ''
-                  args.forEach(a=>{
-                      str += a + ' '
-                  })
-                  document.getElementById("consoleLog").innerHTML = str + "\n\n" + t;
+            
+                
+                /*var t = $("<textarea id='consoleLog'></textarea>")
+                      $('body').append(t);
+                      
+                
+                    var exchange = function (o) {
+                    console["old" + o] = console[o];
+                    console[o] = function () {
+                      var args =   Array.from(arguments)
+                      console["old" + o].apply(this, arguments)
+                      //var t = document.getElementById("consoleLog").innerHTML;
+                      
+                      var str = ''
+                      args.forEach(a=>{
+                          str += a + ' '
+                      })
+                      document.getElementById("consoleLog").innerHTML = str + "\n\n" + t;
+                    }
+                  }
+               */
                 }
-              }
+                
+                
+             if((number == "TEST" || browser.valueFromHash('TEST')) && browser.isMobile()){
+                var textarea = document.createElement('textarea');
+                  textarea.id = "consoleLog";
+
+                  document.getElementsByTagName("body")[0].appendChild(textarea);
+                  var list = ["log", "error", "warn", "debug", "info", "time", "timeEnd"]
+                  var exchange = function (o) {
+                    console["old" + o] = console[o];
+                    console[o] = function (str) {
+                    
+                    
+                        var args =   Array.from(arguments)
+                        console["old" + o].apply(this, arguments)
+                        var str = ''
+                        args.forEach(a=>{
+                            str += a + ','
+                        })
+                         textarea.innerHTML = str + "\n\n" + textarea.innerHTML;
+                    
+                      /*console["old" + o](str);
+                      var t = document.getElementById("consoleLog").innerHTML;
+                      document.getElementById("consoleLog").innerHTML = str + "\n\n" + t;*/
+                    }
+                  }
+
+                  for (var i = 0; i < list.length; i++) {
+                    exchange(list[i])
+                  } 
            
-            }
-            
+            }   
         }
     </script>
 
@@ -829,7 +866,7 @@
     <script src="js/SpecialScene.js"></script>
     <script src="js/manage.js"></script> 
     <!-- <script src="js/lib/stats.min.js"></script> -->
-    <script src="js/Hot.js"></script>  
+    <script src="js/Hot.js?m=1"></script>  
     <script src="js/main_2020_show.js"></script>
     <script src="js/lib/OBJLoader.js"></script>
     <script src="/CAD/bundle.js"></script>

+ 6 - 3
js/Hot.js

@@ -1636,9 +1636,12 @@ window.initHot = function(model){
             li.appendChild(span);
             docFragment.appendChild(li);
              
-        })  
-        var ul = document.querySelector('#hotListContent ul');
-        ul && ul.appendChild(docFragment);
+        }) 
+        setTimeout(()=>{        
+            var ul = document.querySelector('#hotListContent ul');
+            ul && ul.appendChild(docFragment);   
+        },3000) //部分安卓手机的钉钉和支付宝浏览器如果立即添加到列表会卡住 
+       
          
     }
             

+ 6 - 6
js/main_2020_show.js

@@ -21885,7 +21885,7 @@ window.Modernizr = function(n, e, t) {
                 
                 //add
                 this.transitionPos({type:"beforeFlytopano", pano:this.currentPano, dur:0})
-                this.updateHotVisible()
+                //this.updateHotVisible()
                 Hot.updateVisibles([this.currentPano])
                 this.modeTran = "panorama-panorama"
                 
@@ -22620,7 +22620,7 @@ window.Modernizr = function(n, e, t) {
                 })
             }
             ,
-            n.prototype.updateHotVisible = function(pano){  
+            /* n.prototype.updateHotVisible = function(pano){  
                 var hots = this.model.hots;
                 pano = pano || this.currentPano; 
                 
@@ -22634,7 +22634,7 @@ window.Modernizr = function(n, e, t) {
                     }
                     hots[index].mesh.visible = visible; 
                 } 
-            } 
+            }  */
             
              
             
@@ -22747,7 +22747,7 @@ window.Modernizr = function(n, e, t) {
                     
                     
                      //---------before fly--------------- add
-                    this.updateHotVisible(i); //更新热点显示
+                    //this.updateHotVisible(i); //更新热点显示
                     this.transitionPos({type:"beforeFlytopano", pano:i, dur:I})//add 
                     Hot.updateVisibles([this.currentPano, i])
                     
@@ -23404,7 +23404,7 @@ window.Modernizr = function(n, e, t) {
                     
                     //add:
                     this.updateMarkerVisi() ;
-                    (this.mode == u.PANORAMA) && this.updateHotVisible(), 
+                    //(this.mode == u.PANORAMA) && this.updateHotVisible(), 
                     this.mode == u.PANORAMA&&this.model.floorLogos&&( 
                         this.model.changefloorLogoOpa({index:0, from:0, opa:1, dur: 150 }),//this.model.floorLogoShow(0,150);
                         this.model.floorLogos[0].visible = true
@@ -23436,7 +23436,7 @@ window.Modernizr = function(n, e, t) {
                 
                 this.mode = u.TRANSITIONING,
                 
-                p ==  "panorama" && this.updateHotVisible(),     
+                //p ==  "panorama" && this.updateHotVisible(),     
                 
                 t.promise()
             }

+ 6 - 3
js/manage.js

@@ -994,12 +994,13 @@ var SoundManager = {//暂不支持同时播放
             if(currentTime!=void 0){
                 object.audio.currentTime = currentTime
             }
-            if(object.audio){
+            if(object.audio && object.src){
                 object.audio.load();	// iOS 9   还需要额外的 load 一下, 否则直接 play 无效 *///https://www.cnblogs.com/interdrp/p/4211883.html   部分资料
                 object.audio.play();
                 object.callback && object.callback(true)
+                Log(name + '  播放 '  )
             }
-            Log(name + '  播放 '  )
+            
         }
         
     },
@@ -1078,8 +1079,10 @@ var SoundManager = {//暂不支持同时播放
     
     
     initAutoPlay:function(){  //处理设备自动播放限制
+     
+    
         let play = function(){  
-            if(this.currentAudio && this.currentAudio.audio){
+            if(this.currentAudio && this.currentAudio.audio && this.currentAudio.src){
                 this.currentAudio.audio.play() 
                 Log(`${this.currentAudio.name} 自动播放成功`) //即使设置src在这之后好像也能成功播放
             }else{