瀏覽代碼

fix: goToHighlight 不停止

xzw 3 年之前
父節點
當前提交
2fa3311aa1
共有 1 個文件被更改,包括 37 次插入6 次删除
  1. 37 6
      public/static/js/main_2020_show.js

+ 37 - 6
public/static/js/main_2020_show.js

@@ -5493,7 +5493,7 @@ window.Modernizr = function (n, e, t) {
                     return destination && destination.panoId == e
                 }
                 ,
-                n.prototype.redirectToItem = function (e, t) {
+                n.prototype.redirectToItem = function (e, t, o={}) {///
                     if (null === e || void 0 === e)
                         return void A.warn("Director.redirectToItem() -> Redirecting to null item.");
                     if (!this.wouldInterrupt())
@@ -5505,12 +5505,13 @@ window.Modernizr = function (n, e, t) {
                         s.setTimeout(function () {
                             this.setDestinationItem(e),
                                 this.goToDestination(!0, g.BEGINNING, a.warp.warpInterruptionRedirectTime, !1)
+                            o.callback && o.callback()//add
                         }
                             .bind(this), 0)
                     }
                         .bind(this);
-                    this.interrupt(g.END, 0),
-                        this.updateSuccessFunction(i)
+                    if(!o.dontInterrupt)    this.interrupt(g.END, 0) ////add dontInterrupt
+                    this.updateSuccessFunction(i)
                 }
                 ,
                 n.prototype.useSpecialTransition = function (e) {
@@ -5733,7 +5734,7 @@ window.Modernizr = function (n, e, t) {
                 }
                 ,
                 n.prototype.goToHighlight = function (e) {
-                    if (this.wouldInterrupt()){
+                    /*if (this.wouldInterrupt()){
                         this.itemCompare(this.destinationItem, e, 'equal') ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
                          
                     }else {
@@ -5749,9 +5750,39 @@ window.Modernizr = function (n, e, t) {
                             }) 
                     }
                     
-                    setTimeout(()=>{
+                     setTimeout(()=>{
                         this.playTour() 
-                    },1500)//自动开始
+                    },1800)//自动开始 */
+                     
+                    
+                    if (this.wouldInterrupt()){//在播放的话,改为不Interrupt
+                        
+                        if(this.itemCompare(this.destinationItem, e, 'equal') ){
+                            //目标点与点击的相同,不做处理
+                            console.log('目标点与点击的相同,不做处理')
+                        }else{
+                            this.redirectToItem(e, "goToHighlight", {callback:()=>{
+                                this.tourIsPlaying = !0 
+                            }});
+                            
+                            console.log('redirectToItem')
+                        }
+                    }else{
+                        //没在播放
+                        if ( this.isInterrupted()){ //??
+                            console.log('this.isInterrupted()')
+                            return;
+                        }
+                            
+                        this.clearWalkingSectionPaused(),
+                            this.setDestinationItem(e),
+                            this.useSpecialTransition("Hilight")
+                        this.goToDestination(true) //add true
+                         
+                    }
+                    
+                    
+                    
                 }
                 ,
                 n.prototype.prevHighlight = function () {