| | |
| | | const emit = defineEmits(['close']); |
| | | |
| | | import { ref, onMounted } from 'vue'; |
| | | import { setParentFunction } from '@/utils/iframeCall'; |
| | | import { ChildRegister } from '@/utils/iframeCall'; |
| | | const getUrl = () => { |
| | | const isDev = import.meta.env.DEV; |
| | | if (isDev) { |
| | | return 'http://localhost:5679'; |
| | | } |
| | | return 'http://www.xpump.net/iie-mobile?v=32323331222'; |
| | | return 'http://www.xpump.net/iie-mobile?v=132323'; |
| | | }; |
| | | |
| | | const url = getUrl(); |
| | |
| | | window.addEventListener('message', (event) => { |
| | | if (event.data.type === 'close') { |
| | | emit('close'); |
| | | } else if (event.data.type === 'childIsReady') { |
| | | console.log('🚀 ~ child is ready',); |
| | | ChildRegister.registerNotifyFunction(); |
| | | } |
| | | }); |
| | | setTimeout(() => { |
| | | setParentFunction(); |
| | | }, 800); |
| | | }); |
| | | </script> |
| | | <style scoped lang="scss"></style> |