|
@@ -40,6 +40,7 @@ var util = {
|
|
|
type: 'get',
|
|
|
success(data) {
|
|
|
var url = that.deCodeArg(data[vid].c).all.yuanhua.src
|
|
|
+ console.log(vid, that.deCodeArg(data[vid].c))
|
|
|
resolve(url)
|
|
|
}
|
|
|
})
|
|
@@ -53,7 +54,7 @@ var videoMap = {
|
|
|
'primary-bg': {vid: 8951723},
|
|
|
'evaluation-video': {vid: 8951715},
|
|
|
'subscribe-video': {vid: 8951909},
|
|
|
- 'evaluation-bg': {vid: 8951721}
|
|
|
+ 'evaluation-bg': {vid: 8952341}
|
|
|
}
|
|
|
// 获取视频地址 TODO:上线前删除下方函数
|
|
|
;!function () {
|
|
@@ -121,6 +122,7 @@ var app = new Vue({
|
|
|
mobileNavBarShow: false,
|
|
|
mobileVideoVisiable: false,
|
|
|
isMobileBGPlaying: true,
|
|
|
+ touchStartY: 0,
|
|
|
mode: window.innerWidth > window.innerHeight ? 'landscape' : 'portrait',
|
|
|
},
|
|
|
mounted: function () {
|
|
@@ -130,16 +132,7 @@ var app = new Vue({
|
|
|
$('.box-mouse').on('click',function(){
|
|
|
self.mainSwiper.mousewheel.enable();
|
|
|
})
|
|
|
- window.addEventListener('resize', function (event) {
|
|
|
- var orientation = (window.innerWidth > window.innerHeight) ? "landscape" : "portrait";
|
|
|
- if (orientation === 'portrait') {
|
|
|
- self.mode = 'portrait'
|
|
|
- } else {
|
|
|
- if (self.mode === 'portrait') {
|
|
|
- self.mode = 'landscape'
|
|
|
- }
|
|
|
- }
|
|
|
- }, false)
|
|
|
+ this.registerWindowEvent()
|
|
|
this.initScene()
|
|
|
this.initEvaluation()
|
|
|
},
|
|
@@ -157,8 +150,8 @@ var app = new Vue({
|
|
|
speed: 600,
|
|
|
mousewheel: true,
|
|
|
threshold: 50,
|
|
|
- width: self.isMobile ? window.innerHeight : undefined,
|
|
|
- height: self.isMobile ? window.innerWidth : undefined,
|
|
|
+ width: self.isMobile ? window.innerHeight :window.innerWidth,
|
|
|
+ height: self.isMobile ? window.innerWidth : window.innerHeight,
|
|
|
on: {
|
|
|
init: function () {
|
|
|
self.primaryVideo = self.$refs['primary-video']
|
|
@@ -173,6 +166,7 @@ var app = new Vue({
|
|
|
slideChangeTransitionStart: function () {
|
|
|
self.mainSwiperIndex = this.activeIndex
|
|
|
self.navbarVisible = self.isMobile || this.activeIndex >= 1;
|
|
|
+ this.activeIndex === 2 && self.isMobile ? self.isReading = true : self.isReading = false
|
|
|
if(!this.isMobile && this.activeIndex != 0){
|
|
|
$('.main-navbar').show();
|
|
|
self.isMobileBGPlaying = false
|
|
@@ -259,7 +253,7 @@ var app = new Vue({
|
|
|
oldIndex++;
|
|
|
if(oldIndex > 2){
|
|
|
oldIndex = 0;
|
|
|
- }
|
|
|
+ }x
|
|
|
$('.scene-role-bgm audio').get(oldIndex).play();
|
|
|
$('.scene-role-bgm audio').eq(oldIndex).addClass('actived').siblings().removeClass('actived');
|
|
|
})
|
|
@@ -286,6 +280,27 @@ var app = new Vue({
|
|
|
mainSwiperSlideTo: function (index, speed, runCallbacks) {
|
|
|
this.mainSwiper.slideTo(index, speed, runCallbacks)
|
|
|
},
|
|
|
+ registerWindowEvent(){
|
|
|
+ var self = this
|
|
|
+ var touchStartY
|
|
|
+ window.addEventListener('resize', function (event) {
|
|
|
+ var orientation = (window.innerWidth > window.innerHeight) ? "landscape" : "portrait";
|
|
|
+ if (orientation === 'portrait') {
|
|
|
+ self.mode = 'portrait'
|
|
|
+ } else {
|
|
|
+ if (self.mode === 'portrait') {
|
|
|
+ self.mode = 'landscape'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }, false)
|
|
|
+ window.addEventListener('touchstart', function (ev) {
|
|
|
+ touchStartY = ev.touches[0].screenY
|
|
|
+ })
|
|
|
+ window.addEventListener('touchend', function (ev) {
|
|
|
+ ev.changedTouches[0].screenY - touchStartY > 50 && self.mainSwiper.slidePrev()
|
|
|
+ touchStartY - ev.changedTouches[0].screenY > 50 && self.mainSwiper.slideNext()
|
|
|
+ })
|
|
|
+ },
|
|
|
// 首页灯塔点击事件处理函数
|
|
|
handleTowerClick() {
|
|
|
if (this.isPrimaryEnter) {
|
|
@@ -321,7 +336,7 @@ var app = new Vue({
|
|
|
} else {
|
|
|
this.$refs['mobile-bg'].src = '//pub.dwstatic.com/zt2018/qjjx05/img/primary-turn-compressed.gif'
|
|
|
setTimeout(function () {
|
|
|
- that.$refs['mobile-bg'].src = '//pub.dwstatic.com/zt2018/qjjx05/img/primary-bg-compressed.gif'
|
|
|
+ that.$refs['mobile-bg'].src = '//pub.dwstatic.com/zt2018/wxwy1809/img/primary-bg-static.jpg'
|
|
|
}, 800)
|
|
|
this.isPrimaryEnter = true
|
|
|
}
|
|
@@ -329,7 +344,7 @@ var app = new Vue({
|
|
|
},
|
|
|
// 场景页初始化
|
|
|
initScene() {
|
|
|
- new Parallax(this.$refs['scene-wrapper'])
|
|
|
+ !this.isMobile && new Parallax(this.$refs['scene-wrapper'])
|
|
|
},
|
|
|
// 加载场景页图片
|
|
|
loadSceneResources(){
|
|
@@ -342,7 +357,7 @@ var app = new Vue({
|
|
|
},
|
|
|
// 评测页初始化
|
|
|
initEvaluation() {
|
|
|
- new Parallax(this.$refs['charactor-wrapper'])
|
|
|
+ !this.isMobile && new Parallax(this.$refs['charactor-wrapper'])
|
|
|
},
|
|
|
getOrientationViewSize(flag){
|
|
|
var winWidth = window.innerWidth
|
|
@@ -390,11 +405,9 @@ var app = new Vue({
|
|
|
newVal ? this.$refs['scene-audio-player'].play() : this.$refs['scene-audio-player'].pause()
|
|
|
},
|
|
|
currentSceneIndex(newVal) {
|
|
|
- if(this.isMobile){
|
|
|
- return
|
|
|
- }
|
|
|
this.$refs['scene-audio-player'].src = 'http://pub.dwstatic.com/zt2018/wxwy1809/audio/scenes/scene' + (newVal + 1) + '.mp3'
|
|
|
this.isReading && this.$refs['scene-audio-player'].play()
|
|
|
+ console.log('播放了')
|
|
|
},
|
|
|
isEvaluationVideoPlaying(newVal) {
|
|
|
newVal ? this.$refs['evaluation-video'].play() : this.$refs['evaluation-video'].pause()
|