Selaa lähdekoodia

only first pano

zhouenguang 3 vuotta sitten
vanhempi
commit
ebd6eff160
1 muutettua tiedostoa jossa 7 lisäystä ja 5 poistoa
  1. 7 5
      web/public/static/js/main_2020_show.js

+ 7 - 5
web/public/static/js/main_2020_show.js

@@ -4539,14 +4539,15 @@ window.Modernizr = function(n, e, t) {
                 if(!this.panoIdMap) {
                     this.panoIdMap = new Map()
                     this.model.heroLocations.forEach( (value, index) => {
-                        value.heroLocations.forEach( hl => {
+                        // value.heroLocations.forEach( hl => {
+                            let hl = value.heroLocations[0]
                             let arr = this.panoIdMap.get(hl.panoId)
                             if(arr){
                                 this.panoIdMap.set(hl.panoId, [...arr, index])
                             } else {
                                 this.panoIdMap.set(hl.panoId, [index])
                             }
-                        })
+                        // })
                     })
                 }
             }
@@ -4818,7 +4819,7 @@ window.Modernizr = function(n, e, t) {
                     let audioSrc2 = common.getFileNameFromUrl(src)
                
                     if(audioSrc1 == audioSrc2){//应该是继续播放该folder 
-                        if(this.destinationItem[1] == 0){//从头开始播放 因为可能暂停后然后再点该缩略图播    // 周恩光改 开头为1
+                        if(this.destinationItem[1] == 0){//从头开始播放 因为可能暂停后然后再点该缩略图播
                             SoundManager.play('tour',null,0)  // currentTime = 0; 
                         }else if( audioObj.audio.paused && audioObj.audio.currentTime < audioObj.audio.duration   ){//未播完
                             SoundManager.play('tour')//继续播。为什么会有暂停的情况?如果手动切换到bgm了呢?
@@ -4913,6 +4914,7 @@ window.Modernizr = function(n, e, t) {
             n.prototype.playTour = function() {
                 if (!this.bounceable()) {
 
+                    if(!this.currentItem) this.currentItem = []
                     if(this.currentItem[0] != 0 || this.destinationItem[0]!= this.nItems-1){
                         // 周恩光加 从当前pano进行自动导览
                         let currentPanoDestinations = this.panoIdMap.get(this.player.currentPano.id)
@@ -5089,7 +5091,7 @@ window.Modernizr = function(n, e, t) {
                 var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
                 var item;
                 if(this.currentItem[1] >= currentChildNum - 1){//子目录中最后一个
-                    item = [currentItem[0] + 1, 0] //结果可能超出nItems // 周恩光 导览片段从1开始
+                    item = [currentItem[0] + 1, 0] //结果可能超出nItems
                 }else{
                     item = [currentItem[0] , currentItem[1]+1]
                 }
@@ -5125,7 +5127,7 @@ window.Modernizr = function(n, e, t) {
                 
                 A.debug("tourAdvance(" + e + ")") 
 
-                // 周恩光改 导览片段应该从1开始,而不是0
+                // 周恩光改
                 if(null === this.currentItem || void 0 === this.currentItem){
                     // this.setDestinationItem(this.firstDestination()) 
                     // this.setDestinationItem([currentPanoDestinations[0], 0])