@lambo-design-mobile/lambo-js-bridge 1.0.0-beta.29 → 1.0.0-beta.31
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 +12 -3
- package/package.json +1 -1
- package/src/sdk/LPAPI.js +3 -1
- package/src/sdk/MobileIMAdaoter.js +44 -25
package/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
|
-
## [1.0.0-beta.
|
|
3
|
-
|
|
4
|
-
## [1.0.0-beta.28](http://git.inspur.com/ecbh/lambo-design/lambo-design/-/compare/@lambo-design-mobile/lambo-js-bridge@1.0.0-beta.27...@lambo-design-mobile/lambo-js-bridge@1.0.0-beta.28) (2025-04-17)
|
|
2
|
+
## [1.0.0-beta.31](http://git.inspur.com/ecbh/lambo-design/lambo-design/-/compare/@lambo-design-mobile/lambo-js-bridge@1.0.0-beta.30...@lambo-design-mobile/lambo-js-bridge@1.0.0-beta.31) (2025-06-11)
|
|
5
3
|
|
|
4
|
+
## [1.0.0-beta.30](http://git.inspur.com/ecbh/lambo-design/lambo-design/-/compare/@lambo-design-mobile/lambo-js-bridge@1.0.0-beta.29...@lambo-design-mobile/lambo-js-bridge@1.0.0-beta.30) (2025-04-27)
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
### 🐛 Bug Fixes | Bug 修复
|
|
8
|
+
|
|
9
|
+
* 修改山东中烟协同办公适配接口 ([8e2de55](http://git.inspur.com/ecbh/lambo-design/lambo-design/-/commit/8e2de554c351fea01df44cdc7d1bd463315c1c8b))
|
|
10
|
+
|
|
11
|
+
## [1.0.0-beta.29](http://git.inspur.com/ecbh/lambo-design/lambo-design/-/compare/@lambo-design-mobile/lambo-js-bridge@1.0.0-beta.28...@lambo-design-mobile/lambo-js-bridge@1.0.0-beta.29) (2025-04-18)
|
|
12
|
+
|
|
13
|
+
## [1.0.0-beta.28](http://git.inspur.com/ecbh/lambo-design/lambo-design/-/compare/@lambo-design-mobile/lambo-js-bridge@1.0.0-beta.27...@lambo-design-mobile/lambo-js-bridge@1.0.0-beta.28) (2025-04-17)
|
|
14
|
+
|
|
6
15
|
## [1.0.0-beta.27](http://git.inspur.com/ecbh/lambo-design/lambo-design/-/compare/@lambo-design-mobile/lambo-js-bridge@1.0.0-beta.26...@lambo-design-mobile/lambo-js-bridge@1.0.0-beta.27) (2025-03-25)
|
|
7
16
|
|
|
8
17
|
|
package/package.json
CHANGED
package/src/sdk/LPAPI.js
CHANGED
|
@@ -280,8 +280,10 @@
|
|
|
280
280
|
* @param error 失败回调函数;
|
|
281
281
|
*/
|
|
282
282
|
api.isPrinterOpened = function (success, error) {
|
|
283
|
-
if (
|
|
283
|
+
if (window?.device?.systemName !== 'iOS') {
|
|
284
284
|
LPAPIPlugin.isPrinterOpened(success, error);
|
|
285
|
+
} else {
|
|
286
|
+
success({isOpened: true});
|
|
285
287
|
}
|
|
286
288
|
};
|
|
287
289
|
|
|
@@ -1,40 +1,59 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { getAddress } from './BdMapUtils';
|
|
2
2
|
|
|
3
3
|
class MobileIMAdaoter {
|
|
4
4
|
constructor(_options) {
|
|
5
|
-
function loadScript(src) {
|
|
6
|
-
return new Promise((resolve, reject) => {
|
|
7
|
-
const script = document.createElement('script');
|
|
8
|
-
script.src = src;
|
|
9
|
-
script.onload = () => resolve(script);
|
|
10
|
-
script.onerror = () => reject(new Error('Failed to load script'));
|
|
11
|
-
document.head.appendChild(script);
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
loadScript('/ind-uc-ext/native.js')
|
|
15
|
-
.then((script) => console.log('Script loaded'))
|
|
16
|
-
.catch((err) => console.error(err));
|
|
17
5
|
}
|
|
18
6
|
|
|
7
|
+
// 新门户系统: 我们移动端只能提供坐标数据,没法提供街道地市这些信息。。
|
|
19
8
|
async getLocation(options) {
|
|
20
9
|
return new Promise((resolve, reject) => {
|
|
21
10
|
try {
|
|
22
11
|
let args = {
|
|
23
12
|
// 是否获取地址信息
|
|
24
13
|
// isNeedAddress: true,
|
|
25
|
-
...config.imGeoOptions
|
|
26
14
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
15
|
+
|
|
16
|
+
const fetchLocation = () => {
|
|
17
|
+
return new Promise((resolve2) => {
|
|
18
|
+
window.native.getLocation(args, (res) => {
|
|
19
|
+
resolve2({
|
|
20
|
+
latitude: res.point.latitude,
|
|
21
|
+
longitude: res.point.longitude,
|
|
22
|
+
accuracy: res.point.horizontalAccuracy,
|
|
23
|
+
});
|
|
24
|
+
});
|
|
36
25
|
});
|
|
37
|
-
}
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
// 先判断是否需要地理位置 如不需要 直接返回坐标
|
|
29
|
+
if (options.needAddress) {
|
|
30
|
+
fetchLocation()
|
|
31
|
+
.then(async (bd09Location) => {
|
|
32
|
+
console.log(
|
|
33
|
+
'with options.needAddress bd09Location',
|
|
34
|
+
bd09Location
|
|
35
|
+
);
|
|
36
|
+
// const result = getAddress(bd09Location.longitude, bd09Location.latitude)
|
|
37
|
+
//平台返回的经纬度是反的 解决了再换回来
|
|
38
|
+
const result = await getAddress(
|
|
39
|
+
bd09Location.latitude,
|
|
40
|
+
bd09Location.longitude
|
|
41
|
+
);
|
|
42
|
+
console.log('with options.needAddress getAddress result', result);
|
|
43
|
+
if (!result) {
|
|
44
|
+
return reject(new Error('Invalid location data'));
|
|
45
|
+
}
|
|
46
|
+
resolve({
|
|
47
|
+
...bd09Location,
|
|
48
|
+
...result,
|
|
49
|
+
});
|
|
50
|
+
})
|
|
51
|
+
.catch((err) => {
|
|
52
|
+
reject(err);
|
|
53
|
+
});
|
|
54
|
+
} else {
|
|
55
|
+
resolve(fetchLocation());
|
|
56
|
+
}
|
|
38
57
|
} catch (err) {
|
|
39
58
|
console.error('getLocation failed:', err);
|
|
40
59
|
reject(err);
|
|
@@ -56,7 +75,7 @@ class MobileIMAdaoter {
|
|
|
56
75
|
});
|
|
57
76
|
}
|
|
58
77
|
|
|
59
|
-
async
|
|
78
|
+
async getPlatform(options = {}) {
|
|
60
79
|
// 获取初始化信息
|
|
61
80
|
return {
|
|
62
81
|
platform: 'MobileIM',
|