sunlupeng 1 年間 前
コミット
a2f5ef4c31
2 ファイル変更49 行追加29 行削除
  1. 10 1
      src/views/HomeView/FestiveEvents.vue
  2. 39 28
      src/views/HomeView/Game.vue

+ 10 - 1
src/views/HomeView/FestiveEvents.vue

@@ -76,6 +76,16 @@ export default {
         },
         handleClickReceive(val){
             console.log(val);
+            //节日游戏
+            if(val.type=='1'){
+                this.$router.push({
+                    path: '/home/festiveEvents/game',
+                    query: {
+                        url: val.activityUrl,
+                        actId:val.actId
+                    }
+                });
+            }
             //答题
             if(val.type=='2'){
                 this.$router.push({
@@ -90,7 +100,6 @@ export default {
                 this.$router.push({
                     path: '/home/festiveEvents/drawCarouselGame',
                     query: {
-                        url: val.activityUrl,
                         actId:val.actId
                     }
                 });

+ 39 - 28
src/views/HomeView/Game.vue

@@ -1,38 +1,36 @@
 <template>
-    <div class="right-wrap" style="display: flex;justify-content: center;align-items: center;">
-        <iframe id="iframe"  frameborder="0" style="width:900px;height:500px;margin-top: 20px;margin-bottom: 20px;" :src="src"></iframe>
+    <div class="timeline-container">
+        <div class="timeline-content">
+            <div class="timeline-entry-list">
+                <div class="gameBox">
+                    <iframe id="iframe"  frameborder="0" :src="src" style="width: 100%;height: 100%;"></iframe>
+                </div>
+            </div>
+            <SiderInfo></SiderInfo>
+        </div>
     </div>
 </template>
 <script>
+import SiderInfo from '@/components/SiderInfo.vue'
 import { getToken } from '@/utils/auth'
-export default {
-    data() {
-        return {
-            src: this.$route.query.activityUrl, //需要加载的子页面url
+export default{
+  components: {
+    SiderInfo
+  },
+  data() {
+    return {
+            src: this.$route.query.url ? this.$route.query.url : '', //需要加载的子页面url
             actId:this.$route.query.actId
         };
-    },
-    created() {
-       
-    },
-    async mounted(){
+  },
+  created(){},
+  async mounted(){
 	    var that = this
-	    this.iframe = document.getElementById('iframe')
+	    this.iframe = document.getElementById('iframe');
 	    this.iframe.onload = function(){
 	        // iframe加载完成后要进行的操作
 	        that.postMsg()
-	    }  
-		// if (iframe.attachEvent){ // 兼容IE写法
-        //     iframe.attachEvent("onload", function(){
-        //         // iframe加载完成后要进行的操作
-        //         that.postMsg()
-        //     })
-        // } else {
-        //     iframe.onload = function(){
-        //         // iframe加载完成后要进行的操作
-        //         that.postMsg()
-        //     }
-        // }
+	    };
 	},
 	methods: {
         async postMsg() {
@@ -46,11 +44,24 @@ export default {
           	this.iframe.contentWindow.postMessage(param,'*')
         },
     }
-};
+}
 </script>
 <style scoped>
-.right-wrap {
+.timeline-container{
+    margin: 0 auto;
+}
+.timeline-entry-list{
+    margin-right: 17.5rem;
+    border-radius: 2px;
+    
+    position: relative;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+}
+.timeline-entry-list .gameBox{
+    width: 720px;
+    height: 720px;
     background-color: #fff;
 }
-</style>
-
+</style>