@lambo-design-mobile/lambo-js-bridge 1.0.0-beta.35 → 1.0.0-beta.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/package.json +1 -1
- package/src/sdk/WeComAdapter.js +24 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
|
+
## [1.0.0-beta.37](http://git.inspur.com/ecbh/lambo-design/lambo-design/-/compare/@lambo-design-mobile/lambo-js-bridge@1.0.0-beta.36...@lambo-design-mobile/lambo-js-bridge@1.0.0-beta.37) (2025-09-04)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### ✨ Features | 新功能
|
|
6
|
+
|
|
7
|
+
* 修复定位问题 ([534fb86](http://git.inspur.com/ecbh/lambo-design/lambo-design/-/commit/534fb867f34c00ceea6d32f0be598a825174ae03))
|
|
8
|
+
|
|
9
|
+
## [1.0.0-beta.36](http://git.inspur.com/ecbh/lambo-design/lambo-design/-/compare/@lambo-design-mobile/lambo-js-bridge@1.0.0-beta.35...@lambo-design-mobile/lambo-js-bridge@1.0.0-beta.36) (2025-09-04)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### ✨ Features | 新功能
|
|
13
|
+
|
|
14
|
+
* 尝试解决小程序js桥初始化时机问题 ([31ad1ac](http://git.inspur.com/ecbh/lambo-design/lambo-design/-/commit/31ad1ac20ad6edeeb81b55bb8c134d3b5776cdd7))
|
|
15
|
+
|
|
2
16
|
## [1.0.0-beta.35](http://git.inspur.com/ecbh/lambo-design/lambo-design/-/compare/@lambo-design-mobile/lambo-js-bridge@1.0.0-beta.34...@lambo-design-mobile/lambo-js-bridge@1.0.0-beta.35) (2025-09-01)
|
|
3
17
|
|
|
4
18
|
|
package/package.json
CHANGED
package/src/sdk/WeComAdapter.js
CHANGED
|
@@ -29,12 +29,30 @@ class WeComAdapter {
|
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
let self = this
|
|
33
|
+
function initJsSdk() {
|
|
34
|
+
loadScript('//res.wx.qq.com/open/js/jweixin-1.2.0.js')
|
|
35
|
+
.then((script) => {
|
|
36
|
+
console.log('Script loaded');
|
|
37
|
+
self.init(_options);
|
|
38
|
+
})
|
|
39
|
+
.catch((err) => console.error(err));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const ua = navigator.userAgent;
|
|
43
|
+
const isiOS = /iPhone|iPad|iPod/i.test(ua);
|
|
44
|
+
const isMiniProgramUA = /miniProgram/i.test(ua);
|
|
45
|
+
const isiOSMiniProgramUA = isiOS && isMiniProgramUA;
|
|
46
|
+
|
|
47
|
+
// iOS 使用的是 WKWebview,其 JavaScript 注入时机与 UIWebview 不同,存在更严格的同步性要求。
|
|
48
|
+
// 如果在你调用 wx.config 时,微信的 JS 桥还没有完全注入到当前 Webview 中,初始化就会失败。
|
|
49
|
+
if (isiOSMiniProgramUA) {
|
|
50
|
+
setTimeout(() => {
|
|
51
|
+
initJsSdk();
|
|
52
|
+
}, 1000);
|
|
53
|
+
} else {
|
|
54
|
+
initJsSdk();
|
|
55
|
+
}
|
|
38
56
|
}
|
|
39
57
|
|
|
40
58
|
async init(options) {
|