@lambo-design-mobile/lambo-js-bridge 1.0.0-beta.24 → 1.0.0-beta.26
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/README.md +58 -4
- package/demo/index.vue +60 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
|
+
## [1.0.0-beta.26](http://git.inspur.com/ecbh/lambo-design/lambo-design/-/compare/@lambo-design-mobile/lambo-js-bridge@1.0.0-beta.25...@lambo-design-mobile/lambo-js-bridge@1.0.0-beta.26) (2025-03-19)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### ✨ Features | 新功能
|
|
6
|
+
|
|
7
|
+
* **@lambo-design-mobile/js-bridge:** 新增生物认证接口 ([cfb8f94](http://git.inspur.com/ecbh/lambo-design/lambo-design/-/commit/cfb8f9453f3ec769463b1cacc8fa9ab5b32e808f))
|
|
8
|
+
|
|
9
|
+
## [1.0.0-beta.25](http://git.inspur.com/ecbh/lambo-design/lambo-design/-/compare/@lambo-design-mobile/lambo-js-bridge@1.0.0-beta.24...@lambo-design-mobile/lambo-js-bridge@1.0.0-beta.25) (2025-03-10)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### ✨ Features | 新功能
|
|
13
|
+
|
|
14
|
+
* **@lambo-design-mobile/js-bridge:** 录音接口新增silenceDelay、silenceStopSeconds、volumeThreshold入参 ([e501510](http://git.inspur.com/ecbh/lambo-design/lambo-design/-/commit/e5015100c715b07a677ca90dffd4228ae13bd659))
|
|
15
|
+
|
|
2
16
|
## [1.0.0-beta.24](http://git.inspur.com/ecbh/lambo-design/lambo-design/-/compare/@lambo-design-mobile/lambo-js-bridge@1.0.0-beta.23...@lambo-design-mobile/lambo-js-bridge@1.0.0-beta.24) (2025-03-04)
|
|
3
17
|
|
|
4
18
|
|
package/README.md
CHANGED
|
@@ -350,7 +350,7 @@ method:{
|
|
|
350
350
|
this.recordingStatus = 'recording';
|
|
351
351
|
try {
|
|
352
352
|
// 传入 { auto: true } 表示启用自动录音
|
|
353
|
-
const result = await this.$lamboJsBridge.startRecording({ auto: true });
|
|
353
|
+
const result = await this.$lamboJsBridge.startRecording({ auto: true , silenceDelay: 1, silenceStopSeconds: 2, volumeThreshold: 60});
|
|
354
354
|
console.log("自动录音开始成功:", result);
|
|
355
355
|
} catch (error) {
|
|
356
356
|
console.error("自动录音开始失败:", error);
|
|
@@ -379,6 +379,8 @@ method:{
|
|
|
379
379
|
// 更新组件中的数据,页面会自动响应
|
|
380
380
|
this.recordingStatus = 'stopped';
|
|
381
381
|
this.audioUrl = data.fileUrl;
|
|
382
|
+
this.audioPath = data.filePath;
|
|
383
|
+
this.audioData = data.fileData;
|
|
382
384
|
},
|
|
383
385
|
},
|
|
384
386
|
mounted() {
|
|
@@ -390,9 +392,12 @@ mounted() {
|
|
|
390
392
|
|
|
391
393
|
`recordingOptions`: Object
|
|
392
394
|
|
|
393
|
-
| 属性 | 类型
|
|
394
|
-
|
|
395
|
-
| isAuto | boolean | false
|
|
395
|
+
| 属性 | 类型 | 默认值 | 必填 | 支持平台 | 说明 |
|
|
396
|
+
|-----------|---------|-------|-----|----------|---------------------------|
|
|
397
|
+
| isAuto | boolean | false | 否 | Yuntu | 是否开启自动录音。若为 true,则自动开始录音。 |
|
|
398
|
+
| silenceDelay | int | 3 | 否 | Yuntu | 延迟 n 秒后开始静音检测 |
|
|
399
|
+
| silenceStopSeconds | int | 4 | 否 | Yuntu | 连续 n 秒静音停止录音 |
|
|
400
|
+
| volumeThreshold | double | 40 | 否 | Yuntu | 音量阈值,单位为分贝 |
|
|
396
401
|
|
|
397
402
|
|
|
398
403
|
### 返回说明
|
|
@@ -445,3 +450,52 @@ async downloadFile() {
|
|
|
445
450
|
| 属性 | 类型 | 默认值 | 必填 | 支持平台 | 说明 |
|
|
446
451
|
|-----------|--|----------|-----|----------|---------|
|
|
447
452
|
| filePath | string | | 是 | Yuntu | 录音文件的路径 |
|
|
453
|
+
|
|
454
|
+
### 生物认证
|
|
455
|
+
|
|
456
|
+
提供本地生物特征认证能力,支持指纹/面容识别验证,支持查询设备可用生物特征类型。
|
|
457
|
+
|
|
458
|
+
``` javascript
|
|
459
|
+
async localAuth() {
|
|
460
|
+
try {
|
|
461
|
+
const result = await this.$lamboJsBridge.localAuthPlugin()
|
|
462
|
+
this.localAuthResult = JSON.stringify(result, null, 2)
|
|
463
|
+
this.availableBiometrics = '' // 清空另一个结果
|
|
464
|
+
} catch (error) {
|
|
465
|
+
this.localAuthResult = `认证失败: ${error.message}`
|
|
466
|
+
}
|
|
467
|
+
},
|
|
468
|
+
async getAvailableBiometrics() {
|
|
469
|
+
try {
|
|
470
|
+
const result = await this.$lamboJsBridge.getAvailableBiometrics()
|
|
471
|
+
this.availableBiometrics = JSON.stringify(result, null, 2)
|
|
472
|
+
this.localAuthResult = '' // 清空另一个结果
|
|
473
|
+
} catch (error) {
|
|
474
|
+
this.availableBiometrics = `获取失败: ${error.message}`
|
|
475
|
+
}
|
|
476
|
+
},
|
|
477
|
+
```
|
|
478
|
+
|
|
479
|
+
### 参数说明
|
|
480
|
+
|
|
481
|
+
`localAuthPlugin`: 无需参数<br>
|
|
482
|
+
`getAvailableBiometrics`: 无需参数
|
|
483
|
+
|
|
484
|
+
### 返回说明
|
|
485
|
+
|
|
486
|
+
`localAuthPlugin: Promise<Object>`
|
|
487
|
+
|
|
488
|
+
| 属性 | 类型 | 默认值 | 必填 | 支持平台 | 说明 |
|
|
489
|
+
|--------|--|----------|-----|----------|------|
|
|
490
|
+
| msg | string | | 是 | Yuntu | 返回信息 |
|
|
491
|
+
| authId | string | | 是 | Yuntu | 设备ID |
|
|
492
|
+
|
|
493
|
+
<br>
|
|
494
|
+
|
|
495
|
+
`getAvailableBiometrics: Promise<Object>`
|
|
496
|
+
|
|
497
|
+
| 属性 | 类型 | 默认值 | 必填 | 支持平台 | 说明 |
|
|
498
|
+
|--------|--------|----------|-----|----------|---------|
|
|
499
|
+
| msg | string | | 是 | Yuntu | 返回信息 |
|
|
500
|
+
| authId | array | | 是 | Yuntu | 支持的生物识别 |
|
|
501
|
+
| authId | string | | 是 | Yuntu | 设备ID |
|
package/demo/index.vue
CHANGED
|
@@ -59,9 +59,28 @@
|
|
|
59
59
|
<van-button @click="downloadFile">下载文件</van-button>
|
|
60
60
|
<p v-if="downloadLink">文件已下载,路径:{{ downloadLink }}</p>
|
|
61
61
|
</demo-block>
|
|
62
|
+
<demo-block title="生物认证">
|
|
63
|
+
<div class="auth-buttons">
|
|
64
|
+
<van-button @click="localAuth" class="auth-button">生物认证</van-button>
|
|
65
|
+
<van-button
|
|
66
|
+
@click="getAvailableBiometrics"
|
|
67
|
+
class="auth-button"
|
|
68
|
+
style="margin-left: 12px"
|
|
69
|
+
>
|
|
70
|
+
获取生物特征
|
|
71
|
+
</van-button>
|
|
72
|
+
</div>
|
|
62
73
|
|
|
74
|
+
<div v-if="localAuthResult" class="result-box">
|
|
75
|
+
<p class="result-title">认证结果:</p>
|
|
76
|
+
<pre><code>{{ localAuthResult }}</code></pre>
|
|
77
|
+
</div>
|
|
63
78
|
|
|
64
|
-
|
|
79
|
+
<div v-if="availableBiometrics" class="result-box">
|
|
80
|
+
<p class="result-title">支持的特征:</p>
|
|
81
|
+
<pre><code>{{ availableBiometrics }}</code></pre>
|
|
82
|
+
</div>
|
|
83
|
+
</demo-block>
|
|
65
84
|
</demo-section>
|
|
66
85
|
</template>
|
|
67
86
|
|
|
@@ -97,6 +116,8 @@ export default {
|
|
|
97
116
|
audioData: null,
|
|
98
117
|
recordingStatus: "not started", // 用于记录当前录音状态
|
|
99
118
|
downloadLink : null,
|
|
119
|
+
localAuthResult: '', // 生物认证结果
|
|
120
|
+
availableBiometrics: '' // 支持的生物特征
|
|
100
121
|
};
|
|
101
122
|
},
|
|
102
123
|
computed: {
|
|
@@ -162,7 +183,7 @@ export default {
|
|
|
162
183
|
this.recordingStatus = 'recording';
|
|
163
184
|
try {
|
|
164
185
|
// 传入 { auto: true } 表示启用自动录音
|
|
165
|
-
const result = await this.$lamboJsBridge.startRecording({ auto: true });
|
|
186
|
+
const result = await this.$lamboJsBridge.startRecording({ auto: true , silenceDelay: 1, silenceStopSeconds: 2, volumeThreshold: 60});
|
|
166
187
|
console.log("自动录音开始成功:", result);
|
|
167
188
|
} catch (error) {
|
|
168
189
|
console.error("自动录音开始失败:", error);
|
|
@@ -326,6 +347,24 @@ export default {
|
|
|
326
347
|
console.error('Error initializing key:', error);
|
|
327
348
|
}
|
|
328
349
|
},
|
|
350
|
+
async localAuth() {
|
|
351
|
+
try {
|
|
352
|
+
const result = await this.$lamboJsBridge.localAuthPlugin()
|
|
353
|
+
this.localAuthResult = JSON.stringify(result, null, 2)
|
|
354
|
+
this.availableBiometrics = '' // 清空另一个结果
|
|
355
|
+
} catch (error) {
|
|
356
|
+
this.localAuthResult = `认证失败: ${error.message}`
|
|
357
|
+
}
|
|
358
|
+
},
|
|
359
|
+
async getAvailableBiometrics() {
|
|
360
|
+
try {
|
|
361
|
+
const result = await this.$lamboJsBridge.getAvailableBiometrics()
|
|
362
|
+
this.availableBiometrics = JSON.stringify(result, null, 2)
|
|
363
|
+
this.localAuthResult = '' // 清空另一个结果
|
|
364
|
+
} catch (error) {
|
|
365
|
+
this.availableBiometrics = `获取失败: ${error.message}`
|
|
366
|
+
}
|
|
367
|
+
},
|
|
329
368
|
},
|
|
330
369
|
mounted() {
|
|
331
370
|
window.updateAudioDisplay = this.updateAudioDisplay;
|
|
@@ -379,4 +418,23 @@ code {
|
|
|
379
418
|
max-width: 100%;
|
|
380
419
|
border-radius: 4px;
|
|
381
420
|
}
|
|
421
|
+
.auth-buttons {
|
|
422
|
+
margin-bottom: 16px;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
.auth-button {
|
|
426
|
+
min-width: 120px;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.result-box {
|
|
430
|
+
margin-top: 12px;
|
|
431
|
+
border-top: 1px solid #eee;
|
|
432
|
+
padding-top: 12px;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
.result-title {
|
|
436
|
+
color: #666;
|
|
437
|
+
font-size: 12px;
|
|
438
|
+
margin-bottom: 8px;
|
|
439
|
+
}
|
|
382
440
|
</style>
|