qsh-webview-sdk 2.4.3 → 2.4.5

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
@@ -56,14 +56,20 @@ qsh.ready().then(() => {
56
56
  ```javascript
57
57
  import qsh from 'qsh-webview-sdk';
58
58
 
59
+ // 如果路由使用了hash模式,则只需在App.vue中config一次,url可以不传
60
+ // 如果是非hash模式, 则需要在每次路由变化时重新config, 且要传入完整的url
59
61
  if(qsh.environment.isWeixinMiniProgram) {
60
62
  qsh.config({
61
63
  clientId: 'your-client-id', // 注意区分生产和测试的clientId
62
- isProd: false
64
+ isProd: false,
65
+ debug: false, // isProd 为 true 时会强制关闭
66
+ url: '' // 可选:传入后用于微信签名,默认使用当前页面 URL
63
67
  })
64
68
  }
65
69
 
66
70
  // isProd 默认为 false: 根据环境传入
71
+ // debug 默认为 false: 仅在 isProd 为 false 时可开启
72
+ // url 默认为空: 有值时会替代当前页面 URL 参与微信签名
67
73
  // 依赖微信 JS-SDK 的能力前,建议先注入 clientId
68
74
  // 已调用 qsh.config() 时,qsh.ready() 会在微信小程序 web-view 中额外等待 wx.config 完成
69
75
  await qsh.ready();
@@ -492,8 +498,8 @@ try {
492
498
  ```javascript
493
499
  // 打开地图查看指定位置
494
500
  qsh.openLocation({
495
- latitude: 39.908823,
496
- longitude: 116.397470,
501
+ latitude: 39.908823, // 需传入wgs84坐标
502
+ longitude: 116.397470, // 需传入wgs84坐标
497
503
  name: '天安门',
498
504
  address: '北京市东城区东长安街',
499
505
  scale: 15, // 缩放级别 1-28
@@ -504,8 +510,8 @@ qsh.openLocation({
504
510
 
505
511
  // Promise 版本
506
512
  await qsh.openLocationAsync({
507
- latitude: 39.908823,
508
- longitude: 116.397470,
513
+ latitude: 39.908823, // 需传入wgs84坐标
514
+ longitude: 116.397470, // 需传入wgs84坐标
509
515
  name: '天安门'
510
516
  });
511
517
  ```
@@ -698,7 +704,9 @@ onMounted(async () => {
698
704
  if (qsh.environment.isWeixinMiniProgram) {
699
705
  qsh.config({
700
706
  clientId: '', // 注意区分生产和测试的clientId
701
- isProd: import.meta.env.MODE === 'production'
707
+ isProd: import.meta.env.MODE === 'production',
708
+ debug: false,
709
+ url: ''
702
710
  })
703
711
  }
704
712