@lambo-design-mobile/lambo-js-bridge 1.0.0-beta.31 → 1.0.0-beta.32

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 CHANGED
@@ -1,4 +1,11 @@
1
1
  # Changelog
2
+ ## [1.0.0-beta.32](http://git.inspur.com/ecbh/lambo-design/lambo-design/-/compare/@lambo-design-mobile/lambo-js-bridge@1.0.0-beta.31...@lambo-design-mobile/lambo-js-bridge@1.0.0-beta.32) (2025-07-16)
3
+
4
+
5
+ ### ✨ Features | 新功能
6
+
7
+ * **@lambo-design-mobile/js-bridge:** 山东中烟添加isUseBMap参数使用baidu接口定位 ([5ce030b](http://git.inspur.com/ecbh/lambo-design/lambo-design/-/commit/5ce030b58822a499e59729092aa613a20cecbf85))
8
+
2
9
  ## [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)
3
10
 
4
11
  ## [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)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lambo-design-mobile/lambo-js-bridge",
3
- "version": "1.0.0-beta.31",
3
+ "version": "1.0.0-beta.32",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "author": "lambo",
@@ -5,7 +5,7 @@ import CordovaAdapter from './CordovaAdapter';
5
5
  import YunTuAdapter from './YunTuAdapter';
6
6
  import WeComAdapter from './WeComAdapter';
7
7
  import BrowserAdapter from './BrowserAdapter';
8
- import MobileIMAdaoter from './MobileIMAdaoter';
8
+ import MobileIMAdapter from './MobileIMAdapter';
9
9
 
10
10
  class LamboJsBridge {
11
11
  constructor(param) {
@@ -30,7 +30,7 @@ class LamboJsBridge {
30
30
  } else if (/yuntu/.test(userAgent)) {
31
31
  this.platform = new YunTuAdapter(param);
32
32
  } else if (/mobileim/.test(userAgent)) {
33
- this.platform = new MobileIMAdaoter(param);
33
+ this.platform = new MobileIMAdapter(param);
34
34
  } else {
35
35
  this.platform = new BrowserAdapter();
36
36
  }
@@ -1,6 +1,7 @@
1
1
  import { getAddress } from './BdMapUtils';
2
+ import config from "@lambo-design-mobile/shared/config/config";
2
3
 
3
- class MobileIMAdaoter {
4
+ class MobileIMAdapter {
4
5
  constructor(_options) {
5
6
  }
6
7
 
@@ -14,15 +15,47 @@ class MobileIMAdaoter {
14
15
  };
15
16
 
16
17
  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,
18
+ if(config.isUseBMap) {
19
+ return new Promise((resolve, reject) => {
20
+ let map = new BMap.Map("allmap");
21
+ let longitude = 117.13597023313;
22
+ let latitude = 36.668022891427;
23
+ if (config.defaultLocation) {
24
+ longitude = config.defaultLocation.longitude;
25
+ latitude = config.defaultLocation.latitude;
26
+ }
27
+ let point = new BMap.Point(longitude, latitude);
28
+ map.centerAndZoom(point, 12);
29
+ let geolocation = new BMap.Geolocation();
30
+ // 开启SDK辅助定位
31
+ geolocation.enableSDKLocation();
32
+ geolocation.getCurrentPosition(function(r){
33
+ if(this.getStatus() == BMAP_STATUS_SUCCESS){
34
+ let mk = new BMap.Marker(r.point);
35
+ map.addOverlay(mk);
36
+ map.panTo(r.point);
37
+ resolve ({
38
+ latitude: r.point.lng,
39
+ longitude: r.point.lat,
40
+ accuracy: r.accuracy,
41
+ });
42
+ } else {
43
+ console.error('定位失败: ' + this.getStatus())
44
+ reject(new Error('定位失败: ' + this.getStatus()));
45
+ }
46
+ });
47
+ })
48
+ } else {
49
+ return new Promise((resolve2) => {
50
+ window.native.getLocation(args, (res) => {
51
+ resolve2({
52
+ latitude: res.point.latitude,
53
+ longitude: res.point.longitude,
54
+ accuracy: res.point.horizontalAccuracy,
55
+ });
23
56
  });
24
57
  });
25
- });
58
+ }
26
59
  };
27
60
 
28
61
  // 先判断是否需要地理位置 如不需要 直接返回坐标
@@ -83,4 +116,4 @@ class MobileIMAdaoter {
83
116
  }
84
117
  }
85
118
 
86
- export default MobileIMAdaoter;
119
+ export default MobileIMAdapter;