feat(h5): 引入微信JSSDK并实现跨域消息通信

- 在H5环境中动态加载微信JSSDK 实脚本
-现向父窗口发送postMessage消息
- 支持向微信小程序发送postMessage消息
- 添加延迟执行机制确保消息发送时机
- 增强与微信小程序的交互能力
This commit is contained in:
liguigong
2025-10-11 10:32:12 +08:00
parent 2af8b9d635
commit 5c279028c3
2 changed files with 27 additions and 0 deletions
+6
View File
@@ -3,6 +3,12 @@
import { ShoproInit } from './sheep';
onLaunch(() => {
// #ifdef H5
const script = document.createElement('script');
script.src = 'https://res.wx.qq.com/open/js/jweixin-1.6.0.js';
script.type = 'text/javascript';
document.body.appendChild(script);
// #endif
// 隐藏原生导航栏 使用自定义底部导航
uni.hideTabBar({
fail: () => {},