tremble hace 4 años
padre
commit
f1ba85b5d2

+ 1 - 1
web/public/static/js/manage.js

@@ -118,7 +118,7 @@ Manage.prototype.loadAudio = function() { //相关:g_tourAudio \  g_playAudio
          
          
         this.switchBgmState(true)
         this.switchBgmState(true)
 
 
-        window.player.emit('autoplay')
+        window.player.emit&&window.player.emit('autoplay')
         
         
         document.removeEventListener("touchstart",play);
         document.removeEventListener("touchstart",play);
         document.removeEventListener("click",play);
         document.removeEventListener("click",play);

BIN
web/src/assets/videos/chen.mp4


BIN
web/src/assets/videos/li.mp4


BIN
web/src/assets/videos/mao.mp4


+ 39 - 0
web/src/components/hotspot/iframe.vue

@@ -0,0 +1,39 @@
+<template>
+  <div class="images" :style="{backgroundImage:`url(${require('@/assets/images/project/hotspot_bg.jpg')})`}">
+    <iframe :src="hotspot.iframe[active]" frameborder="0"></iframe>
+  </div>
+</template>
+
+<script>
+export default {
+  props:['hotspot'],
+  data(){
+    return {
+      active:0
+    }
+  },
+  mounted(){
+    console.log(this.hotspot);
+  },
+  methods:{
+  }
+}
+</script>
+
+<style lang="less" scoped>
+.noshow{
+  opacity: 0!important;;
+  pointer-events: none!important;;
+}
+
+.images{
+  width: 100%;
+  height: 100%;
+  background-repeat: no-repeat;
+  text-align: center;
+  >iframe{
+    width: 100%;
+    height: 100%;
+  }
+}
+</style>

+ 2 - 1
web/src/components/hotspot/image.vue

@@ -156,7 +156,7 @@ export default {
   text-align: center;
   text-align: center;
   .title{
   .title{
     width: 90%;
     width: 90%;
-    padding: 10px;
+    padding: 10px 20px;
     display: inline-block;
     display: inline-block;
     color: #DBA761;
     color: #DBA761;
     font-weight: bold;
     font-weight: bold;
@@ -174,6 +174,7 @@ export default {
       position: relative;
       position: relative;
       height: 100%;
       height: 100%;
       margin: 0 10px;
       margin: 0 10px;
+      transform:translate3d(0,0,0);
       .sl-item{
       .sl-item{
         position: absolute;
         position: absolute;
         top: 0;
         top: 0;

+ 10 - 1
web/src/components/hotspot/index.vue

@@ -1,6 +1,6 @@
 <template>
 <template>
   <div class="hotspotcon">
   <div class="hotspotcon">
-    <img @click="close" class="close" :src="require('@/assets/images/project/close.png')" alt="">
+    <img @click="close" class="close" :class="{ifrclose:active=='vIframe'}" :src="require('@/assets/images/project/close.png')" alt="">
     <component :is="active" :hotspot="hotspot"></component>
     <component :is="active" :hotspot="hotspot"></component>
   </div>
   </div>
 </template>
 </template>
@@ -10,6 +10,8 @@ import audio from './audio.vue';
 import image from './image.vue';
 import image from './image.vue';
 import video from './video.vue';
 import video from './video.vue';
 import title from './title.vue';
 import title from './title.vue';
+import iframe from './iframe.vue';
+
 
 
 
 
 let iconArr = [
 let iconArr = [
@@ -24,20 +26,24 @@ export default {
   components:{
   components:{
     vAudio:audio,
     vAudio:audio,
     vImage:image,
     vImage:image,
+    vIframe:iframe,
     vTitle:title,
     vTitle:title,
     vVideo:video
     vVideo:video
   },
   },
   methods:{
   methods:{
     close(){
     close(){
       this.$hideHotspot()
       this.$hideHotspot()
+      window.manage.switchBgmState(true);
     }
     }
   },
   },
   mounted(){
   mounted(){
+    console.log(this.hotspot);
     iconArr.forEach(item => {
     iconArr.forEach(item => {
       if (this.hotspot[item.key]) {
       if (this.hotspot[item.key]) {
         this.active = !this.active ? item.id : this.active;
         this.active = !this.active ? item.id : this.active;
       }
       }
     });
     });
+    console.log(this.active)
     !this.active && (this.active = 'vTitle')
     !this.active && (this.active = 'vTitle')
   },
   },
   data(){
   data(){
@@ -65,6 +71,9 @@ export default {
     height: 70px;
     height: 70px;
     cursor: pointer;
     cursor: pointer;
   }
   }
+  .ifrclose{
+    top: 100px;
+  }
 }
 }
 
 
 @media only screen and (max-width: 487px) {
 @media only screen and (max-width: 487px) {

+ 88 - 60
web/src/components/kangri/index.vue

@@ -1,11 +1,31 @@
 <template>
 <template>
   <div id="kangri" class="kangri">
   <div id="kangri" class="kangri">
     <div class="kangricon">
     <div class="kangricon">
-      <span @click="active-=1,autoplay()" :class="{noshow:active<=0}">上一张</span>
-      <video ref="video" autoplay loop :key="active">
-        <source :src="require(`@/assets/videos/kangri/${videocon[active].video}`)" type="video/mp4">
-      </video> 
-      <span @click="active+=1,autoplay()" :class="{noshow:active>=videocon.length-1}">下一张</span>
+      <span @click="(active -= 1), autoplay()" :class="{ noshow: active <= 0 }"
+        >上一张</span
+      >
+      <video
+        ref="video"
+        autoplay
+        loop
+        x5-video-player-type="h5"
+        x5-video-player-fullscreen="true"
+        webkit-playsinline=""
+        playsinline=""
+        x5-playsinline=""
+        crossorigin="anonymous"
+        :key="active"
+      >
+        <source
+          :src="require(`@/assets/videos/kangri/${videocon[active].video}`)"
+          type="video/mp4"
+        />
+      </video>
+      <span
+        @click="(active += 1), autoplay()"
+        :class="{ noshow: active >= videocon.length - 1 }"
+        >下一张</span
+      >
     </div>
     </div>
   </div>
   </div>
 </template>
 </template>
@@ -13,80 +33,87 @@
 <script>
 <script>
 let videocon = [
 let videocon = [
   {
   {
-    id:'1',
-    video:'1.mp4'
+    id: "1",
+    video: "1.mp4",
   },
   },
   {
   {
-    id:'2',
-    video:'2.mp4'
+    id: "2",
+    video: "2.mp4",
   },
   },
   {
   {
-    id:'3',
-    video:'3.mp4'
+    id: "3",
+    video: "3.mp4",
   },
   },
   {
   {
-    id:'4',
-    video:'4.mp4'
+    id: "4",
+    video: "4.mp4",
   },
   },
   {
   {
-    id:'5',
-    video:'5.mp4'
-  }
-]
+    id: "5",
+    video: "5.mp4",
+  },
+];
 export default {
 export default {
-  data(){
+  data() {
     return {
     return {
       videocon,
       videocon,
-      active:0
-    }
+      active: 0,
+    };
   },
   },
-  methods:{
-    changeVideo(item){
-      this.active = item.id
+  methods: {
+    changeVideo(item) {
+      this.active = item.id;
+    },
+    autoplay() {
+      this.$nextTick(() => {
+        this.$refs.video.play();
+      });
     },
     },
-    autoplay(){
-      this.$nextTick(()=>{
-        this.$refs.video.play()
-      })
-    }
   },
   },
-  mounted(){
-    window.player.on("autoplay", ()=> {
-        this.autoplay()
-    })
-  }
-}
+  mounted() {
+    document.addEventListener(
+      "WeixinJSBridgeReady",
+      () => {
+        this.autoplay();
+      },
+      false
+    );
+    window.player.on("autoplay", () => {
+      this.autoplay();
+    });
+  },
+};
 </script>
 </script>
 
 
 <style lang="less" scoped>
 <style lang="less" scoped>
-.noshow{
-  opacity: 0!important;;
-  pointer-events: none!important;;
+.noshow {
+  opacity: 0 !important;
+  pointer-events: none !important;
 }
 }
 
 
-.kangri{
+.kangri {
   width: 100%;
   width: 100%;
   height: 100%;
   height: 100%;
   text-align: center;
   text-align: center;
   position: relative;
   position: relative;
-   pointer-events: none!important;
+  pointer-events: none !important;
 
 
- .kangricon{
-  height: 100%;
-  width: 100%;
-   color: #fff;
-   display: flex;
-   justify-content: center;
-   pointer-events: none!important;
-   align-items: center;
-   >video{
-     width: 50%;
-     background-color: #000;
-     height: 100%;
-     pointer-events: auto;
-     object-fit: fill;
-   }
-   >span{
+  .kangricon {
+    height: 100%;
+    width: 100%;
+    color: #fff;
+    display: flex;
+    justify-content: center;
+    pointer-events: none !important;
+    align-items: center;
+    > video {
+      width: 50%;
+      background-color: #000;
+      height: 100%;
+      pointer-events: auto;
+      object-fit: fill;
+    }
+    > span {
       pointer-events: auto;
       pointer-events: auto;
       display: inline-block;
       display: inline-block;
       padding: 20px 60px;
       padding: 20px 60px;
@@ -95,14 +122,15 @@ export default {
       height: 50px;
       height: 50px;
       line-height: 50px;
       line-height: 50px;
       background: rgba(188, 21, 21, 0.9);
       background: rgba(188, 21, 21, 0.9);
-      border: 2px solid #DBA761;
+      border: 2px solid #dba761;
       border-radius: 77px;
       border-radius: 77px;
       cursor: pointer;
       cursor: pointer;
       margin: 0 100px;
       margin: 0 100px;
-      &:hover,&.active{
-        color: #DBA761;
+      &:hover,
+      &.active {
+        color: #dba761;
       }
       }
     }
     }
- }
+  }
 }
 }
-</style>
+</style>