qsh-webview-sdk 2.4.1 → 2.4.3

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
@@ -596,10 +596,9 @@ qsh.chooseLocation({
596
596
  latitude: 39.908823, // 初始纬度
597
597
  longitude: 116.397470, // 初始经度
598
598
  success: (res) => {
599
- console.log('选择位置:', res.name);
600
- console.log('地址:', res.address);
601
- console.log('纬度:', res.latitude);
602
- console.log('经度:', res.longitude);
599
+ console.log(res.location);
600
+ console.log(res.formatted_address);
601
+ console.log(res.addressComponent);
603
602
  },
604
603
  fail: (err) => console.error(err)
605
604
  });
@@ -626,20 +625,12 @@ qsh.printPdf({
626
625
  });
627
626
  ```
628
627
 
629
- ## 兼容性
630
-
631
- - 微信小程序 WebView
632
- - UniApp APP 端 (Android/iOS)
633
- - H5+ 环境
634
- - NVUE 页面
635
- - UVUE 页面 (UniApp X)
636
-
637
628
  ### 跳转其他微信小程序
638
629
 
639
630
  ```javascript
640
631
  qsh.navigateToMiniProgram({
641
- appid: ',
642
- path: ',
632
+ appid: '',
633
+ path: '',
643
634
  // release/trial/develop
644
635
  env: 'release',
645
636
  success: (res) => console.log('跳转成功', res),
@@ -668,6 +659,14 @@ qsh.manualShare({
668
659
  对于isPublic:true时 用户点击分享的内容后会直接从基座首页跳转到h5Url, 对于isPublic:false时,基座完成登录流程后会携带参数h5Url=${encodeURIComponent(h5Url)}跳转到业务配置的h5首页, 在h5首页获取code和h5Url后根据需要自行处理登录逻辑和跳转
669
660
  此方法会销毁当前H5页面并返回小程序基座
670
661
 
662
+ ## 兼容性
663
+
664
+ - 微信小程序 WebView
665
+ - UniApp APP 端 (Android/iOS)
666
+ - H5+ 环境
667
+ - NVUE 页面
668
+ - UVUE 页面 (UniApp X)
669
+
671
670
  ## License
672
671
 
673
672
  MIT
package/dist/index.d.ts CHANGED
@@ -274,10 +274,7 @@ declare namespace UniWebView {
274
274
  title?: string;
275
275
  }
276
276
 
277
- type ShareUniversalPayload =
278
- | ShareUniversalPayloadWeb
279
- | ShareUniversalPayloadText
280
- | ShareUniversalPayloadImage;
277
+ type ShareUniversalPayload = ShareUniversalPayloadWeb | ShareUniversalPayloadText | ShareUniversalPayloadImage;
281
278
 
282
279
  interface ShareResult {
283
280
  errMsg?: string;
@@ -316,7 +313,7 @@ declare namespace UniWebView {
316
313
  interface ShareMiniProgramCardPayload {
317
314
  title: string;
318
315
  imageUrl: string;
319
- /** 目标小程序页面路径,必须是 /pages/... 形式 */
316
+ /** 目标小程序页面路径 */
320
317
  targetPath: string;
321
318
  /** 目标小程序 appid */
322
319
  appid: string;
@@ -483,26 +480,18 @@ declare namespace UniWebView {
483
480
  /** WebView 对象(兼容旧版本) */
484
481
  webView: WebView | null;
485
482
 
486
- navigateToMiniProgram(
487
- options: MiniProgramNavigateOptions,
488
- ): Promise<MiniProgramNavigateResult> | void;
489
- navigateToMiniProgramAsync(
490
- options: Omit<MiniProgramNavigateOptions, "success" | "fail" | "complete">,
491
- ): Promise<MiniProgramNavigateResult>;
483
+ navigateToMiniProgram(options: MiniProgramNavigateOptions): Promise<MiniProgramNavigateResult> | void;
484
+ navigateToMiniProgramAsync(options: Omit<MiniProgramNavigateOptions, "success" | "fail" | "complete">): Promise<MiniProgramNavigateResult>;
492
485
 
493
486
  weixin: WeixinNamespace;
494
487
 
495
488
  /** 图片选择(Promise版本) */
496
- chooseImageAsync(
497
- options?: Omit<ChooseImageOptions, "success" | "fail" | "complete">,
498
- ): Promise<ChooseImageResult>;
489
+ chooseImageAsync(options?: Omit<ChooseImageOptions, "success" | "fail" | "complete">): Promise<ChooseImageResult>;
499
490
  /** 获取图片功能能力信息 */
500
491
  getImageCapabilities(): ImageCapabilities;
501
492
 
502
493
  /** 位置选择(Promise版本) */
503
- chooseLocationAsync(
504
- options?: Omit<ChooseLocationOptions, "success" | "fail" | "complete">,
505
- ): Promise<ChooseLocationResult>;
494
+ chooseLocationAsync(options?: Omit<ChooseLocationOptions, "success" | "fail" | "complete">): Promise<ChooseLocationResult>;
506
495
  /** 获取位置选择功能能力信息 */
507
496
  getChooseLocationCapabilities(): ChooseLocationCapabilities;
508
497
 
@@ -514,42 +503,31 @@ declare namespace UniWebView {
514
503
  /** 定向分享模块:仅 H5 -> 宿主 WebView */
515
504
  shareDirected(options: ShareDirectedOptions): Promise<ShareResult> | void;
516
505
  shareMiniProgramCard(options: ShareMiniProgramCardOptions): Promise<ShareResult> | void;
517
- shareDirectedAsync(
518
- options: Omit<ShareDirectedOptions, "success" | "fail" | "complete">,
519
- ): Promise<ShareResult>;
506
+ shareDirectedAsync(options: Omit<ShareDirectedOptions, "success" | "fail" | "complete">): Promise<ShareResult>;
520
507
 
521
- /** 手动分享预览:仅微信小程序 web-view,触发宿主分享弹窗 */
508
+ /** 手动分享预览:仅微信小程序 web-view,触发宿主分享弹窗 */
522
509
  manualShare(options: ManualShareOptions): Promise<ShareResult> | void;
523
- manualShareAsync(
524
- options: Omit<ManualShareOptions, "success" | "fail" | "complete">,
525
- ): Promise<ShareResult>;
510
+ manualShareAsync(options: Omit<ManualShareOptions, "success" | "fail" | "complete">): Promise<ShareResult>;
526
511
 
527
512
  /** 蓝牙 API */
528
513
  openBluetoothAdapter(options?: BluetoothOptions): Promise<any> | void;
529
514
  openBluetoothAdapterAsync(options?: BluetoothOptions): Promise<any>;
530
- startBluetoothDevicesDiscovery(
531
- options?: BluetoothOptions,
532
- ): Promise<any> | void;
533
- startBluetoothDevicesDiscoveryAsync(
534
- options?: BluetoothOptions,
535
- ): Promise<any>;
515
+ startBluetoothDevicesDiscovery(options?: BluetoothOptions): Promise<any> | void;
516
+ startBluetoothDevicesDiscoveryAsync(options?: BluetoothOptions): Promise<any>;
536
517
  onBluetoothDeviceFound(options?: BluetoothOptions): Promise<any> | void;
537
518
  onBluetoothDeviceFoundAsync(options?: BluetoothOptions): Promise<any>;
538
519
  createBLEConnection(options?: BluetoothOptions): Promise<any> | void;
539
520
  createBLEConnectionAsync(options?: BluetoothOptions): Promise<any>;
540
521
 
541
522
  /** 打印PDF API */
542
- printPdf(
543
- options: PrintPdfOptions,
544
- callback: (result: PrintPdfResult) => void,
545
- ): void;
523
+ printPdf(options: PrintPdfOptions, callback: (result: PrintPdfResult) => void): void;
546
524
  printPdfAsync(options: PrintPdfOptions): Promise<PrintPdfResult>;
547
525
  /** 获取打印PDF功能能力信息 */
548
526
  getPrintCapabilities(): PrintPdfCapabilities;
549
527
 
550
528
  /**
551
- * 人脸识别(仅支持微信小程序和 UniApp 环境)
552
- * 微信环境通过 wx.miniProgram.navigateTo 跳转宿主 /pages/face/index,UniApp 环境通过桥接调用宿主实现
529
+ * 人脸识别(仅支持微信小程序和 UniApp 环境)
530
+ * 微信环境通过 wx.miniProgram.navigateTo 跳转宿主 /pages/face/index,UniApp 环境通过桥接调用宿主实现
553
531
  */
554
532
  faceVerify(options: FaceVerifyOptions): void;
555
533
  /** 获取人脸识别功能能力信息 */