From 65f80c55b05d73ee293c3df7306b4f846132faa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B6=85=E7=BA=A7=E8=80=81=E7=99=BD=E5=85=94?= Date: Sat, 2 Aug 2025 19:58:49 +0800 Subject: [PATCH] =?UTF-8?q?FEAT=20=3D>=20=E6=9C=AC=E6=AC=A1=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E9=A1=B9=E7=9B=AE=E4=B8=BA=EF=BC=9A=20=E5=9F=BA?= =?UTF-8?q?=E7=A1=80=E9=85=8D=E7=BD=AE=E4=BC=A0=E9=80=92=E8=BF=87=E5=8E=BB?= =?UTF-8?q?=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ckApp/pages/index/index.vue | 18 ++++++------- ckApp/pages/index/test.vue | 45 ++++++++++++++++++++++++++------ nkebao/src/pages/iframe/init.tsx | 1 + 3 files changed, 46 insertions(+), 18 deletions(-) diff --git a/ckApp/pages/index/index.vue b/ckApp/pages/index/index.vue index 538d3a3c..8fc18ea2 100644 --- a/ckApp/pages/index/index.vue +++ b/ckApp/pages/index/index.vue @@ -43,7 +43,7 @@ CONNECT: 0, DATA: 1, FUNCTION: 2, - + CONFIG: 3, } export default { data() { @@ -56,10 +56,7 @@ } }, onLoad() { - this.buildIframeUrl(); - setTimeout(() => { - this.sendMessageToIframeConnect() - }, 1000); + this.sendBaseConfig() }, methods: { // 构建 iframe URL,包含参数 @@ -96,13 +93,14 @@ console.log('[App]SendMessage=>\n' + JSON.stringify(message)); }, // 发送消息到 iframe(通过URL传参) - async sendMessageToIframeConnect() { + async sendBaseConfig() { const message = { - type: TYPE_EMUE.CONNECT, + type: TYPE_EMUE.CONFIG, data: { - action: 'ping', - content: '联通测试通过', - timestamp: Date.now() + paddingTop: await getTopSafeAreaHeightAsync(), + appId: '1234567890', + appName: '存客宝', + appVersion: '1.0.0', } }; diff --git a/ckApp/pages/index/test.vue b/ckApp/pages/index/test.vue index a756e8e6..538d3a3c 100644 --- a/ckApp/pages/index/test.vue +++ b/ckApp/pages/index/test.vue @@ -39,10 +39,16 @@