From fb5bec5a9659d2a00c0eed835c6dcd4f91cd7508 Mon Sep 17 00:00:00 2001 From: tanghaolin <1723298894@qq.com> Date: 星期一, 07 四月 2025 11:55:06 +0800 Subject: [PATCH] 修改泵选型接口路径 --- src/components/CustomerService.vue | 39 +++++++++++++++++++++++++++++---------- 1 files changed, 29 insertions(+), 10 deletions(-) diff --git a/src/components/CustomerService.vue b/src/components/CustomerService.vue index e37c946..ae109af 100644 --- a/src/components/CustomerService.vue +++ b/src/components/CustomerService.vue @@ -1,16 +1,35 @@ <template> <div class="bg-white"> - <div class="flex items-center justify-between px-4 py-2 text-black" style="border-bottom: 1px solid #e0e0e0;"> - <div class="text-lg font-bold">鍦ㄧ嚎瀹㈡湇</div> - <div class="cursor-pointer" @click="$emit('close')"> - <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" /> - </svg> - </div> - </div> - <iframe src="https://wi.beng35.com/iie/mobile?v=2" class="w-full h-[calc(100%-44px)] border-none overflow-hidden"></iframe> + <iframe ref="iframeRef" :src="url" class="w-full h-full border-none overflow-hidden"></iframe> </div> </template> -<script setup lang="ts" name="CustomerService"></script> +<script setup lang="ts" name="CustomerService"> +const emit = defineEmits(['close']); + +import { ref, onMounted } from 'vue'; +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=132323'; +}; + +const url = getUrl(); + +const iframeRef = ref<HTMLIFrameElement>(); + +onMounted(() => { + window.addEventListener('message', (event) => { + if (event.data.type === 'close') { + emit('close'); + } else if (event.data.type === 'childIsReady') { + console.log('馃殌 ~ child is ready',); + ChildRegister.registerNotifyFunction(); + } + }); +}); +</script> <style scoped lang="scss"></style> -- Gitblit v1.9.3