tremble 3 سال پیش
والد
کامیت
d474b02f37

+ 2 - 2
scene/src/components/exhibition/index.vue

@@ -126,8 +126,8 @@ export default {
     border-top: 2px solid #FFB521;
     width: 100%;
     >li{
-      height: 40px;
-      line-height: 40px;
+      height: 36px;
+      line-height: 36px;
       padding: 0 30px;
       cursor: pointer;
       &:hover{

+ 2 - 2
scene/src/components/mb_exhibition/index.vue

@@ -130,8 +130,8 @@ export default {
     border-top: 2px solid #FFB521;
     width: 100%;
     >li{
-      height: 40px;
-      line-height: 40px;
+      height: 36px;
+      line-height: 36px;
       padding: 0 30px;
       cursor: pointer;
       &:hover{

+ 2 - 4
web/public/static/js/manage.js

@@ -1035,8 +1035,8 @@ Manage.prototype.loadAudio = function() { //相关:g_tourAudio \  g_playAudio
         }
     })  
     
-    this.switchBgmState(true);//初始设置允许播放bgm 
-    SoundManager.initAutoPlay()
+    // this.switchBgmState(true);//初始设置允许播放bgm 
+    // SoundManager.initAutoPlay()
     
     
 }  
@@ -1048,10 +1048,8 @@ Manage.prototype.switchBgmState = function(state){//按钮的状态完全代表
     
     
     if(state){
-        
         SoundManager.play('bgm')
     }else{
-        
         SoundManager.pause('bgm')
     }
     

BIN
web/src/assets/images/bofang.png


BIN
web/src/assets/images/poster.jpg


+ 2 - 2
web/src/assets/theme/theme.less

@@ -695,8 +695,8 @@
       border-top: 2px solid @color;
       width: 100%;
       > li {
-        height: 40px;
-        line-height: 40px;
+        height: 36px;
+        line-height: 36px;
         padding: 0 30px;
         cursor: pointer;
         &:hover,&.active {

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

@@ -191,7 +191,7 @@
           <li @click="openGameurl">
             <img title="游戏" :src="require(`@/assets/images/btnlist/game.png`)"/>
           </li>
-          <li @click="isBgm=!isBgm" v-if="BgmUrl">
+          <li @click="toggleBGM" v-if="BgmUrl">
             <img
               title="音乐"
               :src="require(`@/assets/images/btnlist/bgm${isBgm?`_${theme}`:''}.png`)"
@@ -386,6 +386,7 @@ export default {
       },
     ];
 
+
     return {
       isShow: true,
       isGuide: true,
@@ -393,7 +394,7 @@ export default {
       conLi,
       showAutoList: false,
       btnlistActive:this.itemctive,
-      isBgm:false,
+      isBgm: false,
       isShowGood:false,
       likeNum:0
     };
@@ -405,7 +406,7 @@ export default {
   },
   watch:{
     isBgm(newVal){
-      window.manage.switchBgmState(!newVal)
+      window.manage.switchBgmState(newVal)
     },
     isJieShuo(newVal){
       this.$emit('isJieShou',newVal)
@@ -413,6 +414,10 @@ export default {
     
   },
   methods: {
+    toggleBGM(){
+      this.isBgm = !this.isBgm
+      window.player.director.stopTour()
+    },
     openGameurl(){
       window.open('/game/index.html','_blank')
     },
@@ -440,6 +445,10 @@ export default {
     this.$bus.$on('resetbtnactive',()=>{
       this.btnlistActive = ''
     })
+
+    this.$bus.$on('changeBGM',(data)=>{
+      this.isBgm = data
+    })
     this.getStar()
   }
 };

+ 35 - 5
web/src/views/scene/index.vue

@@ -1,8 +1,9 @@
 <template>
   <div class="scene-body">
     <div class="welcomeVideo" v-if="showWelcome">
-      <video autoplay ref="wevideo" controls :src="require('@/assets/video/welcone.mp4')"></video>
-      <span class="jump primary" @click="jump">跳过</span>
+      <img v-if="!bfing" class="poster" :src="require('@/assets/images/bofang.png')" />
+      <video :poster="require('@/assets/images/poster.jpg')" autoplay ref="wevideo" controls :src="require('@/assets/video/welcone.mp4')"></video>
+      <span v-if="canjump" class="jump primary primaryTxt" @click="jump">跳过</span>
     </div>
     <iframe ref="ifr" :key="scene" :src="`scene.html?m=${scene}`" allowfullscreen="true" frameborder="0"></iframe>
   </div>
@@ -17,14 +18,25 @@ export default {
           data:newVal,
       },'*');
       this.$bus.$emit('changeTheme',newVal)
+    },
+    showWelcome(newVal){
+      if(!newVal){
+          this.$refs.ifr.contentWindow.postMessage({
+              source: "bofangbgm",
+              data:newVal,
+          },'*');
+      }
     }
   },
   data(){
     return {
       showWelcome:true,
-      scene:'xinjiangout'
+      bfing: false,
+      scene:'xinjiangout',
+      canjump:false
     }
   },
+
   methods: {
     jump(){
       this.showWelcome = false
@@ -36,6 +48,10 @@ export default {
        this.$refs.wevideo.addEventListener("ended", () => {
           this.showWelcome = false
         });
+
+        this.$refs.wevideo.addEventListener("playing", () => {
+          this.bfing = true
+        });
         // this.$refs.wevideo.addEventListener("canplaythrough", () => {
         //   setTimeout(() => {
         //     this.isshowall = true
@@ -49,6 +65,10 @@ export default {
            this.scene = data
            this.$bus.$emit('activeScene',data)
           }
+
+          if (res.data.source === "canJump") {
+           this.canjump = true
+          }
         }
       });
   },
@@ -74,6 +94,15 @@ export default {
       top: 0;
       width: 100%;
       height: 100%;
+      .poster{
+        pointer-events: none;
+        position: absolute;
+        top: 50%;
+        left: 50%;
+        width: 60px;
+        z-index: 999;
+        transform: translate(-50%,-50%);
+      }
       >video{
         width: 100%;
         position: absolute;
@@ -84,9 +113,10 @@ export default {
       .jump{
         position: absolute;
         right: 20px;
-        top: 20px;
-        color: #fff;
+        bottom: 20px;
+        width: 100px;
         padding: 10px 10px;
+        border-radius: 20px;
         cursor: pointer;
       }
     }

+ 13 - 0
web/src/views/scene/scene.vue

@@ -134,6 +134,10 @@ export default {
           this.$store.dispatch("changeTheme", res.data.data);
         }
 
+        if (res.data.source === "bofangbgm") {
+          this.$bus.$emit("changeBGM",true);
+        }
+
         if (res.data.source === "userInfo") {
           console.log(res.data.data);
           this.$store.dispatch("setUserInfo", res.data.data);
@@ -151,6 +155,14 @@ export default {
       window.addEventListener("loadfinish", () => {
         this.$hideLoading()
 
+        window.parent.postMessage(
+            {
+              source: "canJump",
+              data: true,
+            },
+            "*"
+          );
+        
         window.player.director.on("linkother", data => {
           window.parent.postMessage(
             {
@@ -162,6 +174,7 @@ export default {
         });
 
         window.player.director.on("tour.start", () => {
+          this.$bus.$emit("changeBGM",false);
           if(!window.ISMUTED){
            this.isSpeak = true
           }