فهرست منبع

[edit][数据错误]

zhangwei 2 سال پیش
والد
کامیت
622d4bd82c
2فایلهای تغییر یافته به همراه11 افزوده شده و 1 حذف شده
  1. 2 1
      src/logic/content/twitter.js
  2. 9 0
      src/view/iframe/buy-nft/group/tip.vue

+ 2 - 1
src/logic/content/twitter.js

@@ -1197,6 +1197,7 @@ export function doTaskTwitterAPI({ task_data, task_type }) {
 export function showJoinDialog(data) {
     let iframe = document.querySelector('#nftProjectId')
     iframe.style.display = 'block'
+    iframe.contentWindow.postMessage({ actionType: 'SHOW_JOIN_DATA', data }, '*');
     iframe.src = chrome.runtime.getURL(`/iframe/buy-nft.html#/group?params=${JSON.stringify(data)}&time=${new Date().getTime()}`)
 }
 
@@ -1455,7 +1456,7 @@ export const showGroupTip = () => {
 export const hideBuyNFT = () => {
     let iframe = document.querySelector('#nftProjectId')
     iframe.style.display = 'none'
-    iframe.src = ''
+    iframe.src =''
 }
 
 export const showBuyNFT = ({ nft_project_Id }) => {

+ 9 - 0
src/view/iframe/buy-nft/group/tip.vue

@@ -102,6 +102,15 @@ const clickClose = () => {
     })
 }
 
+window.addEventListener("message", function (event) {
+    if (event.data) {
+        switch (event.data.actionType) {
+            case 'SHOW_JOIN_DATA':
+                state.params = event.data.data
+        }
+    }
+});
+
 const clickFinish = () => {
     clickClose()
 }