var userDown = false //用户鼠标判断 var bgMove = false var indexPath = $('body').attr('data-path') var until = { // 浮层动画 animateModal() { var w = document.body.offsetWidth/2; var h = document.body.offsetHeight/2; var modal = document.getElementsByClassName('animate-wrap'); var $moveBg = $('.comment-page').find('.move-bg') //评论背景移动 var $fullBg = $('.mod-full-picture') document.body.onmousedown = function (event) { userDown = true } document.body.onmouseup = function (event) { userDown = false } document.body.onmousemove = function (event) { var mx = event.clientX, my = event.clientY; if(userDown) { for (var i=0; i

预约成功!

` $('.book-btn-bottom').click(function() { $('.comment-page').append(successModal) }) $('.comment-page').on('click', '.book-success-btn', function() { $('.book-success-modal').remove() }) // 视频播放 $('.poster-lake').click(function() { $('.book-video').hide() $('#book-video-wrapper').show() $('#book-lake-video').show() document.getElementById('book-lake-video').play() }) $('.poster-taiga').click(function() { $('.book-video').hide() $('#book-video-wrapper').show() $('#book-taiga-video').show() document.getElementById('book-taiga-video').play() }) $('.poster-elden').click(function() { $('.book-video').hide() $('#book-video-wrapper').show() $('#book-elden-video').show() document.getElementById('book-elden-video').play() }) }, // 右上角工具栏 toolbarClick() { // 暂停 $('.toolbar-box').find('.bgm-icon').click(function() { var $this = $(this) var audio = document.getElementById('bgm-audio') if($this.hasClass('pause')) { audio.play() $this.removeClass('pause') } else { audio.pause() $this.addClass('pause') } }) // 评论 $('.toolbar-box').find('.comment-icon').click(function() { $('.comment-btn').trigger('click') $('.comment-page').fadeIn() bgMove = true }) // 重置进度 $('.toolbar-box').find('.reset-icon').click(function() { $('.reset-modal').fadeIn() }) $('.yes-btn').click(function() { localStorage.removeItem('hunter_permision') localStorage.removeItem('entry') window.location.href = indexPath }) $('.no-btn').click(function() { $('.reset-modal').fadeOut() }) }, //确认装备 shooting() { var step = 1 //步骤 var openVideo = document.getElementById('open-video') var aimVideo = document.getElementById('aim-video') var shootVideo = document.getElementById('shoot-video') $('.start-equit-btn').click(function() { $('#equit-video-wrap').fadeIn() if(step == 3) { shootVideo.play() } }) $('.close-equit-btn').click(function() { $('#equit-video-wrap').hide() $('.equit-success').hide() $('.open-jin-tips').show() $('#equit-modal').hide() $(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() } }) }, } export default until