|
@@ -1,9 +1,8 @@
|
|
|
<template>
|
|
|
- <my-full-screen-dialog ref="openDialogRef" close-color="#134FA4" @close-dialog="handleClose">
|
|
|
+ <my-full-screen-dialog ref="openDialogRef" close-color="#134FA4" :show-close="false" @close-dialog="handleClose">
|
|
|
<div class="cocos-container w-full h-full flex flex-col items-center text-[#134FA4]">
|
|
|
- <iframe :src="`/src/views/gameCenter/cocos/${props.code}/build/pack/index.html`" frameborder="0"></iframe>
|
|
|
-<!-- <iframe :src="`/public/cocos/${props.code}/build/pack/index.html`" frameborder="0"></iframe>-->
|
|
|
-<!-- <iframe src="http://192.168.0.39:7457/web-mobile/pack/index.html" frameborder="0"></iframe>-->
|
|
|
+ <iframe :src="props.url" frameborder="0"></iframe>
|
|
|
+ <!--<iframe src="http://192.168.1.10:7456/web-mobile/ADL/index.html" frameborder="0"></iframe>-->
|
|
|
</div>
|
|
|
</my-full-screen-dialog>
|
|
|
</template>
|
|
@@ -22,18 +21,25 @@ const props = defineProps({
|
|
|
type: String,
|
|
|
required: true,
|
|
|
default: ''
|
|
|
+ },
|
|
|
+ url: {
|
|
|
+ type: String,
|
|
|
+ required: true,
|
|
|
+ default: ''
|
|
|
}
|
|
|
})
|
|
|
const $emits = defineEmits(['gameOver'])
|
|
|
const openDialogRef = ref()
|
|
|
const handleClose = (done: () => void) => {
|
|
|
- $emits('gameOver', 'COCOSDialog')
|
|
|
+ $emits('gameOver', 'CocosDialog')
|
|
|
}
|
|
|
|
|
|
async function exec() {
|
|
|
openDialogRef.value.openDialog()
|
|
|
- window.addEventListener('message',(e) => {
|
|
|
- console.log(e)
|
|
|
+ window.addEventListener('message', (e: MessageEvent) => {
|
|
|
+ if (e.data === 'close') {
|
|
|
+ handleClose(() => {})
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -44,7 +50,6 @@ onMounted(() => {
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
.cocos-container {
|
|
|
-
|
|
|
iframe {
|
|
|
width: 100%;
|
|
|
height: 100%;
|