@lambo-design-mobile/lambo-js-bridge 1.0.0-beta.8 → 1.0.0-beta.9
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 +13 -0
- package/README.md +6 -17
- package/package.json +1 -1
- package/src/sdk/YunTuAdapter.js +1 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
|
+
## [1.0.0-beta.9](http://git.inspur.com/ecbh/lambo-design/lambo-design/-/compare/@lambo-design-mobile/js-bridge@1.0.0-beta.8...@lambo-design-mobile/js-bridge@1.0.0-beta.9) (2024-09-12)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### 🐛 Bug Fixes | Bug 修复
|
|
6
|
+
|
|
7
|
+
* **@lambo-design-mobile/js-bridge:** 修正flutter环境下插件初始化问题 ([680e188](http://git.inspur.com/ecbh/lambo-design/lambo-design/-/commit/680e188449516e15a0355a3017b70a5eeea7c2d2))
|
|
8
|
+
* **@lambo-design-mobile/js-bridge:** 修正flutter环境下插件初始化问题 ([c5a7fba](http://git.inspur.com/ecbh/lambo-design/lambo-design/-/commit/c5a7fba9af2b2cd2abb20bc6bca1eec636c0c092))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### 📝 Documentation | 文档
|
|
12
|
+
|
|
13
|
+
* **@lambo-design-mobile/js-bridge:** 修改README说明 ([bfc7255](http://git.inspur.com/ecbh/lambo-design/lambo-design/-/commit/bfc7255ed88289fc366e4c5fbf1f9bc5584b1c1a))
|
|
14
|
+
|
|
2
15
|
## [1.0.0-beta.8](http://git.inspur.com/ecbh/lambo-design/lambo-design/-/compare/@lambo-design-mobile/js-bridge@1.0.0-beta.7...@lambo-design-mobile/js-bridge@1.0.0-beta.8) (2024-09-09)
|
|
3
16
|
|
|
4
17
|
|
package/README.md
CHANGED
|
@@ -13,17 +13,6 @@ LamboJsBridge 是一个js 适配sdk 用于处理H5应用和运行时环境的能
|
|
|
13
13
|
console.log("------ 初始化 LamboJsBridge -------")
|
|
14
14
|
import LamboJsBridge from "@lambo-design-mobile/lambo-js-bridge";
|
|
15
15
|
let lamboJsBridge = new LamboJsBridge();
|
|
16
|
-
try {
|
|
17
|
-
const platformInfo = await lamboJsBridge.getPlatform(); // 获取初始化信息
|
|
18
|
-
console.log('LamboJsBridge Platform Info:', JSON.stringify(platformInfo, null, 2));
|
|
19
|
-
|
|
20
|
-
//yuntu Flutter 平台需要初始化插件
|
|
21
|
-
const pluginConfig = ["scanCodePlugin", "filePreviewPlugin", "imagePickerPlugin"]
|
|
22
|
-
const pluginConfigInfo = await lamboJsBridge.initializePlugin(pluginConfig);
|
|
23
|
-
console.log('LamboJsBridge PluginConfig Info:', pluginConfigInfo);
|
|
24
|
-
} catch (error) {
|
|
25
|
-
console.error('Error getting init info:', error);
|
|
26
|
-
}
|
|
27
16
|
// 将 lamboJsBridge 挂载到 Vue 原型上
|
|
28
17
|
Vue.prototype.$lamboJsBridge = lamboJsBridge;
|
|
29
18
|
```
|
|
@@ -77,14 +66,14 @@ import LamboJsBridge from '@lambo-design-mobile/lambo-js-bridge';
|
|
|
77
66
|
weComId:this.weComId,
|
|
78
67
|
dingTalkId:this.dingTalkId,
|
|
79
68
|
};
|
|
80
|
-
this
|
|
69
|
+
this.$lamboJsBridge = new LamboJsBridge(options);
|
|
81
70
|
await this.getPlatform();
|
|
82
71
|
},
|
|
83
72
|
|
|
84
73
|
methods: {
|
|
85
74
|
async getPlatform() {
|
|
86
75
|
try {
|
|
87
|
-
const info = await this.
|
|
76
|
+
const info = await this.$lamboJsBridge.getPlatform(); // 获取初始化信息
|
|
88
77
|
this.initInfo = JSON.stringify(info, null, 2); // 美化输出
|
|
89
78
|
console.log('Init Info:', info);
|
|
90
79
|
} catch (error) {
|
|
@@ -122,7 +111,7 @@ import LamboJsBridge from '@lambo-design-mobile/lambo-js-bridge';
|
|
|
122
111
|
const options ={
|
|
123
112
|
// 初始化参数,根据需要填写
|
|
124
113
|
};
|
|
125
|
-
const location = await this.
|
|
114
|
+
const location = await this.$lamboJsBridge.getLocation(options);
|
|
126
115
|
console.log("location",location)
|
|
127
116
|
this.location += `${JSON.stringify(location)}\n`; // 追加新数据
|
|
128
117
|
this.latitude = location.latitude; // 存储纬度
|
|
@@ -169,7 +158,7 @@ import LamboJsBridge from '@lambo-design-mobile/lambo-js-bridge';
|
|
|
169
158
|
const options ={
|
|
170
159
|
// 初始化参数,根据需要填写
|
|
171
160
|
};
|
|
172
|
-
const result = await this.
|
|
161
|
+
const result = await this.$lamboJsBridge.scanCode(options);
|
|
173
162
|
this.scanResult += `${JSON.stringify(result)}\n`; // 追加新数据
|
|
174
163
|
console.log('Scan result:', result);
|
|
175
164
|
} catch (error) {
|
|
@@ -209,7 +198,7 @@ import LamboJsBridge from '@lambo-design-mobile/lambo-js-bridge';
|
|
|
209
198
|
ossImgPutUrl: this.ossImgPutUrl,
|
|
210
199
|
ossImgGetUrl: this.ossImgGetUrl
|
|
211
200
|
};
|
|
212
|
-
const photo = await this.
|
|
201
|
+
const photo = await this.$lamboJsBridge.takePhoto(options);
|
|
213
202
|
this.photoResult += `${JSON.stringify(photo)}\n`; // 追加新数据
|
|
214
203
|
console.log('Photo result:', photo);
|
|
215
204
|
} catch (error) {
|
|
@@ -260,7 +249,7 @@ async openLocation() {
|
|
|
260
249
|
address: this.address,
|
|
261
250
|
scale: this.scale
|
|
262
251
|
};
|
|
263
|
-
await this.
|
|
252
|
+
await this.$lamboJsBridge.openLocation(options);
|
|
264
253
|
this.openLocationResult = '位置已成功打开'; // 成功打开位置时存储信息
|
|
265
254
|
console.log('Location opened successfully');
|
|
266
255
|
} else {
|
package/package.json
CHANGED
package/src/sdk/YunTuAdapter.js
CHANGED
|
@@ -4,19 +4,16 @@ class YunTuAdapter {
|
|
|
4
4
|
constructor() {
|
|
5
5
|
// 标志插件是否已初始化
|
|
6
6
|
this.isInitialized = false;
|
|
7
|
+
this.initializePlugin();
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
async initializePlugin(pluginConfig) {
|
|
10
11
|
try {
|
|
11
|
-
// 如果传入的是非空数组,则直接使用;否则使用默认的全部插件配置
|
|
12
12
|
const configToUse = Array.isArray(pluginConfig) && pluginConfig.length > 0
|
|
13
13
|
? JSON.stringify(pluginConfig)
|
|
14
14
|
: '["myPlugin","tabBarPlugin","scanCodePlugin","filePreviewPlugin","imagePickerPlugin"]';
|
|
15
|
-
// 调用插件初始化
|
|
16
15
|
await yuntuConfig(configToUse); // 确保等待 yuntuConfig 执行完成
|
|
17
|
-
|
|
18
16
|
this.isInitialized = true;
|
|
19
|
-
// 将插件信息解析并存储到 this.plugin
|
|
20
17
|
this.plugins = JSON.parse(configToUse);
|
|
21
18
|
console.log("Initialized plugins:", this.plugins);
|
|
22
19
|
return this.plugins;
|