publish.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <!-- 发布弹窗 -->
  2. <template>
  3. <div class="main_app">
  4. <give-dialog
  5. :dialogVisible="dialogVisible"
  6. @close="close"
  7. @payPalFinsh="payPalFinsh"
  8. ></give-dialog>
  9. </div>
  10. </template>
  11. <script setup>
  12. import { ref } from "vue";
  13. import giveDialog from "@/view/iframe/publish/give-dialog.vue";
  14. let dialogVisible = ref(false);
  15. const close = () => {
  16. dialogVisible.value = false;
  17. hideIframe();
  18. };
  19. const payPalFinsh = (params) => {
  20. close();
  21. window.parent.postMessage({ actionType: "IFRAME_SHOW_TWITTER_PUBLISH_DIALOG", publishRes: params.publishRes }, "*");
  22. };
  23. const hideIframe = () => {
  24. window.parent.postMessage({ actionType: "IFRAME_HIDE_IFREME" }, "*");
  25. };
  26. window.addEventListener("message", function (event) {
  27. console.log("addEventListener", event);
  28. if (event.data && event.data.actionType == "CONTENT_SHOW_GIVE_DIALOG") {
  29. window.parent.postMessage({ actionType: "IFRAME_SHOW_IFREME" }, "*");
  30. dialogVisible.value = true;
  31. }
  32. });
  33. </script>
  34. <style>
  35. html, body {
  36. background-color: rgba(255,255,255,0)!important;
  37. line-height: unset !important;
  38. }
  39. </style>