qsh-webview-sdk 2.1.0 → 2.2.1

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/README.md CHANGED
@@ -672,16 +672,10 @@ qsh.chooseLocation({
672
672
  ### 人脸核身
673
673
 
674
674
  ```javascript
675
- // 人脸核身(小程序/APP)
675
+ // 人脸核身:跳转宿主小程序 /pages/face/index,并将参数拼到 query 上
676
676
  qsh.faceVerify({
677
- verifyType: 'idcard', // 核身类型:idcard, bankcard, driver
678
- idCard: '身份证号',
679
677
  name: '姓名',
680
- success: (res) => {
681
- console.log('核身结果:', res.verifyResult);
682
- console.log('核身分数:', res.score);
683
- },
684
- fail: (err) => console.error(err)
678
+ idCardNumber: '身份证号'
685
679
  });
686
680
  ```
687
681
 
package/dist/index.d.ts CHANGED
@@ -289,6 +289,36 @@ declare namespace UniWebView {
289
289
  isProd?: boolean;
290
290
  }
291
291
 
292
+ /**
293
+ * 人脸识别选项(仅支持微信小程序环境)
294
+ * 只发送请求,不返回任何结果给调用者
295
+ */
296
+ interface FaceVerifyOptions {
297
+ /** 姓名(必填) */
298
+ name: string;
299
+ /** 身份证号(必填) */
300
+ idCardNumber: string;
301
+ }
302
+
303
+ /**
304
+ * 人脸识别功能能力信息
305
+ */
306
+ interface FaceCapabilities {
307
+ /** 是否支持人脸识别(仅微信小程序环境返回 true) */
308
+ supported: boolean;
309
+ /** 当前环境类型 */
310
+ environment: string;
311
+ /** 底层实现类型,固定为 'weixin' */
312
+ implementation: "weixin";
313
+ /** 功能特性 */
314
+ features: {
315
+ /** 支持 Promise */
316
+ asyncSupport: boolean;
317
+ /** 通过宿主页跳转实现 */
318
+ hostPageNavigation?: boolean;
319
+ };
320
+ }
321
+
292
322
  interface WeixinNamespace {
293
323
  config(options: QshConfigOptions): QshConfigOptions;
294
324
  waitForConfig(): Promise<void>;
@@ -297,7 +327,6 @@ declare namespace UniWebView {
297
327
  retryConfig(): Promise<void>;
298
328
  }
299
329
 
300
-
301
330
  /**
302
331
  * WebView 对象接口
303
332
  */
@@ -326,7 +355,7 @@ declare namespace UniWebView {
326
355
  webView: WebView | null;
327
356
 
328
357
  weixin: WeixinNamespace;
329
-
358
+
330
359
  /** 图片选择(Promise版本) */
331
360
  chooseImageAsync(
332
361
  options?: Omit<ChooseImageOptions, "success" | "fail" | "complete">,
@@ -375,6 +404,14 @@ declare namespace UniWebView {
375
404
  /** 获取打印PDF功能能力信息 */
376
405
  getPrintCapabilities(): PrintPdfCapabilities;
377
406
 
407
+ /**
408
+ * 人脸识别(仅支持微信小程序环境)
409
+ * 通过 wx.miniProgram.navigateTo 跳转宿主 /pages/face/index,不返回任何结果给调用者
410
+ */
411
+ faceVerify(options: FaceVerifyOptions): void;
412
+ /** 获取人脸识别功能能力信息 */
413
+ getFaceCapabilities(): FaceCapabilities;
414
+
378
415
  /** 观测指标 */
379
416
  metrics: {
380
417
  getPerformanceReport(): Record<string, any>;