sunlupeng 1 rok temu
rodzic
commit
1b6692fcdb

+ 5 - 4
src/views/HomeView/FestiveEvents.vue

@@ -18,7 +18,7 @@
                         <div class="btn-container">
                             <button v-if="item.status==1" class="ui-btn default medium btn">活动未开始</button>
                             <button v-else-if="item.status==3" class="ui-btn default medium btn">活动已结束</button>
-                            <button v-else @click="handleClickReceive(item.activityUrl)"
+                            <button v-else @click="handleClickReceive(item)"
                                 class="ui-btn primary medium btn">
                                 立即参与
                             </button>
@@ -75,9 +75,10 @@ export default {
             // window.location.href = val;
             this.$router.push({
                 path: '/home/festiveEvents/game',
-                // query: {
-                //     id: val,
-                // }
+                query: {
+                    activityUrl: val.activityUrl,
+                    actId:val.actId
+                }
             });
         }
     }

+ 5 - 2
src/views/HomeView/Game.vue

@@ -8,7 +8,8 @@ import { getToken } from '@/utils/auth'
 export default {
     data() {
         return {
-            src: 'http://47.103.79.143:9084/game/', //需要加载的子页面url
+            src: this.$route.query.activityUrl, //需要加载的子页面url
+            actId:this.$route.query.actId
         };
     },
     created() {
@@ -37,8 +38,10 @@ export default {
         async postMsg() {
         	//将token传递给子页面
             let token = getToken();
+            let actId = this.actId;
             let param = {
-                token
+                token,
+                actId
             }
           	this.iframe.contentWindow.postMessage(param,'*')
         },