|
@@ -1,27 +1,54 @@
|
|
import '../scss/index.scss'
|
|
import '../scss/index.scss'
|
|
|
|
+import '../scss/page/scene1.scss'
|
|
|
|
|
|
import PhotoSphereViewer from 'photo-sphere-viewer'
|
|
import PhotoSphereViewer from 'photo-sphere-viewer'
|
|
-import until from './until'
|
|
|
|
|
|
+import util from './until'
|
|
|
|
|
|
-import imgUrl from '../img/P1.jpg'
|
|
|
|
|
|
+// import imgUrl from '../img/P1.jpg'
|
|
import location from '../img/location.png';
|
|
import location from '../img/location.png';
|
|
import glass from '../img/glass.png'; //望远镜
|
|
import glass from '../img/glass.png'; //望远镜
|
|
import eUrl from '../img/E.png';
|
|
import eUrl from '../img/E.png';
|
|
-import lookout from '../video/lookout.mp4';
|
|
|
|
-import lakeVideo from '../video/lake.mp4'; // 介绍视频
|
|
|
|
|
|
|
|
var viewer = null
|
|
var viewer = null
|
|
var lakeFlag = false
|
|
var lakeFlag = false
|
|
|
|
|
|
|
|
+var indexPath = $('body').attr('data-path')
|
|
|
|
+
|
|
|
|
+// 进度相关
|
|
|
|
+var progressNum = 0
|
|
|
|
+var progressFlag = {
|
|
|
|
+ 'foot': false,
|
|
|
|
+ 'deer': false,
|
|
|
|
+ 'rabbit': false,
|
|
|
|
+ 'lake': false,
|
|
|
|
+ 'lookout': false
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+var videoMap = {
|
|
|
|
+ 'lookup': '8884585',
|
|
|
|
+ 'lake': '8887637',
|
|
|
|
+ 'aim': '8887375',
|
|
|
|
+ 'shoot': '8887379',
|
|
|
|
+ 'open': '8887381'
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+var mp4UrlMap = {
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+
|
|
var lakeV = {
|
|
var lakeV = {
|
|
init() {
|
|
init() {
|
|
this.initLakeView()
|
|
this.initLakeView()
|
|
this.handleReady()
|
|
this.handleReady()
|
|
|
|
+ this.getVideoSource()
|
|
|
|
+ this.handleNav()
|
|
},
|
|
},
|
|
initLakeView() {
|
|
initLakeView() {
|
|
viewer = new PhotoSphereViewer({
|
|
viewer = new PhotoSphereViewer({
|
|
container: 'photosphere',
|
|
container: 'photosphere',
|
|
- panorama: imgUrl,
|
|
|
|
|
|
+ panorama: 'http://hdzt.duowan.com/s/1806hunter/P1.jpg',
|
|
|
|
+ // panorama: imgUrl,
|
|
min_fov: 50,
|
|
min_fov: 50,
|
|
max_fov: 70,
|
|
max_fov: 70,
|
|
navbar: false,
|
|
navbar: false,
|
|
@@ -94,6 +121,16 @@ var lakeV = {
|
|
height: 59,
|
|
height: 59,
|
|
anchor: 'bottom center',
|
|
anchor: 'bottom center',
|
|
},
|
|
},
|
|
|
|
+ // 湖
|
|
|
|
+ {
|
|
|
|
+ id: 'location-lake',
|
|
|
|
+ x: 150,
|
|
|
|
+ y: 1965,
|
|
|
|
+ image: location,
|
|
|
|
+ width: 35,
|
|
|
|
+ height: 35,
|
|
|
|
+ anchor: 'bottom center',
|
|
|
|
+ },
|
|
],
|
|
],
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -119,19 +156,83 @@ var lakeV = {
|
|
$('.nav').fadeIn()
|
|
$('.nav').fadeIn()
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
+ },
|
|
|
|
+ getVideoSource() {
|
|
|
|
+ let vids = ['8892551', '8887637', '8887375', '8887379', '8887381','8890691','8890693','8890695','8897789','8897793','8897795','8897797']
|
|
|
|
|
|
- viewer.on('click', function(data) {
|
|
|
|
- console.log(data)
|
|
|
|
|
|
+ var videoEls = {
|
|
|
|
+ '8892551': 'lookup',
|
|
|
|
+ '8887637': 'lake',
|
|
|
|
+ '8887375': 'aim',
|
|
|
|
+ '8887379': 'shoot',
|
|
|
|
+ '8887381': 'open',
|
|
|
|
+ '8890691': 'book-lake',
|
|
|
|
+ '8890693': 'book-taiga',
|
|
|
|
+ '8890695': 'book-elden',
|
|
|
|
+ '8897789': 'picVideo',
|
|
|
|
+ '8897793': 'openB',
|
|
|
|
+ '8897795': 'aimB',
|
|
|
|
+ '8897797': 'shootB'
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $.ajax({
|
|
|
|
+ type: "GET",
|
|
|
|
+ dataType: "json",
|
|
|
|
+ url: `//video.duowan.com/jsapi/playPageVideoInfo/?vids=${vids.join(',')}`,
|
|
|
|
+ success: function(data) {
|
|
|
|
+ for(var i in data) {
|
|
|
|
+ let resouce = util.deCodeArg(data[i].c).all,
|
|
|
|
+ source = resouce.yuanhua || resouce[1300] || resouce[1000] || resouce[350]
|
|
|
|
+ let name = videoEls[i]
|
|
|
|
+ mp4UrlMap[name] = source.src
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ document.getElementById('open-video').src = mp4UrlMap['open']
|
|
|
|
+ document.getElementById('aim-video').src = mp4UrlMap['aim']
|
|
|
|
+ document.getElementById('shoot-video').src = mp4UrlMap['shoot']
|
|
|
|
+
|
|
|
|
+ document.getElementById('open-video-b').src = mp4UrlMap['openB']
|
|
|
|
+ document.getElementById('aim-video-b').src = mp4UrlMap['aimB']
|
|
|
|
+ document.getElementById('shoot-video-b').src = mp4UrlMap['shootB']
|
|
|
|
+
|
|
|
|
+ document.getElementById('book-lake-video').src = mp4UrlMap['book-lake']
|
|
|
|
+ document.getElementById('book-taiga-video').src = mp4UrlMap['book-taiga']
|
|
|
|
+ document.getElementById('book-elden-video').src = mp4UrlMap['book-elden']
|
|
|
|
+
|
|
|
|
+ lakeC.lookoutClick()
|
|
|
|
+ lakeC.playVideo()
|
|
|
|
+ }
|
|
})
|
|
})
|
|
|
|
+ },
|
|
|
|
+ // 导航权限处理
|
|
|
|
+ handleNav() {
|
|
|
|
+ // 初始化加载时
|
|
|
|
+ let permision = localStorage.getItem('hunter_permision')
|
|
|
|
+ if(permision) {
|
|
|
|
+ progressFlag = {
|
|
|
|
+ 'foot': true,
|
|
|
|
+ 'deer': true,
|
|
|
|
+ 'rabbit': true,
|
|
|
|
+ 'lake': true,
|
|
|
|
+ 'lookout': true
|
|
|
|
+ }
|
|
|
|
+ $('#cur-progress').html(5)
|
|
|
|
+ if(permision == 2) {
|
|
|
|
+ $('#scene-nav2').removeClass('disable')
|
|
|
|
+ } else if(permision == 3 || permision == 4){
|
|
|
|
+ $('#scene-nav2').removeClass('disable')
|
|
|
|
+ $('#scene-nav3').removeClass('disable')
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
var lakeC = {
|
|
var lakeC = {
|
|
init() {
|
|
init() {
|
|
this.modalShow()
|
|
this.modalShow()
|
|
- this.playVideo()
|
|
|
|
- this.lookoutClick()
|
|
|
|
- this.shooting()
|
|
|
|
|
|
+ util.shooting()
|
|
|
|
+ util.bookClick()
|
|
|
|
+ util.toolbarClick()
|
|
},
|
|
},
|
|
modalShow() {
|
|
modalShow() {
|
|
// 点击显示介绍弹窗
|
|
// 点击显示介绍弹窗
|
|
@@ -148,6 +249,12 @@ var lakeC = {
|
|
latitude: -0.27
|
|
latitude: -0.27
|
|
},600);
|
|
},600);
|
|
}
|
|
}
|
|
|
|
+ if(!progressFlag['foot']){
|
|
|
|
+ progressFlag['foot'] = true
|
|
|
|
+ $('#cur-progress').html(++progressNum)
|
|
|
|
+ progressNum == 5 ? $('#scene-nav2').removeClass('disable') : ''
|
|
|
|
+ progressNum == 5 ? localStorage.setItem('hunter_permision', '2') : ''
|
|
|
|
+ }
|
|
}
|
|
}
|
|
$(document).on('click', '#psv-marker-foot-polygon', function() {
|
|
$(document).on('click', '#psv-marker-foot-polygon', function() {
|
|
footModal()
|
|
footModal()
|
|
@@ -165,6 +272,12 @@ var lakeC = {
|
|
latitude: -0.05
|
|
latitude: -0.05
|
|
},600);
|
|
},600);
|
|
}
|
|
}
|
|
|
|
+ if(!progressFlag['deer']){
|
|
|
|
+ progressFlag['deer'] = true
|
|
|
|
+ $('#cur-progress').html(++progressNum)
|
|
|
|
+ progressNum == 5 ? $('#scene-nav2').removeClass('disable') : ''
|
|
|
|
+ progressNum == 5 ? localStorage.setItem('hunter_permision', '2') : ''
|
|
|
|
+ }
|
|
}
|
|
}
|
|
$(document).on('click', '#psv-marker-deer-polygon', function(e) {
|
|
$(document).on('click', '#psv-marker-deer-polygon', function(e) {
|
|
deerModal()
|
|
deerModal()
|
|
@@ -183,6 +296,12 @@ var lakeC = {
|
|
latitude: -0.07
|
|
latitude: -0.07
|
|
},600);
|
|
},600);
|
|
}
|
|
}
|
|
|
|
+ if(!progressFlag['rabbit']){
|
|
|
|
+ progressFlag['rabbit'] = true
|
|
|
|
+ $('#cur-progress').html(++progressNum)
|
|
|
|
+ progressNum == 5 ? $('#scene-nav2').removeClass('disable') : ''
|
|
|
|
+ progressNum == 5 ? localStorage.setItem('hunter_permision', '2') : ''
|
|
|
|
+ }
|
|
}
|
|
}
|
|
$(document).on('click', '#psv-marker-rabit-polygon', function(e) {
|
|
$(document).on('click', '#psv-marker-rabit-polygon', function(e) {
|
|
rabitModal()
|
|
rabitModal()
|
|
@@ -191,26 +310,50 @@ var lakeC = {
|
|
rabitModal()
|
|
rabitModal()
|
|
})
|
|
})
|
|
|
|
|
|
- // 开始狩猎
|
|
|
|
- $('.hunt-btn').click(function(){
|
|
|
|
- $('#lake-deer-modal').hide()
|
|
|
|
- $('#equit-modal').show()
|
|
|
|
- })
|
|
|
|
- $('.nav-item-wrap').click(function() {
|
|
|
|
- $('.nav-item-wrap').removeClass('active')
|
|
|
|
- $(this).parents('.container').find('.main').hide()
|
|
|
|
- $(this).addClass('active')
|
|
|
|
- var ind = $(this).attr('data-ind')
|
|
|
|
- if(ind == 1){
|
|
|
|
- $('#weapon-modal').show()
|
|
|
|
- }
|
|
|
|
- if(ind == 2){
|
|
|
|
- $('#fodder-modal').show()
|
|
|
|
|
|
+ //湖
|
|
|
|
+ $(document).on('click', '#psv-marker-location-lake', function() {
|
|
|
|
+ if(!$('#lake-pic')[0]){
|
|
|
|
+ var lakeHtml = ` <div class="mod-full-picture" id="lake-pic" style="display:none">
|
|
|
|
+ <div class="pub-btn go-back">返回</div>
|
|
|
|
+ <div class="full-pic-modal small-modal">
|
|
|
|
+ <div class="top-bar">
|
|
|
|
+ 莱顿湖
|
|
|
|
+ </div>
|
|
|
|
+ <div class="container clearfix">
|
|
|
|
+ <p>地球上湖泊总面积为270万平方公里,占陆地面积的1.8%,面积大于5000平方公里的湖</p>
|
|
|
|
+ <p>青海湖泊有35个。芬兰的湖泊最多,被称为“万湖之国”,拥有大小湖泊6万多个。</p>
|
|
|
|
+ <p>湖泊一旦形成,就受到外部自然因素和内部各种过程的持续作用而不断演变。入湖河流携带的大量泥沙和生物残骸年复一年在湖内沉积,湖盆逐渐淤浅,变成陆地,或随着沿岸带水生植物的发展,逐渐变成沼泽。</p>
|
|
|
|
+ <div class="eyes-btn"></div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="fullscreen-video fullscreen-video-picture" style="display: none">
|
|
|
|
+ <video id="picture-video" preload="metadata" width="100%">
|
|
|
|
+ <source src="${mp4UrlMap['picVideo']}">
|
|
|
|
+ </video>
|
|
|
|
+ <div class="close-icon close-full-video"></div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>`
|
|
|
|
+ $('body').append(lakeHtml)
|
|
|
|
+ util.bgMove($('.mod-full-picture'))
|
|
}
|
|
}
|
|
- if(ind == 3){
|
|
|
|
- $('#aim-modal').show()
|
|
|
|
|
|
+ $('#lake-pic').fadeIn()
|
|
|
|
+ if(!progressFlag['lake']){
|
|
|
|
+ progressFlag['lake'] = true
|
|
|
|
+ $('#cur-progress').html(++progressNum)
|
|
|
|
+ progressNum == 5 ? $('#scene-nav2').removeClass('disable') : ''
|
|
|
|
+ progressNum == 5 ? localStorage.setItem('hunter_permision', '2') : ''
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
+
|
|
|
|
+ $(document).on('click', '.eyes-btn', function() {
|
|
|
|
+ $('.fullscreen-video-picture').show()
|
|
|
|
+ var video = document.getElementById('picture-video')
|
|
|
|
+ video.play()
|
|
|
|
+ video.addEventListener("ended",function(){
|
|
|
|
+ video.load()
|
|
|
|
+ $('.fullscreen-video-picture').hide()
|
|
|
|
+ })
|
|
|
|
+ })
|
|
},
|
|
},
|
|
playVideo() {
|
|
playVideo() {
|
|
$('#rabbit-video-play').click(function() {
|
|
$('#rabbit-video-play').click(function() {
|
|
@@ -218,7 +361,7 @@ var lakeC = {
|
|
var lakeVideoHtml = `<div class="video-wrapper pub-modal-mask" id="lake-video-suggest">
|
|
var lakeVideoHtml = `<div class="video-wrapper pub-modal-mask" id="lake-video-suggest">
|
|
<div class="part-screen">
|
|
<div class="part-screen">
|
|
<video controls autoplay id="lake-video">
|
|
<video controls autoplay id="lake-video">
|
|
- <source src="${lakeVideo}">
|
|
|
|
|
|
+ <source src="${mp4UrlMap['lake']}">
|
|
</video>
|
|
</video>
|
|
<div class="close-icon close-mask-icon"></div>
|
|
<div class="close-icon close-mask-icon"></div>
|
|
</div>
|
|
</div>
|
|
@@ -234,22 +377,26 @@ var lakeC = {
|
|
lookoutClick() {
|
|
lookoutClick() {
|
|
var videoHtml = `<div class="fullscreen-video fullscreen-video-lookout">
|
|
var videoHtml = `<div class="fullscreen-video fullscreen-video-lookout">
|
|
<video id="lookout-video" autoplay width="100%">
|
|
<video id="lookout-video" autoplay width="100%">
|
|
- <source src="${lookout}">
|
|
|
|
|
|
+ <source src="${mp4UrlMap['lookup']}">
|
|
</video>
|
|
</video>
|
|
<div class="close-icon close-full-video"></div>
|
|
<div class="close-icon close-full-video"></div>
|
|
</div>`
|
|
</div>`
|
|
$(document).on('click', '#psv-marker-glass', function() {
|
|
$(document).on('click', '#psv-marker-glass', function() {
|
|
if(!$('#lookout-pic')[0]){
|
|
if(!$('#lookout-pic')[0]){
|
|
- var lookOutHtml = ` <div id="lookout-pic" style="display:none">
|
|
|
|
|
|
+ var lookOutHtml = ` <div class="mod-full-picture" id="lookout-pic" style="display:none">
|
|
<div class="pub-btn go-back">返回</div>
|
|
<div class="pub-btn go-back">返回</div>
|
|
<img class="e-tips" src="${eUrl}" alt="">
|
|
<img class="e-tips" src="${eUrl}" alt="">
|
|
</div>`
|
|
</div>`
|
|
$('body').append(lookOutHtml)
|
|
$('body').append(lookOutHtml)
|
|
}
|
|
}
|
|
$('#lookout-pic').fadeIn()
|
|
$('#lookout-pic').fadeIn()
|
|
- })
|
|
|
|
- $(document).on('click', '.go-back', function() {
|
|
|
|
- $('#lookout-pic').fadeOut()
|
|
|
|
|
|
+
|
|
|
|
+ if(!progressFlag['lookout']){
|
|
|
|
+ progressFlag['lookout'] = true
|
|
|
|
+ $('#cur-progress').html(++progressNum)
|
|
|
|
+ progressNum == 5 ? $('#scene-nav2').removeClass('disable') : ''
|
|
|
|
+ progressNum == 5 ? localStorage.setItem('hunter_permision', '2') : ''
|
|
|
|
+ }
|
|
})
|
|
})
|
|
// 监听E键
|
|
// 监听E键
|
|
$(document).on('keyup', function(e) {
|
|
$(document).on('keyup', function(e) {
|
|
@@ -269,6 +416,7 @@ var lakeC = {
|
|
}
|
|
}
|
|
lookVideo.addEventListener("ended",function(){
|
|
lookVideo.addEventListener("ended",function(){
|
|
lookVideo.load()
|
|
lookVideo.load()
|
|
|
|
+ lookVideo.pause()
|
|
$('.fullscreen-video-lookout').hide()
|
|
$('.fullscreen-video-lookout').hide()
|
|
$('#lookout-pic').hide()
|
|
$('#lookout-pic').hide()
|
|
})
|
|
})
|
|
@@ -277,78 +425,14 @@ var lakeC = {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- //确认装备
|
|
|
|
- shooting() {
|
|
|
|
- $('.start-equit-btn').click(function() {
|
|
|
|
- $('#equit-video-wrap').fadeIn()
|
|
|
|
- })
|
|
|
|
- var step = 1 //步骤
|
|
|
|
- var openVideo = document.getElementById('open-video')
|
|
|
|
- var aimVideo = document.getElementById('aim-video')
|
|
|
|
- var shootVideo = document.getElementById('shoot-video')
|
|
|
|
-
|
|
|
|
- $('.close-equit-btn').click(function() {
|
|
|
|
- $('#equit-video-wrap').hide()
|
|
|
|
- $('.equit-success').hide()
|
|
|
|
- $('.open-jin-tips').show()
|
|
|
|
- $(openVideo).show()
|
|
|
|
- $(shootVideo).hide()
|
|
|
|
- openVideo.currentTime = 0
|
|
|
|
- aimVideo.currentTime = 0
|
|
|
|
- shootVideo.currentTime = 0
|
|
|
|
- step = 1
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
- openVideo.addEventListener("ended",function(){
|
|
|
|
- if(step == 1) {
|
|
|
|
- $(openVideo).hide();
|
|
|
|
- $(aimVideo).show();
|
|
|
|
- $('.space-tips').show()
|
|
|
|
- }
|
|
|
|
- step ++
|
|
|
|
- })
|
|
|
|
- aimVideo.addEventListener("ended",function(){
|
|
|
|
- if(step == 2) {
|
|
|
|
- $(aimVideo).hide();
|
|
|
|
- $(shootVideo).show();
|
|
|
|
- $('.space-tips').hide();
|
|
|
|
- $('.open-qiang-tips').show()
|
|
|
|
- }
|
|
|
|
- step ++
|
|
|
|
- })
|
|
|
|
- shootVideo.addEventListener("ended",function(){
|
|
|
|
- $('.equit-success').fadeIn()
|
|
|
|
- document.getElementById('hunter-audio').play()
|
|
|
|
- })
|
|
|
|
- $(document).on('keyup', function(e) {
|
|
|
|
- var isShow = $('#equit-video-wrap').css('display') == 'none' ? false : true
|
|
|
|
- console.log(e.keyCode)
|
|
|
|
- if(isShow) {
|
|
|
|
- if(e.keyCode == 70 && step == 1){
|
|
|
|
- $('.open-jin-tips').hide()
|
|
|
|
- openVideo.play()
|
|
|
|
- }
|
|
|
|
- if(e.keyCode == 32 && step == 2){
|
|
|
|
- $('.space-tips').show()
|
|
|
|
- aimVideo.pause()
|
|
|
|
- }
|
|
|
|
- if(e.keyCode == 70 && step == 3){
|
|
|
|
- $('.open-qiang-tips').hide()
|
|
|
|
- shootVideo.play()
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
- $(document).on('keydown', function(e) {
|
|
|
|
- if(e.keyCode == 32 && step == 2){
|
|
|
|
- $('.space-tips').hide()
|
|
|
|
- aimVideo.play()
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
-until.animateModal()
|
|
|
|
-until.handleModel()
|
|
|
|
-lakeV.init()
|
|
|
|
-lakeC.init()
|
|
|
|
|
|
+let entry = localStorage.getItem('entry')
|
|
|
|
+if(entry == 'index') {
|
|
|
|
+ util.animateModal()
|
|
|
|
+ util.handleModel()
|
|
|
|
+ lakeV.init()
|
|
|
|
+ lakeC.init()
|
|
|
|
+} else {
|
|
|
|
+ window.location.href = indexPath
|
|
|
|
+}
|