sunlupeng 1 anno fa
parent
commit
1e71b44652
3 ha cambiato i file con 233 aggiunte e 1 eliminazioni
  1. 4 0
      src/router/index.js
  2. 7 1
      src/views/HomeView/FestiveEvents.vue
  3. 222 0
      src/views/HomeView/Game.vue

+ 4 - 0
src/router/index.js

@@ -62,6 +62,10 @@ const routes = [
       {
         path: '/home/festiveEvents',
         component: () => import('@/views/HomeView/FestiveEvents.vue')
+      },
+      {
+        path: '/home/festiveEvents/game',
+        component: () => import('@/views/HomeView/Game.vue')
       }
     ]
   },

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

@@ -72,7 +72,13 @@ export default {
             })
         },
         handleClickReceive(val){
-            window.location.href = val;
+            // window.location.href = val;
+            this.$router.push({
+                path: '/home/festiveEvents/game',
+                // query: {
+                //     id: val,
+                // }
+            });
         }
     }
 };

+ 222 - 0
src/views/HomeView/Game.vue

@@ -0,0 +1,222 @@
+<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>
+</template>
+<script>
+import { getToken } from '@/utils/auth'
+export default {
+    data() {
+        return {
+            src: 'http://47.103.79.143:9084/game/', //需要加载的子页面url
+        };
+    },
+    created() {
+       
+    },
+    async mounted(){
+	    var that = this
+	    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() {
+        	//将token传递给子页面
+            let token = getToken();
+            let param = {
+                token
+            }
+          	this.iframe.contentWindow.postMessage(param,'*')
+        },
+    }
+};
+</script>
+<style scoped>
+.right-wrap {
+    background-color: #fff;
+}
+
+.tab-header {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    padding: 20px 20px 16px;
+    border-bottom: 1px solid #e5e6eb;
+    overflow: hidden;
+}
+
+.tab-header .tab-title {
+    white-space: nowrap;
+    font-size: 18px;
+    font-weight: 500;
+    color: #1d2129;
+}
+.list-content{
+    padding: 0px 20px 40px;
+}
+.list-container .prize-item:nth-child(4n) {
+    margin-right: 0;
+}
+
+.list-container {
+    border-radius: 2px;
+    background-color: transparent;
+}
+
+.list-container .prize-list {
+    padding: 20px 0;
+    background: #fff;
+    display: flex;
+    flex-flow: row wrap;
+    box-sizing: border-box;
+}
+
+.list-container .prize-item {
+    width: calc(25% - 15px);
+    margin-right: 20px;
+    margin-bottom: 20px;
+    border-radius: 2px;
+}
+
+.prize-card {
+    background: #fff;
+    border: 1px solid #e4e6eb;
+    box-sizing: border-box;
+    border-radius: 2px;
+}
+
+.prize-card .img-container {
+    height: 159px;
+    background: #f7f8fa;
+    border-radius: 2px 2px 0 0;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+}
+
+.prize-card .img-container .prize-img {
+    max-height: 120px;
+    max-width: 120px;
+}
+
+.prize-card .content {
+    padding: 0 16px;
+}
+
+.prize-card .content .desc,
+.prize-card .content .title {
+    white-space: nowrap;
+    overflow: hidden;
+    text-overflow: ellipsis;
+}
+
+.prize-card .content .title {
+    font-weight: 400;
+    font-size: 16px;
+    line-height: 24px;
+    margin-top: 12px;
+    color: #1d2129;
+    margin-bottom: 0;
+}
+
+.prize-card .content .desc {
+    margin: 10px 0;
+    display: inline-block;
+    font-size: 12px;
+    line-height: 18px;
+    height: 18px;
+    width: 100%;
+}
+
+.prize-card .content .desc span {
+    color: #ff7d00;
+    background: #fff7e8;
+    padding: 2px 4px;
+}
+
+.prize-card .content .redeem-info {
+    margin-top: 0;
+    margin-bottom: 0;
+    display: flex;
+    justify-content: space-between;
+    white-space: nowrap;
+    align-items: center;
+}
+
+.prize-card .content .price {
+    font-weight: 500;
+    font-size: 14px;
+    line-height: 24px;
+    color: #1e80ff;
+    flex: auto;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    justify-content: flex-start;
+}
+
+.prize-card .content .price .icon {
+    height: 16px;
+    width: 16px;
+    position: relative;
+    margin-right: 4px;
+}
+
+.prize-card .content .count {
+    font-size: 12px;
+    line-height: 20px;
+    margin-left: 12px;
+    color: #8a919f;
+}
+
+.prize-card .btn {
+    border-radius: 16px;
+}
+
+.ui-btn.medium {
+    padding: 5px 16px;
+}
+
+.ui-btn.primary {
+    background-color: #1d7dfa;
+}
+.ui-btn.default {
+    color:#8a919f;
+    /* background-color: #1d7dfa; */
+}
+
+.ui-btn {
+    box-sizing: border-box;
+    font-size: 14px;
+    line-height: 22px;
+    padding: 5px 16px;
+    color: #fff;
+    border: none;
+    white-space: nowrap;
+    cursor: pointer;
+}
+
+.prize-card .btn-container {
+    border-top: 1px solid #e4e6eb;
+    padding: 12px 16px;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+}
+</style>
+<style></style>
+