xzw 10 месяцев назад
Родитель
Сommit
a16af69f65

+ 6 - 2
scene/public/static/js/Hot.js

@@ -6,6 +6,10 @@ const playVideoWhenFlyOut = false;
 const playVideoMax = window.isEdit ? 3 : browser.isMobile() ? 1 : 3;
 const playAniMax = window.isEdit ? 6 : browser.isMobile() ? 3 : 5;
 
+
+
+
+
 window.initHot = function (model) {
   var objLoader = new THREE.OBJLoader();
   var _planeGeometry = new THREE.PlaneGeometry(1, 1);
@@ -929,8 +933,8 @@ window.initHot = function (model) {
     }
 
     updateScale(e, t) {
-      //自适应调节大小
-      if (!DATA.autoAdjustHotScale || this.texType != "shine" || !this.plane) return;
+      //自适应调节大小   原先的shine改为了photo的动画
+      if (!DATA.autoAdjustHotScale || /* this.texType != "shine" */ this.texType != "photo"  || !this.plane) return;
 
       var scale = convertTool.getScaleForConstantSize(
         $.extend({}, autoSizeInfo, {

+ 68 - 37
scene/public/static/js/main_2020_show.js

@@ -4140,7 +4140,7 @@ window.Modernizr = function(n, e, t) {
                           , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
                         this.pinchDistance = Math.sqrt(t * t + i * i)
                     }
-                    //SoundManager.pause('tour') // 周恩光 点击场景时停止语音
+                    settings.tourSoundUnable || SoundManager.pause('tour') // 周恩光 点击场景时停止语音
                     this.emit(u.InputStart, "touch")
                 }
             }
@@ -4164,7 +4164,7 @@ window.Modernizr = function(n, e, t) {
                     case c.LEFT:
                         this.startRotationFrom(e.clientX, e.clientY)
                     }
-                    //SoundManager.pause('tour') // 周恩光 点击场景时停止语音
+                    settings.tourSoundUnable || SoundManager.pause('tour') // 周恩光 点击场景时停止语音
                     this.emit(u.InputStart, "mouse")
                 }
             }
@@ -4795,7 +4795,8 @@ window.Modernizr = function(n, e, t) {
                 //音频 
                 var musicInfo = this.model.heroLocations[this.destinationItem[0]].musicInfo
                 // zeg 手动导览不播放音频
-                /* if(musicInfo && musicInfo.music && !e){
+                
+                if(!settings.tourSoundUnable && musicInfo && musicInfo.music && !e){
 
                     let musicType = localStorage.getItem('xunirole') || 'male'
 
@@ -4820,7 +4821,7 @@ window.Modernizr = function(n, e, t) {
                         SoundManager.play('tour', manage.dealURL(src))
                     }                                                          
                                               
-                } */
+                }  
 
                 let oldPos = this.player.position.clone();
                 let oldPano = this.player.currentPano
@@ -5089,7 +5090,7 @@ window.Modernizr = function(n, e, t) {
 			} */
 			 
             n.prototype.stopTour = function(isAutoStop) {//停止导览        isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound.  不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
-                //SoundManager.pause('tour',true), // zeg 自动导览暂停时同时停止语音
+                settings.tourSoundUnable || SoundManager.pause('tour',true), // zeg 自动导览暂停时同时停止语音
                 this.isInterrupted() || this.transitionStage === y.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
                 this.tourIsPlaying = !1, 
                 this.interrupt(),
@@ -5105,9 +5106,14 @@ 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 {
+                    
+                    setTimeout(()=>{
+                        this.playTour() // 切换导览时(点击列表item),不要停止导览
+                    },2000) 
+                    
+                }else {
                     if (A.debug("<tour.goto " + e + ">"),
                     this.isInterrupted())
                         return;
@@ -6668,7 +6674,7 @@ window.Modernizr = function(n, e, t) {
                     t.changeMode(Be)
                 }),
                 $("#gui-modes-floorplan").on("click", function(e) {
-                    //SoundManager.pause('tour')
+                    settings.tourSoundUnable || SoundManager.pause('tour')
                     l(e),
                     i.mode !== _e.FLOORPLAN && (J.track("showcase_gui", {
                         gui_action: "click_floorplan_mode_button"
@@ -6676,7 +6682,7 @@ window.Modernizr = function(n, e, t) {
                     t.changeMode(_e.FLOORPLAN));
                 }),
                 $("#gui-modes-dollhouse").on("click", function(e) {
-                    //SoundManager.pause('tour')
+                    settings.tourSoundUnable || SoundManager.pause('tour')
                     l(e),
                     i.mode !== _e.DOLLHOUSE && (J.track("showcase_gui", {
                         gui_action: "click_dollhouse_mode_button"
@@ -6684,7 +6690,7 @@ window.Modernizr = function(n, e, t) {
                     t.changeMode(_e.DOLLHOUSE));
                 })
                 $("#gui-modes-inside").on("click", function() {
-                    //SoundManager.pause('tour')
+                    settings.tourSoundUnable || SoundManager.pause('tour')
                 })
             }
             function v(e, t) {
@@ -9116,9 +9122,9 @@ window.Modernizr = function(n, e, t) {
                 w.addEventListener(e, u.bind(this, !0), !0),
                 E.addEventListener(e, o, !0) 
                                
-                S.forEach(function(t) {//会触发导览停止  
+                /* S.forEach(function(t) {//会触发导览停止  
                     t.addEventListener(e, a, !0)
-                }) 
+                })  */
                 $("#drawer img").on(e, a)
             }) 
             document.addEventListener("keydown", u.bind(this, !1), !0) 
@@ -17851,6 +17857,17 @@ window.Modernizr = function(n, e, t) {
                             var sids = Object.keys(e.hots).sort((a,b)=>{return e.hots[a].order - e.hots[b].order});
                             sids.forEach((sid)=>{
                                 e.hots[sid].sid = sid
+                                if(e.hots[sid].texType == 'shine'){
+                                    e.hots[sid].texType = "photo"
+                                    e.hots[sid].texSrc = "https://super.4dage.com/data/KJ-t-tHpdpKvb0ew/edit/20250221_123045407.png?"
+                                    e.hots[sid].animateInfo = { 
+                                        "duration": 2000,
+                                        "cellXcount": 48,
+                                        "cellYcount": 1,
+                                        "loop": true,
+                                        "voidCount": 0
+                                    }
+                                }
                                 new Hot(e.hots[sid], e.hots[sid].version != 'multi' && "byHot" )
                             })
                         }
@@ -21449,12 +21466,16 @@ window.Modernizr = function(n, e, t) {
                 void 0 !== t && null !== t || (t = c.warp.teleportTime)
                 //add
                 player.model.hotGroup.visible = false
+                let oldPano = this.player.currentPano
+                let toPano =  this.player.model.panos.get(this.warpDestHeroLoc.panoId)
+                this.player.emit("pano.chosen", oldPano, toPano)
+                
                 var done = ()=>{   
                     this.player.transitionPos({type:"beforeFlytopano", pano:this.player.currentPano, dur:0, callback:()=>{
                         player.model.hotGroup.visible = true
                         Hot.updateVisibles([this.player.currentPano]) //更新热点显示 
                     }}) 
-                   
+                    this.player.emit("flying.ended",toPano.position, oldPano.position,toPano, oldPano) 
                 }
                 
                 if(window.DATA.momentTourBlackNewType){
@@ -23678,8 +23699,6 @@ window.Modernizr = function(n, e, t) {
                 
                 if (this.checkAndWaitForPanoLoad(pano, "high", "low", this.basePanoSize, retry))
                     return void (this.waitingToWarp = !0)
-                
-                this.emit("pano.chosen", oldPano, pano)
                  
                 /*  if(window.momentTourBlackNewType == 1) { */
                     
@@ -23697,8 +23716,7 @@ window.Modernizr = function(n, e, t) {
                 this.path.warpTravel_BLACK(null, 1500,1, ()=>{ 
                     pano != this.currentPano && this.currentPano.exit() 
                     pano.enter() 
-                    this.currentPano = pano
-                    this.emit("flying.ended", pano.position, oldPos, pano, oldPano) 
+                    this.currentPano = pano 
                     this.flying = false
                     this.nextPano = null 
                     this.updateMarkerVisi();//add
@@ -24486,20 +24504,27 @@ window.Modernizr = function(n, e, t) {
                 //zeg 标注一下
                 //var currentLocation = this.model.heroLocations[this.director.currentItem[0]] 
                 
-                var rotTime
-                if(currentLocation.rotTime == void 0 || currentLocation.rotTime == ''){
-                    var restChildCount = currentLocation0.heroLocations ? (currentLocation0.heroLocations.length-this.director.currentItem[1]-1) : 0
-                    var hasMusic = currentLocation0 && currentLocation0.musicInfo.music
-                    if(hasMusic){
-                        var audioObj = SoundManager.list.find(e=>e.name == 'tour') 
-                        var current = audioObj.audio.currentTime * 1e3 // || 0  //g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
-                        rotTime = currentLocation0.musicInfo.time - current
-                        if(restChildCount){//如果当前folder中还有剩下的item,平分一下时间
-                            rotTime = (rotTime-timeEachItem*restChildCount) / (restChildCount+1);   
-                        }  
-                    }else{
-                        rotTime = defaultRotTime
-                    } 
+                var rotTime 
+                
+                if( currentLocation.rotTime == void 0 || currentLocation.rotTime == ''){
+                    var hasMusic
+                    if(settings.tourSoundUnable){
+                        var restChildCount = currentLocation0.heroLocations ? (currentLocation0.heroLocations.length-this.director.currentItem[1]-1) : 0
+                        hasMusic = currentLocation0 && currentLocation0.musicInfo.music
+                        if(hasMusic){
+                            var audioObj = SoundManager.list.find(e=>e.name == 'tour') 
+                            var current = audioObj.audio.currentTime * 1e3 // || 0  //g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
+                            rotTime = currentLocation0.musicInfo.time - current
+                            if(restChildCount){//如果当前folder中还有剩下的item,平分一下时间
+                                rotTime = (rotTime-timeEachItem*restChildCount) / (restChildCount+1);   
+                            }  
+                        }else{
+                            rotTime = defaultRotTime
+                        } 
+                    }else{//区域音频    好难写。因为我不知道会不会导览的时候走重复的路
+                        //hasMusic = 
+                        
+                    }
                     rotTime = Math.max(0, rotTime)
                     Log("rotTime "+rotTime +" at item "+this.director.currentItem + (hasMusic ? (",musicCurrentTime:"+current+'音乐总长:'+currentLocation0.musicInfo.time) : ''),"#E8E") 
                 }else{
@@ -59338,11 +59363,12 @@ class PanTransGuide{
             if(e.cameraMode != 'panorama'){ 
                 e.originItem = originItem
                 this.nodes.push(e) 
-                return
+                return last = null //断连
             }
                 
               
             if(last){   
+                e.visited = true
                 path.setWarpDestination(e)
                 path.setWarpDestPano()
                 let A = path.getHeroPano(last), 
@@ -59374,8 +59400,8 @@ class PanTransGuide{
                 path.nodes.forEach((panoId,j)=>{ 
                     if(j == 0){
                         if(path.nodes.length == 1)return this.nodes.push({panoId,quaternion:quaEnd})//原地旋转
-                        /* if(i > 0) */return //和上一段末尾重复
-                        //return this.nodes.push({panoId,quaternion:quaStart})
+                        if(!last) return //和上一段末尾重复
+                        return this.nodes.push({panoId,quaternion:quaStart})
                     }
                     let r = disSections[j-1] / wholeDis
                     let quaternion = quaStart.clone()
@@ -59394,7 +59420,11 @@ class PanTransGuide{
                get(e,[i,0])
             }  
         })    
-         
+        //补 因为last前一个可能不是panorama,导致last没加进nodes
+        if(last && !last.visited){
+            get(last)   
+        }
+        
     }
     
     go(axis){
@@ -59444,8 +59474,8 @@ class PanTransGuide{
         //let dis = this.player.model.panos.get(aimNode.panoId).position.distanceTo(this.player.position)
         let moveStyle = (lastIndex == 0 && axis == -1 || this.currentIndex == 0 && axis != -1) ? "blackToPano" : "flyToPano" 
         this.player[moveStyle]({pano: this.player.model.panos.get(aimNode.panoId), quaternion:aimNode.quaternion}, ()=>{
-            //更新导览进度条
-            player.director.setDestinationItem( player.director.findNearestItem(true,true) )
+            //更新导览进度条 //已转移
+            //player.director.setCurrentItem( player.director.findNearestItem(true,true) )
         })
        
     }
@@ -59460,6 +59490,7 @@ class PanTransGuide{
 
 
 
+
 //2025新的需求  沉浸看展直接使用导览
 window.tourPlayCtl = { 
     go(axis){

+ 3 - 1
scene/public/static/js/manage.js

@@ -2529,7 +2529,7 @@ function initByTHREE(THREE){
             }
             
             //const pauseWhenGoNextPano = true //到有音频的地方先暂停,用户自己打开播放(后加的需求)
-            const pauseWhenChangeArea = true
+            const pauseWhenChangeArea = false//true
             
             {//根据漫游点切换音频
                 let curAudio  
@@ -2560,6 +2560,8 @@ function initByTHREE(THREE){
                 player.on("flying.ended",(a,b,pano,d)=>{
                     //pauseWhenGoNextPano && manage.switchBgmState(false)
                     pano && setCurBgm(pano) 
+                    //更新导览进度条  导览片段的选中与当前点位所属片段对应。
+                    player.director.setCurrentItem( player.director.findNearestItem(true,true) )
                 }) 
                 player.on("mode.changed", ()=>{ //飞出后不播放 也不显示按钮
                     if(player.mode != 'panorama'){

+ 3 - 3
scene/src/views/gui/menu.vue

@@ -476,7 +476,7 @@ export default {
           settings.playTourNearBy ? player.director.playTourNearBy() : player.director.playTour();
         } else {
           // 导览结束
-          player.director.tourInProgress && (player.director.stopTour(), player.director.endTourProgress());
+          player.director.tourInProgress && (player.director.stopTour(), player.director.endTourProgress()); 
         }
       },
     },
@@ -543,9 +543,9 @@ export default {
 
           if (null !== n.currentItem) {
             //n.currentItem是二维数组,代表导览中的两层,导览图片展示的是外层的,也就是数据第一个元素。
-            if (this.guideIsPlay) {
+            //if (this.guideIsPlay) { //导览片段的选中与当前点位所属片段对应。
               this.setData({ guidePlayIndex: n.currentItem[0] });
-            }
+            //}
           }
         });